Boost logo

Boost :

From: Dan McLeran (dan.mcleran_at_[hidden])
Date: 2005-10-28 10:12:48


Yesterday, I tried upgrading from Boost 1.30 to 1.33 and I got the weirdest
reaction from my linker. Some background: I am using MSVC6SP6; The code in
question is a dll that runs under PharLap 9.1. I am linking against libcmt
as well as a lib called cellexe.lib, which provides all of the C runtime
stuff and PharLap-specific OS stuff. With Boost 1.30, everything compiles
and links just peachy. When I pointed the project at Boost 1.33, I had to
make a couple of small code changes:

1. I had to change boost::mpl::apply_if to boost::mpl::eval_if.
2. I had to stop using TrivialIteratorConcept and switched to
ForwardIteratorConcept or RandomAccessIteratorConcept.

That's really the only code changes I can think of but now my linker gives
me a bunch of warnings and 1 error message, which is what's really killing
me:

Linking...
LIBCMT.lib(typinfo.obj) : error LNK2005: "const type_info::`vftable'"
(??_7type_info@@6B@) already defined in cellexe.lib(Cellexe.exe)
LIBCMT.lib(strtol.obj) : error LNK2005: _strtoul already defined in
cellexe.lib(Cellexe.exe)
LIBCMT.lib(chkstk.obj) : error LNK2005: __chkstk already defined in
cellexe.lib(Cellexe.exe)
LIBCMT.lib(xtoa.obj) : error LNK2005: __ultoa already defined in
cellexe.lib(Cellexe.exe)
LIBCMT.lib(atox.obj) : error LNK2005: _atoi already defined in
cellexe.lib(Cellexe.exe)
LIBCMT.lib(typinfo.obj) : warning LNK4006: "const type_info::`vftable'"
(??_7type_info@@6B@) already defined in cellexe.lib(Cellexe.exe); second
definition ignored
LIBCMT.lib(strtol.obj) : warning LNK4006: _strtoul already defined in
cellexe.lib(Cellexe.exe); second definition ignored
LIBCMT.lib(chkstk.obj) : warning LNK4006: __chkstk already defined in
cellexe.lib(Cellexe.exe); second definition ignored
LIBCMT.lib(xtoa.obj) : warning LNK4006: __ultoa already defined in
cellexe.lib(Cellexe.exe); second definition ignored
LIBCMT.lib(atox.obj) : warning LNK4006: _atoi already defined in
cellexe.lib(Cellexe.exe); second definition ignored
   Creating library PharLapRelease/Devo.lib and object
PharLapRelease/Devo.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
PharLapRelease/Devo.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

I can't understand why the linker is now searching for _main when the
project is a dll and I have all the necessary stuff: .def file, /dll switch,
etc. I have compiled and run this dll for literally years when using Boost
1.30.

Can anyone think of anything in this Boost library upgrade that could cause
this? Keep in mind that I did not change any project setting other than the
include directories to point the compiler at the directories containing
Boost 1.33 and that I have been using this code along with Boost 1.30 for
years.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk