Issue created - https://github.com/google/protobuf/issues/721
On Monday, 17 August 2015 14:57:32 UTC+10, Dave Hirschfeld wrote: > > > On Monday, 17 August 2015 14:01:40 UTC+10, Feng Xiao wrote: >> >> On Sun, Aug 16, 2015 at 8:47 PM, Dave Hirschfeld <[email protected]> >> wrote: >> >>> Trying to build the python package from the latest master on Windows >>> with msvc I'm getting link errors shown below. Just want to check if this >>> is this a known problem with the current master? Builds from a couple of >>> weeks ago worked. >>> >> We don't yet have test to cover python C++ extension build on Windows, so >> it might be broken without notice (or maybe it doesn't work from the >> beginning..). Feel free to submit an issue for this, or better help send >> us a patch to fix the issue :) >> >> >>> >>> Thanks, >>> Dave >>> >>> >>> C:\Program Files (x86)\Microsoft Visual Studio >>> 12.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO >>> /LIBPATH:C:\Anaconda3\conda-bld\work\cmake\Release >>> /LIBPATH:C:\Anaconda3\envs\_build\libs >>> /LIBPATH:C:\Anaconda3\envs\_build\PCbuild\amd64 libprotobuf.lib >>> /EXPORT:init_message >>> build\temp.win-amd64-2.7\Release\google/protobuf/pyext\descriptor.obj >>> build\temp.win-amd64-2.7\Release\google/protobuf/pyext\descriptor_containers.obj >>> >>> build\temp.win-amd64-2.7\Release\google/protobuf/pyext\descriptor_pool.obj >>> build\temp.win-amd64-2.7\Release\google/protobuf/pyext\extension_dict.obj >>> build\temp.win-amd64-2.7\Release\google/protobuf/pyext\message.obj >>> build\temp.win-amd64-2.7\Release\google/protobuf/pyext\message_map_container.obj >>> >>> build\temp.win-amd64-2.7\Release\google/protobuf/pyext\repeated_composite_container.obj >>> >>> build\temp.win-amd64-2.7\Release\google/protobuf/pyext\repeated_scalar_container.obj >>> >>> build\temp.win-amd64-2.7\Release\google/protobuf/pyext\scalar_map_container.obj >>> >>> /OUT:build\lib.win-amd64-2.7\google\protobuf\pyext\_message.pyd >>> /IMPLIB:build\temp.win-amd64-2.7\Release\google/protobuf/pyext\_message.lib >>> /MANIFESTFILE:build\temp.win-amd64-2.7\Release\google/protobuf/pyext\_message.pyd.manifest >>> >>> <snip> > >> >>> repeated_composite_container.obj : error LNK2001: unresolved external >>> symbol "int __cdecl google::protobuf::internal::Barrier_AtomicIncrement(int >>> volatile *,int)" >>> (?Barrier_AtomicIncrement@internal@protobuf@google@@YAHPECHH@Z) >>> >>> build\lib.win-amd64-2.7\google\protobuf\pyext\_message.pyd : fatal error >>> LNK1120: 4 unresolved externals >>> error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio >>> 12.0\\VC\\BIN\\amd64\\link.exe' failed with exit status 1120 >>> >>> >>> > > The above error was a red-herring. The original error I got was a bunch of > LNK2038 errors like below: > <snip> > libprotobuf.lib(coded_stream.obj) : error LNK2038: mismatch detected for > 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value > 'MD_DynamicRelease' in descriptor.obj > > libprotobuf.lib(message_lite.obj) : error LNK2038: mismatch detected for > 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value > 'MD_DynamicRelease' in descriptor.obj > <snip> > > In attempting to fix the problem by changing cmake to build shared libs I > got the LNK1120 "unresolved externals" errors. > > It appears that the original LNK2038 MT/MD errors are because of the below > commit: > > > https://github.com/google/protobuf/commit/1858ac9b42c167ab6d89b929c075872d740eb0b5 > > Simply reverting that commit allows the python build to proceed. > > I'd send a patch to revert it but it was obviously made for some reason. > As it is it doesn't appear to be compatible with building the python > extension and I'm not sure how to fix that (or even if it's possible). > > To get my conda package to build I'm currently just reverting that > change. The resulting package can be installed (for py27/py3.4) from my > anaconda.org channel: > > conda install -c dhirschfeld protobuf > > Regards, > Dave > > > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
