I tried to use my own class created by ACLIC. My class is implemented as myclass.cpp. Using ACLIC, I got myclass_cpp.so and myclass_cpp.d.
In my test program,
myclass* h = new myclass();
When I compile and link this program using
g++ -o test.cpp -lmyclass_cpp
I got the error message
/usr/bin.ld: cannot find -lmyclass_cpp
My question is how I can use myclass. Thanks.
“ln -s myclass_cpp.so libmyclass_cpp.so” should do it.
Thank you very much, Alex. You saved me tons of time after looking at LD and make references without clue. It works.
I am also curious why we need the dictionary file, say myclass.d. I was suspecting somehow I need to link it with the library file to my c++ program. Since we don’t, I want to know why it is there at the first place. Thanks.
myclass.d is not a dictionary file but a (makefile) dependency files. This includes the list of (include) file you source file depend on so that ACLiC can recompile your library when it is needs to be.
Pcanal, thanks. I got it.