#7864 closed Bugs (fixed)
Boost.Context fails to build with Visual Studio
Reported by: | Marshall Clow | Owned by: | olli |
---|---|---|---|
Milestone: | Boost 1.53.0 | Component: | context |
Version: | Boost 1.52.0 | Severity: | Showstopper |
Keywords: | Cc: |
Description
In the 1.53.0 beta1, Boost.Context fails to build:
C:\VC\boost_1_53_0_beta1>b2 --build-type=complete msvc.link.dll bin.v2\libs\context\build\msvc-11.0\debug\threading-multi\boost_context-vc110-mt-gd-1_53.dll Creating library bin.v2\libs\context\build\msvc-11.0\debug\threading-multi\boost_context-vc110-mt-gd-1_53.lib and object bin.v2\libs\context\build\msvc-11.0\ debug\threading-multi\boost_context-vc110-mt-gd-1_53.exp make_i386_ms_pe_masm.obj : error LNK2019: unresolved external symbol __exit referenced in function _make_fcontext LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 bin.v2\libs\context\build\msvc-11.0\debug\threading-multi\boost_context-vc110-mt-gd-1_53.dll : fatal error LNK1120: 2 unresolved externals <snip>
On the boost list, Tom Kent reported:
I'm showing the same errors for all visual studio versions I run (VC8, VC9, VC10, and VC11) with 32&64 bit complies.
Change History (6)
comment:2 by , 10 years ago
regression tests in trunk do not show errors?!
'teeks99-1a-win7-32on64' : rev. 82379 from 7.1.2013 msvc 10.0/11.0 -> pass, 'teeks99-1a-win7-64on64' : rev. 82376 from 6.1.2013 msvc 11.0 -> pass, 'id' : rev. 82359 from 4.1.2013 msvc 9.0 -> pass, ...
maybe some modifications in the toolchain might cause the linker error?!
comment:3 by , 10 years ago
Replying to marshall:
In the 1.53.0 beta1, Boost.Context fails to build:
C:\VC\boost_1_53_0_beta1>b2 --build-type=complete msvc.link.dll bin.v2\libs\context\build\msvc-11.0\debug\threading-multi\boost_context-vc110-mt-gd-1_53.dll Creating library bin.v2\libs\context\build\msvc-11.0\debug\threading-multi\boost_context-vc110-mt-gd-1_53.lib and object bin.v2\libs\context\build\msvc-11.0\ debug\threading-multi\boost_context-vc110-mt-gd-1_53.exp make_i386_ms_pe_masm.obj : error LNK2019: unresolved external symbol __exit referenced in function _make_fcontext LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 bin.v2\libs\context\build\msvc-11.0\debug\threading-multi\boost_context-vc110-mt-gd-1_53.dll : fatal error LNK1120: 2 unresolved externals <snip>On the boost list, Tom Kent reported:
I'm showing the same errors for all visual studio versions I run (VC8, VC9, VC10, and VC11) with 32&64 bit complies.
regression tests in trunk do not show errors?!
'teeks99-1a-win7-32on64' : rev. 82379 from 7.1.2013 msvc 10.0/11.0 -> pass, 'teeks99-1a-win7-64on64' : rev. 82376 from 6.1.2013 msvc 11.0 -> pass, 'id' : rev. 82359 from 4.1.2013 msvc 9.0 -> pass, ...
maybe some modifications in the toolchain might cause the linker error?!
comment:6 by , 10 years ago
Replying to anonymous:
Replying to olli:
fixed
How was this fixed?
MSVC adds automatically some runtime support like DllMainCRTStartup if cpp files are compiled for a library. Code from cpp files ware removed so that only assembler files remained. Adding an empty dummy.cpp for MSVC solved the linker error regarding to unresolved symbols.
make_i386_ms_pe_masm.obj is compiled from make_i386_ms_pe_masm.asm
make_i386_ms_pe_masm.asm references _exit() (from C-library)
as the linker output describes symbol
(two underscores!) is unknown
maybe something with the build-env is wron, especially because the runtime function
is also unresolved.
Maybe you mixed debug with release versions in the build-env?