msvc 8.0 express + date_time + greg_month + static .libs issue
Hi I have a small project with boost 1.33 + libtorrent 0.10 + wxwidgets 2.7.0 + msvc 8.0 (2005) express. in project config -> linker -> input -> add. dep. I have (among other libs): libboost_filesystem-vc80-mt-gd.lib libboost_thread-vc80-mt-gd.lib libboost_date_time-vc80-mt-gd.lib and linker says: tracker_manager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (__imp_??0greg_month@gregorian@boost@@QAE@G@Z) web_peer_connection.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (__imp_??0greg_month@gregorian@boost@@QAE@G@Z) storage.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (__imp_??0greg_month@gregorian@boost@@QAE@G@Z) Now, when I change libboost_date_time-vc80-mt-gd.lib to boost_date_time-vc80-mt-gd.lib then it links fine and runs fine, excpet that .exe it needs boost_date_time-vc80-mt-gd-1_33_1.dll in a running directory. Why isnt gregorian stuff in boost_date_time*.lib -s ?
V wrote:
Hi
I have a small project with boost 1.33 + libtorrent 0.10 + wxwidgets 2.7.0 + msvc 8.0 (2005) express.
in project config -> linker -> input -> add. dep. I have (among other libs): libboost_filesystem-vc80-mt-gd.lib libboost_thread-vc80-mt-gd.lib libboost_date_time-vc80-mt-gd.lib
and linker says: tracker_manager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (__imp_??0greg_month@gregorian@boost@@QAE@G@Z) web_peer_connection.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (__imp_??0greg_month@gregorian@boost@@QAE@G@Z) storage.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (__imp_??0greg_month@gregorian@boost@@QAE@G@Z)
Now, when I change libboost_date_time-vc80-mt-gd.lib to boost_date_time-vc80-mt-gd.lib
then it links fine and runs fine, excpet that .exe it needs boost_date_time-vc80-mt-gd-1_33_1.dll in a running directory.
Why isnt gregorian stuff in boost_date_time*.lib -s ?
These functions are all inline in 1.33 AFAIK....so this seems strange. Are you using to_string/from_string? If so, you might be able to eliminate these and get rid of the library altogether. Anyway, there are 2 kinds of linking: static and dynamic. On windows for static linking you typically have a single .lib file to statically link the functions. For dynamic linking you have a .lib for build time and then need the .dll are runtime. My guess is that somehow you are linking against the 'dynamic .lib' instead of the 'static .lib'.... Sorry if this is a bit sketchy...I don't develop with Boost on Windows much so I don't have a built directory to reference at the moment... Jeff Jeff
Jeff Garland wrote:
V wrote:
Hi
I have a small project with boost 1.33 + libtorrent 0.10 + wxwidgets 2.7.0 + msvc 8.0 (2005) express.
in project config -> linker -> input -> add. dep. I have (among other libs): libboost_filesystem-vc80-mt-gd.lib libboost_thread-vc80-mt-gd.lib libboost_date_time-vc80-mt-gd.lib
and linker says: tracker_manager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (__imp_??0greg_month@gregorian@boost@@QAE@G@Z) web_peer_connection.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (__imp_??0greg_month@gregorian@boost@@QAE@G@Z) storage.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (__imp_??0greg_month@gregorian@boost@@QAE@G@Z)
VC8 gives different names to these functions depending on whether they're labled dllexport or not. That in turn depends on whether either of BOOST_DATE_TIME_DYN_LINK or BOOST_ALL_DYN_LINK is defined. My guess is that one of these must be defined in your project settings, as the default behaviour is to set things up for static linking. If you're completely sure that's not the case then shout and we'll investigate further, but from a quick scan of the headers everything looks to be in order. HTH, John.
participants (3)
-
Jeff Garland
-
John Maddock
-
V