I am absolutely horrible with compiling/linking.
I have tried everything i could find, nothing works.
websockserver.h:516: undefined reference to `qfs_init'
websockserver.h:527: undefined reference to `qfs_read'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Rmdir(char const*)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Remove(char const*)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Open(char const*, int, int, int, int, int, int, unsigned short, signed char, signed char)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Write(int, char const*, unsigned long)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Read(int, char*, unsigned long)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Rename(char const*, char const*, bool)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Tell(int)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Seek(int, long, int)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Stat(char const*, KFS::KfsFileAttr&, bool)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Close(int)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Create(char const*, int, bool, int, int, int, int, bool, unsigned short, signed char, signed char)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Sync(int)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::IsDirectory(char const*)'
./cqfs//libcqfs.so: undefined reference to `KFS::ErrorCodeToStr(int)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::IsFile(char const*)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Exists(char const*)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Mkdir(char const*, unsigned short)'
./cqfs//libcqfs.so: undefined reference to `KFS::KfsClient::Readdir(char const*, std::vector<std::string, std::allocator<std::string> >&)'
./cqfs//libcqfs.so: undefined reference to `KFS::Connect(std::string const&, int)'
collect2: error: ld returned 1 exit status
make: *** [w] Error 1
websockserver.h:514 to 530
long numbytes;
struct cqfs *qfs;
if(!qfs_init(&qfs, "127.0.0.1", 20000))
printf("Failed to init qfs connection\n");
int fd = qfs_open(qfs, "APP.js", O_RDONLY);
if(fd < 0)
printf("Error opening file: %s\n", qfs_error(qfs));
numbytes = (long)qfs_seek(qfs, fd, 0L, SEEK_END);
qfs_seek(qfs, fd, 0L, SEEK_SET);
ret = calloc(numbytes + 1, sizeof(char));
if(qfs_read(qfs, fd, ret, numbytes) < 0)
printf("Error reading file: %s\n", qfs_error(qfs));
qfs_close(qfs, fd);
QFS provides .so and .a of
libqfs_client
libqfs_qcdio
libqfs_io
libqfs_common
libqfs_qcrs
How do i build my wrapper (cqfs.cpp, cqfs.h)?
This is my current command:
g++ -Wall -DBOOST_SP_USE_QUICK_ALLOCATOR -shared -o libcqfs.so cqfs.cpp cqfs.h -fPIC -L./libqfs_client.so -L./libqfs_qcdio.so -lpthread -lrt -L./libqfs_io.so -L./libqfs_common.so -L./libqfs_qcdio.so -lpthread -lz -lrt -lboost_regex-mt -lcrypto -L./libqfs_qcrs.so -lc
based on the example application(not library) provided by Quantcast:
c++ -Wall -DBOOST_SP_USE_QUICK_ALLOCATOR -g CMakeFiles/qfssample.dir/qfssample_main.o -o qfssample -rdynamic ../../src/cc/libclient/libqfs_client.a ../../src/cc/qcdio/libqfs_qcdio.a -lpthread -lrt ../../src/cc/kfsio/libqfs_io.a ../../src/cc/common/libqfs_common.a ../../src/cc/qcdio/libqfs_qcdio.a -lpthread -lz -lrt -lboost_regex-mt -lcrypto ../../src/cc/qcrs/libqfs_qcrs.a
.a or .so did not make a difference
It looks like you are incorrectly using the -L argument to g++. The argument of -L should refer to the directory that contains the libraries, rather than directly referencing them.
To demonstrate, I created a simple example with a Connect and Readdir (I've omitted it for brevity, but let me know if you want to see it). Here is the c++ command I crafted to get it to compile and link correctly:
c++ -Wall -o t -I./build/release/include -L./build/release/lib t.cc -lqfs_client -lqfs_common -lqfs_io -lqfs_qcdio -lqfs_qcrs -lpthread -lboost_regex-mt -lz -lcrypto
One can then run it by specifying the LD_LIBRARY_PATH (DYLD_LIBRARY_PATH on Max OS X):
DYLD_LIBRARY_PATH=$PWD/build/release/lib ./t
.
..
dumpster
test
test2
test3
user
Note that you'll have to LD_LIBRARY_PATH instead of DYLD_LIBRARY_PATH on Linux.
We are actually working on building C bindings for QFS in the main project. Here is the pull request. If you're not comfortable with working directly from the fork (they are very experimental), you can check it out and build with make VERBOSE=1 to see the commands that are actually used to build the components and apply that to build your own bindings.
UPDATE: The C bindings for the QFS API are now available in the master branch.
For example, here is the line that is output to build the shared library on my mac:
/usr/bin/c++ -I/opt/local/include -Wall -DBOOST_SP_USE_QUICK_ALLOCATOR -O2 -g -shared -o libqfsc.dylib -install_name /Users/sday/c/qfs/build/release/src/cc/qfsc/libqfsc.dylib CMakeFiles/qfsc-shared.dir/qfsc.o ../libclient/libqfs_client.dylib ../kfsio/libqfs_io.dylib ../common/libqfs_common.dylib -lpthread -lz ../qcdio/libqfs_qcdio.dylib /usr/local/lib/libboost_regex-mt.dylib /usr/local/lib/libboost_system-mt.dylib ../qcrs/libqfs_qcrs.dylib -lcrypto
Disclaimer: I work for Quantcast.
Related
while compiling my cpp program for pop os using 7-zip lzma sdk i encounter the following errors
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000001410
/usr/bin/ld: Aes.o: in function 'AesGenTables':
/home/hitesh/lzma2201/C/Aes.c:130: undefined reference to 'AesCbc_Decode_HW'
/usr/bin/ld: /home/hitesh/lzma2201/C/Aes.c:133: undefined reference to 'AesCbc_Encode_HW'
/usr/bin/ld: /home/hitesh/lzma2201/C/Aes.c:134: undefined reference to 'AesCtr_Code_HW'
/usr/bin/ld: /home/hitesh/lzma2201/C/Aes.c:142: undefined reference to 'AesCbc_Decode_HW_256'
/usr/bin/ld: /home/hitesh/lzma2201/C/Aes.c:144: undefined reference to 'AesCtr_Code_HW_256'
/usr/bin/ld: LzFindMt.o: in function 'BtGetMatches(_CMatchFinderMt*, unsigned int*)':
/home/hitesh/lzma2201/C/LzFindMt.c:686: undefined reference to 'GetMatchesSpecN_2(unsigned char const*, unsigned long, unsigned char const*, unsigned int*, unsigned int, unsigned int*, unsigned long, unsigned int const*, unsigned int const*, unsigned int const*, unsigned long, unsigned int, unsigned int*)'
/usr/bin/ld: Sha256.o: in function 'Sha256Prepare':
/home/hitesh/lzma2201/C/Sha256.c:481: undefined reference to 'Sha256_UpdateBlocks_HW(unsigned int*, unsigned char const*, unsigned long)'
collect2: error: ld returned 1 exit status
here is the script used to compile the program.
run2.sh
for FILE in $(ls "/home/hitesh/lzma2201/C" | egrep '\.c$');
do
g++ -Wall -std=c++14 -g -c -D_7ZIP_ST -I"/home/hitesh/lzma2201/C" "/home/hitesh/lzma2201/C/"$FILE ;
done
g++ -std=c++14 -Wall -nostartfiles -g 7zAlloc.o 7zArcIn.o 7zBuf.o 7zBuf2.o 7zCrc.o 7zCrcOpt.o 7zDec.o 7zFile.o 7zStream.o Aes.o AesOpt.o Alloc.o Bcj2.o Bcj2Enc.o Bra.o Bra86.o BraIA64.o CpuArch.o Delta.o DllSecur.o LzFind.o LzFindMt.o Lzma2Dec.o Lzma2DecMt.o Lzma2Enc.o Lzma86Dec.o Lzma86Enc.o LzmaDec.o LzmaEnc.o LzmaLib.o MtCoder.o MtDec.o Ppmd7.o Ppmd7Dec.o Ppmd7Enc.o Sha256.o Sort.o Threads.o Xz.o XzCrc64.o XzCrc64Opt.o XzDec.o XzEnc.o XzIn.o -o compress -L"/home/hitesh/lzma2201/C"
I have tried using another versions of lzma sdk but that was resulting in different errors. I expected the program to run as it was running when i originally wrote the script in .c file for windows
I am trying to compile this code in CodeBlocks
#include <boost/filesystem.hpp>
#include <iostream>
using namespace boost::filesystem;
int main()
{
if ( !boost::filesystem::exists( "myfile.txt" ) )
{
std::cout << "Can't find my file!" << std::endl;
}
}
With this compile flags:
g++.exe -Wall -fexceptions -g -O3 -pedantic-errors -Wall -std=c++0x -lboost_system -IC:\Users\moe\Desktop\boost_1_67_0 -c C:\Users\moe\Desktop\oo\main.cpp -o obj\Debug\main.o
But I always receive this error:
boost::system::generic_category()
this is the error log, that i receive when i compile the code:
Untitled4.o: In function `boost::system::error_category::std_category::equivalent(std::error_code const&, int) const':
C:/Users/moe/Desktop/boost_1_67_0/boost/system/error_code.hpp:733: undefined reference to `boost::system::generic_category()'
C:/Users/moe/Desktop/boost_1_67_0/boost/system/error_code.hpp:736: undefined reference to `boost::system::generic_category()'
C:/Users/moe/Desktop/boost_1_67_0/boost/system/error_code.hpp:748: undefined reference to `boost::system::generic_category()'
Untitled4.o: In function `boost::system::error_category::std_category::equivalent(int, std::error_condition const&) const':
C:/Users/moe/Desktop/boost_1_67_0/boost/system/error_code.hpp:703: undefined reference to `boost::system::generic_category()'
C:/Users/moe/Desktop/boost_1_67_0/boost/system/error_code.hpp:706: undefined reference to `boost::system::generic_category()'
Untitled4.o: In function `boost::filesystem::path_traits::convert(char const*, char const*, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&)':
C:/Users/moe/Desktop/boost_1_67_0/boost/filesystem/path.hpp:981: undefined reference to `boost::filesystem::path::codecvt()'
C:/Users/moe/Desktop/boost_1_67_0/boost/filesystem/path.hpp:981: undefined reference to `boost::filesystem::path_traits::convert(char const*, char const*, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&, std::codecvt<wchar_t, char, int> const&)'
Untitled4.o: In function `boost::filesystem::exists(boost::filesystem::path const&)':
C:/Users/moe/Desktop/boost_1_67_0/boost/filesystem/operations.hpp:446: undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
collect2.exe: error: ld returned 1 exit status
Put the libraries at the end of the linker command line:
Why does the order of '-l' option in gcc matter?
Since your erro log also contained these:
C:/Users/moe/Desktop/boost_1_67_0/boost/filesystem/path.hpp:981: undefined reference to `boost::filesystem::path::codecvt()'
It is clear that you also lack -lboost_filesystem.
So there is no use to just add -lboost_system to the g++ command.
You can add -lboost_system -lboost_filesystem to your g++ command.
I've used the already compiled version of openCV for Raspberry Pi. link for anyone who is interested
After trying to compile using this command line
g++ test3.cpp -o test3 -I/usr/local/include/ -lraspicam -lraspicam_cv -L/opt/vc/lib -lmmal -lmmal_core -lmmal_util -I/usr/include -lopencv_core -lopencv_highgui -lopencv_imgproc -lwiringPi -lpthread
I get the following error lines.
//usr/local/lib/libopencv_stitching.so.2.4: undefined reference to `cv::gpu::ensureSizeIsEnough(int, int, int, cv::gpu::GpuMat&)'
//usr/local/lib/libopencv_calib3d.so.2.4: undefined reference to `cv::parallel_for_(cv::Range const&, cv::ParallelLoopBody const&, double)'
//usr/local/lib/libopencv_calib3d.so.2.4: undefined reference to `typeinfo for cv::ParallelLoopBody'
//usr/local/lib/libopencv_calib3d.so.2.4: undefined reference to `cv::Mutex::unlock()'
//usr/local/lib/libopencv_calib3d.so.2.4: undefined reference to `cv::Mutex::lock()'
//usr/local/lib/libopencv_ocl.so.2.4: undefined reference to cv::TLSDataContainer::getData() const
//usr/local/lib/libopencv_features2d.so.2.4: undefined reference to cv::AlgorithmInfo::addParam(cv::Algorithm&, char const*, unsigned char&, bool, unsigned char (cv::Algorithm::)(), void (cv::Algorithm::)(unsigned char), std::basic_string, std::allocator > const&)
//usr/local/lib/libopencv_features2d.so.2.4: undefined reference to `cv::AlgorithmInfo::addParam(cv::Algorithm&, char const*, float&, bool, float (cv::Algorithm::)(), void (cv::Algorithm::)(float), std::basic_string, std::allocator > const&)'
//usr/local/lib/libopencv_features2d.so.2.4: undefined reference to `cv::AlgorithmInfo::addParam(cv::Algorithm&, char const*, short&, bool, int (cv::Algorithm::)(), void (cv::Algorithm::)(int), std::basic_string, std::allocator > const&)'
//usr/local/lib/libopencv_calib3d.so.2.4: undefined reference to `cv::Mutex::Mutex()'
//usr/local/lib/libopencv_ocl.so.2.4: undefined reference to `cv::TLSDataContainer::TLSDataContainer()'
//usr/local/lib/libopencv_calib3d.so.2.4: undefined reference to `cv::ParallelLoopBody::~ParallelLoopBody()'
//usr/local/lib/libopencv_calib3d.so.2.4: undefined reference to `cv::Mutex::~Mutex()'
//usr/local/lib/libopencv_ocl.so.2.4: undefined reference to `cv::TLSDataContainer::~TLSDataContainer()'
collect2: ld returned 1 exit status
You have not linked the executable against several libraries that are required by the program
Try using this:
g++ -lpthread `pkg-config opencv --libs` -I/usr/local/include/ -lraspicam -lraspicam_cv -L/opt/vc/lib -lmmal -lmmal_core -lmmal_util -I/usr/include -lwiringPi test3.cpp -o test3
I am trying to test boost python with example in official website.
But It incurs so many errors...
The below is my what i did and the errors.
Download Boost1.55 with this.
Add Eclipse library search path to "usr/includ" (boost directory place at here)
Add library flag -lpython2.7 (Python2.7 is installed)
Add include path usr/include/python2.7(at my first try, the error happen : couldn't find pyconfig.h)
And this is my test code i did, and errors, the test code was only to see if it is compiled normally with boost python.
#include <iostream>
#include <boost/python.hpp>
char const* greet()
{
return "hello, world";
}
BOOST_PYTHON_MODULE(hello_ext)
{
using namespace boost::python;
def("greet", greet);
}
int main(){
std::cout << "aaa" << std::endl;
}
.
The Error part denoted with redline in eclipse is BOOST_PYTHON_MODULE(hello_ext)
**** Build of configuration Debug for project tsetBoost ****
make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/python2.7 -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
Finished building: ../main.cpp
Building target: tsetBoost
Invoking: GCC C++ Linker
g++ -L/usr/include -o"tsetBoost" ./main.o -lpython2.7
./main.o: In function `inithello_ext':
/home/kim/workspace/tsetBoost/Debug/../main.cpp:16: undefined reference to `boost::python::detail::init_module(char const*, void (*)())'
./main.o: In function `boost::python::type_info::name() const':
/usr/local/include/boost/python/type_id.hpp:165: undefined reference to `boost::python::detail::gcc_demangle(char const*)'
./main.o: In function `boost::python::to_python_value<char const* const&>::operator()(char const* const&) const':
/usr/local/include/boost/python/converter/builtin_converters.hpp:161: undefined reference to `boost::python::converter::do_return_to_python(char const*)'
./main.o: In function `void boost::python::def<char const* (*)()>(char const*, char const* (*)())':
/usr/local/include/boost/python/def.hpp:91: undefined reference to `boost::python::detail::scope_setattr_doc(char const*, boost::python::api::object const&, char const*)'
./main.o: In function `boost::python::api::object boost::python::detail::make_function_aux<char const* (*)(), boost::python::default_call_policies, boost::mpl::vector1<char const*> >(char const* (*)(), boost::python::default_call_policies const&, boost::mpl::vector1<char const*> const&)':
/usr/local/include/boost/python/make_function.hpp:38: undefined reference to `boost::python::objects::function_object(boost::python::objects::py_function const&)'
./main.o: In function `py_function_impl_base':
/usr/local/include/boost/python/object/py_function.hpp:20: undefined reference to `vtable for boost::python::objects::py_function_impl_base'
./main.o:(.rodata._ZTVN5boost6python7objects23caller_py_function_implINS0_6detail6callerIPFPKcvENS0_21default_call_policiesENS_3mpl7vector1IS6_EEEEEE[vtable for boost::python::objects::caller_py_function_impl<boost::python::detail::caller<char const* (*)(), boost::python::default_call_policies, boost::mpl::vector1<char const*> > >]+0x30): undefined reference to `boost::python::objects::py_function_impl_base::max_arity() const'
./main.o: In function `~caller_py_function_impl':
/usr/local/include/boost/python/object/py_function.hpp:30: undefined reference to `boost::python::objects::py_function_impl_base::~py_function_impl_base()'
./main.o:(.rodata._ZTIN5boost6python7objects23caller_py_function_implINS0_6detail6callerIPFPKcvENS0_21default_call_policiesENS_3mpl7vector1IS6_EEEEEE[typeinfo for boost::python::objects::caller_py_function_impl<boost::python::detail::caller<char const* (*)(), boost::python::default_call_policies, boost::mpl::vector1<char const*> > >]+0x10): undefined reference to `typeinfo for boost::python::objects::py_function_impl_base'
./main.o: In function `boost::python::converter::expected_pytype_for_arg<char const*>::get_pytype()':
/usr/local/include/boost/python/converter/pytype_function.hpp:68: undefined reference to `boost::python::converter::registry::query(boost::python::type_info)'
/usr/local/include/boost/python/converter/pytype_function.hpp:69: undefined reference to `boost::python::converter::registration::expected_from_python_type() const'
collect2: ld returned 1 exit status
make: *** [tsetBoost] ERROR 1
I added two additional flags for boost and then it works !!
-lboost_python -lboost_system
I am trying to compile The example of Blocking TCP echo client: using the Boost.build b2 command as following:
b2 linkflags=-lpthread toolset=gcc threading=multi link=static
But I am getting the following errors:
gcc.link ../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/lte_sim
../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/Simulator_main.o: In function `boost::asio::detail::socket_ops::getaddrinfo(char const*, char const*, addrinfo const&, addrinfo**, boost::system::error_code&)':
/home/ha/MIH/boost_1_49_0/boost/asio/detail/impl/socket_ops.ipp:2899: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/Simulator_main.o: In function `__static_initialization_and_destruction_0(int, int)':
Simulator_main.cpp:(.text+0x68f): undefined reference to `boost::system::generic_category()'
Simulator_main.cpp:(.text+0x69b): undefined reference to `boost::system::generic_category()'
Simulator_main.cpp:(.text+0x6a7): undefined reference to `boost::system::system_category()'
../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/Simulator_main.o: In function `boost::system::error_code::error_code()':
Simulator_main.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x17): undefined reference to `boost::system::system_category()'
../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/Simulator_main.o: In function `boost::asio::error::get_system_category()':
Simulator_main.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x5): undefined reference to `boost::system::system_category()'
../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/Simulator_main.o: In function `void boost::asio::detail::posix_event::clear<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&)':
Simulator_main.cpp:(.text._ZN5boost4asio6detail11posix_event5clearINS1_11scoped_lockINS1_11posix_mutexEEEEEvRT_[void boost::asio::detail::posix_event::clear<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&)]+0x47): undefined reference to `odtone::crash(odtone::bug, char const*, char const*, unsigned int, char const*)'
../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/Simulator_main.o: In function `void boost::asio::detail::posix_event::wait<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&)':
Simulator_main.cpp:(.text._ZN5boost4asio6detail11posix_event4waitINS1_11scoped_lockINS1_11posix_mutexEEEEEvRT_[void boost::asio::detail::posix_event::wait<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&)]+0x47): undefined reference to `odtone::crash(odtone::bug, char const*, char const*, unsigned int, char const*)'
../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/Simulator_main.o: In function `void boost::asio::detail::posix_event::signal<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&)':
Simulator_main.cpp:(.text._ZN5boost4asio6detail11posix_event6signalINS1_11scoped_lockINS1_11posix_mutexEEEEEvRT_[void boost::asio::detail::posix_event::signal<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&)]+0x47): undefined reference to `odtone::crash(odtone::bug, char const*, char const*, unsigned int, char const*)'
../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/Simulator_main.o: In function `void boost::asio::detail::posix_event::signal_and_unlock<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&)':
Simulator_main.cpp:(.text._ZN5boost4asio6detail11posix_event17signal_and_unlockINS1_11scoped_lockINS1_11posix_mutexEEEEEvRT_[void boost::asio::detail::posix_event::signal_and_unlock<boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex> >(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&)]+0x47): undefined reference to `odtone::crash(odtone::bug, char const*, char const*, unsigned int, char const*)'
collect2: ld returned 1 exit status
"g++" -o "../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/lte_sim" -Wl,--start-group "../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/Simulator_main.o" "/home/ha/MIH/boost_1_49_0/bin.v2/libs/program_options/build/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/libboost_program_options.a" -lrt -Wl,--end-group -g -static -pthread -lpthread
...failed gcc.link ../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi/lte_sim...
...skipped <p../../dist>lte_sim for lack of <p../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/threading-multi>lte_sim...
...failed updating 1 target...
...skipped 1 target..
I already have a JamFile with the contents:
install install
: lte_sim
: <location>../../dist
;
project lte_sim
;
exe lte_sim
: Simulator_main.cpp
/boost//program_options
;
So what is the solution for the problem?
Thanks a lot.
I tried "b2 linkflags=-lboost_system toolset=gcc" and I got the following errors
gcc.link ../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/lte_sim
/usr/bin/ld: cannot find -lboost_system
../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/Simulator_main.o: In function `boost::asio::detail::socket_ops::getaddrinfo(char const*, char const*, addrinfo const&, addrinfo**, boost::system::error_code&)':
/home/ha/MIH/boost_1_49_0/boost/asio/detail/impl/socket_ops.ipp:2899: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: ld returned 1 exit status
"g++" -o "../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/lte_sim" -Wl,--start-group "../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/Simulator_main.o" "/home/ha/MIH/boost_1_49_0/bin.v2/libs/program_options/build/gcc-4.6/debug/link-static/runtime-link-static/libboost_program_options.a" -Wl,--end-group -g -static -lboost_system
...failed gcc.link ../../bin.v2/app/lte_sim/gcc-4.6/debug/link-static/runtime-link-static/lte_sim...
...skipped lte_sim for lack of lte_sim...
...failed updating 1 target...
...skipped 1 target...
So any suggestions?