link problem: boost + stlport + msvc8
Hi, This is my first post to the mailing list, and I hope I'm not bringing up a silly issue but I've been over this a million times already and I still can't figure it out, so any help is greatly appreciated. This is my setup: Windows XP SP2 Visual Studio 2005 STLport-5.1.5 boost_1_34_1 I'm trying to write a tiny program, just to get stlport and boost to play nice together and I still have "unresolved external symbol" errors. I downloaded stlport-5.1.5 and built it according to the instructions: * configure.bat -c msvc8 * nmake /f msvc.mak * nmake /f msvc.mak install I also added stlport\bin to my path Next, I downloaded the boost_1_34_1 windows installer and checked all the options to get all the libraries and added it to my path. Next, I configured visual studio 2005 as follows: Tools -> Options -> Project and Solutions -> VC++ Directories -> Show directories for: Include Files: Add the path to stlport headers (D:\Program Files\STLport-5.1.5\stlport) Library Files: Add the path to stlport libs (D:\Program Files\STLport-5.1.5\lib) Next, on the project level, I Added __STL_DEBUG to the list of preprocessors. I'm trying to build a Multi-threaded Debug DLL (/MDd). I also set the (/Zc:wchar_t-) option. When I tried to link, I got an error saying that libboost_program_options-vc80-mt-gdp-1_34_1.lib could not be found, so I had to build it. I edited the user-config.jam file to add the following line: using stlport : : D:/Program Files/STLport-5.1.5 D:/Program Files/STLport-5.1.5/lib ; This is the command I used to build the new lib bjam --toolset=msvc-8.0 link=static stdlib=stlport threading=multi cxxflags="-Zc:wchar_t-" --with-program_options -a -d2 I built the lib and moved it from bin.v2 to lib. As you can see I took every precaution with wchar_t so that all the libs are compatible, and still every time I try to link the simple program I get this error: error LNK2019: unresolved external symbol "public: __thiscall boost::program_options::options_description::options_description(class stlpd_std::basic_string<char,class stlpd_std::char_traits<char>,class stlpd_std::allocator<char> > const &,unsigned int)" (??0options_description@program_options@boost@@QAE@ABV?$basic_string@DV? $char_traits@D@stlpd_std@@V?$allocator@D@2@@stlpd_std@@I@Z) referenced in function _main This is the simple program in question #include <iostream> #include <boost/program_options.hpp> int main(int argc, char* argv[]) { std::cout<<"boost stlport test\n"; boost::program_options::options_description desc("Allowed options"); } Any help is greatly appreciated Thx Gabriel ******************************* This e-mail contains information for the intended recipient only. It may contain proprietary material or confidential information. If you are not the intended recipient you are not authorised to distribute, copy or use this e-mail or any attachment to it. Murex cannot guarantee that it is virus free and accepts no responsibility for any loss or damage arising from its use. If you have received this e-mail in error please notify immediately the sender and delete the original email received, any attachments and all copies from your system.
Hi Gabriel,
I’m trying to write a tiny program, just to get stlport and boost to play nice together and I still have “unresolved external symbol” errors.
When I tried to link, I got an error saying that libboost_program_options-vc80-mt-gdp-1_34_1.lib could not be found, so I had to build it.
Just a guess: Did you add BOOST_ALL_DYN_LINK to your preprocessor definitions? Kind regards, Rainer
Hi Rainer, I'm trying to link statically so setting this option would require dynamic linking and another lib: boost_program_options-vc80-mt-gdp-1_34_1.lib When I try to build this lib, I get a lot of warnings of this kind: ..\..\..\boost/program_options/errors.hpp(21) : warning C4275: non dll-interface class 'std::logic_error' used as base for dll-int erface class 'boost::program_options::error' D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\stdexcept(22) : see declaration of 'std::logic_error' ..\..\..\boost/program_options/errors.hpp(21) : see declaration of 'boost::program_options::error' ..\..\..\boost/program_options/errors.hpp(61) : warning C4251: 'boost::program_options::ambiguous_option::alternatives' : class 's td::vector<_Ty>' needs to have dll-interface to be used by clients of class 'boost::program_options::ambiguous_option' with [ _Ty=std::string ] I eventually was able to build this lib and when I build my project I still got the same warnings and the same error :( -----Message d'origine----- De : boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] De la part de Rainer Thaden Envoyé : mercredi 5 mars 2008 18:20 À : boost-users@lists.boost.org Objet : Re: [Boost-users] link problem: boost + stlport + msvc8 Hi Gabriel,
I'm trying to write a tiny program, just to get stlport and boost to play nice together and I still have "unresolved external symbol" errors.
When I tried to link, I got an error saying that libboost_program_options-vc80-mt-gdp-1_34_1.lib could not be found, so I had to build it.
Just a guess: Did you add BOOST_ALL_DYN_LINK to your preprocessor definitions? Kind regards, Rainer _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users ******************************* This e-mail contains information for the intended recipient only. It may contain proprietary material or confidential information. If you are not the intended recipient you are not authorised to distribute, copy or use this e-mail or any attachment to it. Murex cannot guarantee that it is virus free and accepts no responsibility for any loss or damage arising from its use. If you have received this e-mail in error please notify immediately the sender and delete the original email received, any attachments and all copies from your system.
participants (2)
-
CHABO Gabriel
-
Rainer Thaden