Hi stackoverfl开发者_StackOverflowow community now I am part of you with my first question. My problem is quite simple: I want to use the netpbm library in a c++ program but can't link.
g++ test.cpp -o test -lnetpbm
/tmp/ccZsqYHK.o: In function `main':
test.cpp:(.text+0x39): undefined reference to ppm_readppm(_IO_FILE*, int*, int*, unsigned int*)
collect2: ld returned 1 exit status
As you can see I already linked netpbm but the error does not vanish. I already searched google for hours but ran out of queries to enter. And no one seems to have this problem.
Any help would be greatly appreciated
ppm.h is not c++ friendly. Try including it as follows:
extern "C" {
#include <ppm.h>
}
精彩评论