3

I compiled the file (source.cpp) using the command

g++ -I/home/hrishikesh/Desktop/OGDF-snapshot/include -O2 source.cpp -o mytest -L/home/hrishikesh/Desktop/OGDF-snapshot/_release -lOGDF -lCOIN -pthread

and it got compiled successfully without giving any error message,resulting a file "mytest" in the same folder as the source.cpp in. when I try to run the mytest file using command

./mytest

it shows this error message

./mytest: error while loading shared libraries: libOGDF.so: cannot open shared object file: No such file or directory

please help

hrishi
  • 443
  • 2
  • 12

2 Answers2

0

You need to put libOGDF.so in the same folder than mytest

hrkz
  • 378
  • 3
  • 14
0

g++ -I /AbsolutePath/Desktop/OGDF/ main.cpp -L -l /AbsolutePath/Desktop/OGDF/_release/libOGDF.a -lpthread

here main.cpp is the file. copy and paste the line above in other text editors to get rid of the confusions between the usage of I and L and the spaces.

Be sure that you are writing the absolute path correct. The a.out file will be generated in current directory. execute it by using: ./a.out

ankit agarwal
  • 61
  • 1
  • 9