System info:
Description:
This is a C++ program, and it is developed with Debian. Now, I hope I can run it with FreeBSD, the problem is I can compile but it finally end up with linking errors:
Here is a part from the cmake(1) config file, I think it is fine, because I can compile and link the code on Debian.
The CMAKE_SYSTEM_LIBRARY_PATH variable was checked, and it looks fine. So, I have no idea.
Debian use gnu make, but FreeBSD provide a different make, it that matters?
Code:
uname -a
FreeBSD vm-freebsd 10.2-RELEASE-p7 FreeBSD 10.2-RELEASE-p7 #0: Mon Nov 2 14:19:39 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
Code:
% cmake --version
cmake version 3.4.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
Description:
This is a C++ program, and it is developed with Debian. Now, I hope I can run it with FreeBSD, the problem is I can compile but it finally end up with linking errors:
Code:
/home/fender/pj/project/src/main.cpp:17: undefined reference to `boost::program_options::eek:ptions_description::eek:ptions_description(std::string const&, unsigned int, unsigned int)'
/home/fender/pj/project/src/main.cpp:37: undefined reference to `boost::program_options::eek:perator<<(std::eek:stream&, boost::program_options::eek:ptions_description const&)'
/home/fender/pj/project/src/main.cpp:68: undefined reference to `boost::program_options::eek:perator<<(std::eek:stream&, boost::program_options::eek:ptions_description const&)'
Here is a part from the cmake(1) config file, I think it is fine, because I can compile and link the code on Debian.
The CMAKE_SYSTEM_LIBRARY_PATH variable was checked, and it looks fine. So, I have no idea.
Code:
add_executable(${target} ${source_file_list})
find_library(boost_program_options libboost_program_options.so)
find_library(boost_system libboost_system.so)
find_library(boost_regex libboost_regex.so)
find_library(boost_date_time libboost_date_time.so)
find_library(pqxx libpqxx.so)
target_link_libraries(${target} ${boost_program_options})
target_link_libraries(${target} ${boost_system})
target_link_libraries(${target} ${boost_regex})
target_link_libraries(${target} ${boost_date_time})
target_link_libraries(${target} ${pqxx})
#target is the binary file name
#source_file_list is the source file list