Hi all,
I just installed gd2 using mac ports (sudo install gd2), which installed libraries in the following places:
/opt/local/include/gd.h
/opt/local/lib/libgd.dylib (link)
/opt/local/lib/libgd.la
/opt/local/lib/libgd.a
So when I create my c++ app I add '#include "gd.h"', which throws:
main.cpp:4:16: error: gd.h: No such file or directory
If I set gd.h as an absolute path (as above)(not a solution, but was curious), I am thrown:
g++ -L/opt/local/include -L/opt/local/lib main.o Heatmap_Map.o Heatmap_Point.o -o heatmap
Undefined symbols:
"_gdImagePng", referenced from:
_main in main.o
"_gdImageLine", referenced from:
_main in main.o
"_gdImageColorAllocate", referenced from:
_main in main.o
_main in main.o
"_gdImageDestroy", referenced from:
_main in main.o
"_gdImageCreate", referenced from:
_main in main.o
"_gdImageJpeg", referenced from:
_main in main.o
ld: symbol(s) not found
So, I understand this means that ld can not find the libraries it needs (hence trying to give it hints with the "-L" values). So after giving g++ the -L hints and the absolute path in #include, I can get it to work, but I don't think I have to do this, how can I make g++/ld search int eh right places for the libraries?
Drew J. Sonne.