Boost logo

Boost Users :

From: pheres (pheres_at_[hidden])
Date: 2007-07-02 10:39:56


Hello,

I run into following problems compiling a programm what uses
boost::program_options under gcc version 3.4.2 / mingw:

---------------------------------------------------------------------------------------------------------------------------
++ -mthreads src/entity/EntityManager.o src/entity/TestJob.o lib/Sched.lib
lib/Timer.lib /C/workspace-eclipse/ReflectiveMemory.Linux/lib/mingw/debug/libsw_rm.dll /mingw/lib/libwsock32.a ../../src/common/lib/libpthreadGC2.a /mingw/lib/libwinmm.a /C/workspace-eclipse/libs/boost_1_33_1.mingw_precompiled/lib/libboost_filesystem-mgw.lib /C/workspace-eclipse/libs/boost_1_33_1.mingw_precompiled/lib/boost_date_time-mgw.lib /C/workspace-eclipse/libs/boost_1_33_1.mingw_precompiled/lib/boost_program_options-mgw.lib -o
bin/EntityManager.exe
Info: resolving vtable for boost::program_options::variables_mapby linking to
__imp___ZTVN5boost15program_options13variables_mapE (auto-import)
Info: resolving vtable for
boost::program_options::value_semantic_codecvt_helper<char>by linking to
__imp___ZTVN5boost15program_options29value_semantic_codecvt_helperIcEE
(auto-import)
Info: resolving boost::program_options::arg by linking to
__imp___ZN5boost15program_options3argE (auto-import)
Info: resolving vtable for boost::program_options::validation_errorby linking
to __imp___ZTVN5boost15program_options16validation_errorE (auto-import)
src/entity/EntityManager.o: In function
`basic_command_line_parser':c:/workspace-eclipse/libs/boost_1_33_1.mingw_precompiled/include/boost-1_33_1/boost/program_options/detail/parsers.hpp:42:
undefined reference to
`boost::program_options::detail::cmdline::cmdline(std::vector<std::string,
std::allocator<std::string> > const&)'
src/entity/EntityManager.o:c:/workspace-eclipse/libs/boost_1_33_1.mingw_precompiled/include/boost-1_33_1/boost/program_options/detail/parsers.hpp:49:
undefined reference to
`boost::program_options::detail::cmdline::set_options_description(boost::program_options::options_description
const&)'
src/entity/EntityManager.o:c:/workspace-eclipse/libs/boost_1_33_1.mingw_precompiled/include/boost-1_33_1/boost/program_options/detail/parsers.hpp:67:
undefined reference to `boost::program_options::detail::cmdline::style(int)'
src/entity/EntityManager.o:c:/workspace-eclipse/libs/boost_1_33_1.mingw_precompiled/include/boost-1_33_1/boost/program_options/detail/parsers.hpp:75:
undefined reference to
`boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::string,
std::string>, std::string const&, std::allocator<boost::function_base> >)'
src/entity/EntityManager.o:c:/workspace-eclipse/libs/boost_1_33_1.mingw_precompiled/include/boost-1_33_1/boost/program_options/detail/parsers.hpp:102:
undefined reference to `boost::program_options::detail::cmdline::run()'
collect2: ld returned 1 exit status
make[1]: *** [bin/EntityManager.exe] Error 1
make[1]: Leaving directory `/c/workspace-eclipse/SimulationEngine/mingw/debug'
make: *** [Tests] Error 2
---------------------------------------------------------------------------------------------------------------------------

here is the fragment that causes that behavior:

---------------------------------------------------------------------------------------------------------------------------
        // Declare the supported options.
        po::options_description desc("Allowed options");
        desc.add_options()
            ("help", "produce help message")
            ("client_id", po::value<int>(&mClientId),
            "set em's client id.")
            ("srv_ip", po::value<string>(&mSrvIp),
            "set SWRM server ip adress. Default is 127.0.0.1")
            ("srv_port", po::value<int>(&mSrvPort),
            "set SWRM server port number. Default is 8011")
            ;
        
        po::variables_map vm;

// trouble starts with commenting in the following line(s):

// po::store(po::parse_command_line(globalArgc, globalArgv, desc),
// vm);
// po::notify(vm);
//
// if (vm.count("help"))
// {
// cout << desc << "\n";
// exit(EXIT_SUCCESS);
// }
//
// if (0 == mClientId)
// {
// cout << "No client_id set. Exiting...\n";
// exit(EXIT_FAILURE);
// }
// if( 2 > mClientId )
// {
// cout << "Client_id has to be greater than 1."
// << " 1 is reserved for SWRM server. Exiting...\n";
// exit(EXIT_FAILURE);
// }else
// {
// cout << "client_id of this EM was set to "
// << mClientId << "\n";
// }
//
// if (vm.count("srv_ip"))
// {
// cout << "SWRM server ip set to " << mSrvIp << "\n";
// }else
// {
// cout << "SWRM server ip set to " << mSrvIp << "\n";
// }
//
// if (vm.count("srv_port"))
// {
// cout << "SWRM server port set to " << mSrvPort << "\n";
// }else
// {
// cout << "SWRM server port set to " << mSrvPort << "\n";
// }
---------------------------------------------------------------------------------------------------------------------------

All does compile fine under linux. And also the other boost libs I'm using
(filesystem and date_time) behave well.

What I'm doing wrong?

Thank you in advance!


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net