Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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:1 by olli, 10 years ago

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

__exit

(two underscores!) is unknown

maybe something with the build-env is wron, especially because the runtime function

__DllMainCRTStartup

is also unresolved.

Maybe you mixed debug with release versions in the build-env?

Last edited 10 years ago by olli (previous) (diff)

comment:2 by olli, 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?!

Last edited 10 years ago by olli (previous) (diff)

in reply to:  description comment:3 by olli, 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:4 by olli, 10 years ago

Resolution: fixed
Status: newclosed

fixed

in reply to:  4 ; comment:5 by anonymous, 10 years ago

Replying to olli:

fixed

How was this fixed?

in reply to:  5 comment:6 by anonymous, 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.

Note: See TracTickets for help on using tickets.