Unfortunately I get for
g++ hello_world_ccpunit.cpp -L/usr/local/include/cppunit -l cppunit
the error msg
hello_world_ccpunit.cpp:47:2: warning: no newline at end of file
/usr/local/lib/libcppunit.so: undefined reference to `dlclose'
/usr/local/lib/libcppunit.so: undefined reference to `dlopen'
/usr/local/lib/libcppunit.so: undefined reference to `dlsym'
collect2: ld returned 1 exit status
Could you please help me? Cheers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you, now g++ compiles.However when I run the program, I get
./hello: error while loading shared libraries: libcppunit-1.10.so.2: cannot open shared object file: No such file or directory
my LD_LIBDRARY_PATH includes the directory of libcppunit-1.10.so.2. When I include -shared to my g++ command (see start of thread), I get a segmenation fault.
Could you please help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, I have right now installed cppunit onto Debian kernel 2.6.8-2-386 with gcc 3.3.5.
Everything seemed to be fine, and I tried a small hello world program, from http://pantras.free.fr/articles/helloworld.html
Unfortunately I get for
g++ hello_world_ccpunit.cpp -L/usr/local/include/cppunit -l cppunit
the error msg
hello_world_ccpunit.cpp:47:2: warning: no newline at end of file
/usr/local/lib/libcppunit.so: undefined reference to `dlclose'
/usr/local/lib/libcppunit.so: undefined reference to `dlopen'
/usr/local/lib/libcppunit.so: undefined reference to `dlsym'
collect2: ld returned 1 exit status
Could you please help me? Cheers.
You likely are forgetting to link to the dynamic loadable modules.
Adding -ldl to the end of your compile command should fix it.
Thank you, now g++ compiles.However when I run the program, I get
./hello: error while loading shared libraries: libcppunit-1.10.so.2: cannot open shared object file: No such file or directory
my LD_LIBDRARY_PATH includes the directory of libcppunit-1.10.so.2. When I include -shared to my g++ command (see start of thread), I get a segmenation fault.
Could you please help?
Can you post your compile/link command? It's possibly the way you're linking that is causing it to fail.
Hi, the command
g++ -o hello_world hello_world_ccpunit.cpp -L/usr/local/include/cppunit -l cppunit -ldl
produces
./hello_world: error while loading shared libraries: libcppunit-1.10.so.2: cannot open shared object file: No such file or di
rectory
and the command
g++ -o hello_world hello_world_ccpunit.cpp -L/usr/local/include/cppunit
l cppunit -shared -ldl
then results in a segmentation fault.
/usr/local/lib contains
libcppunit-1.10.so.2
libcppunit-1.10.so.2.0.0
libcppunit.a
libcppunit.la
libcppunit.so
while /usr/local/include$ ]ls
boost-1_33_1 cppunit sbml
and echo $LD_LIBRARY_PATH returns
/usr/local/lib/python2.3/site-packages:/usr/local/lib