Saturday, July 19, 2008

compiling issues

I found a site that illustrates the proper order for directives when using g++ as a compiler. I was having the problem that I could make a program compile using relative pathname in the -I option but not when using an absolute path name.

The following worked with relative pathnames


$(CXX) main.cpp -o test -I./.. -L. -lsmile

But i wanted to use absolute path names and i tried this:


$(CXX) main.cpp -o test -I/home/santiago/thesis/SmileHeaderfiles -L -lsmile

which didn't work.
This did work


g++ -I/home/santiago/thesis/SmileHeaderfiles main.cpp -o test -L. -lsmile

No comments: