How to use class generate by ACLIC

Hi,
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,

#include "myclass.h"
int main()
{
myclass* h = new myclass();
delete h;
return 1;
}

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.

regards.

gma

Hi,
“ln -s myclass_cpp.so libmyclass_cpp.so” should do it.
Axel.

Thank you very much, Alex. You saved me tons of time after looking at LD and make references without clue. It works. :smiley:

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.

regards,

gma

Hi,

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.

Cheers,
Philippe

Pcanal, thanks. I got it. :smiley:

gma