开发者

Problem linking netpbm library

开发者 https://www.devze.com 2023-03-07 03:56 出处:网络
Hi stackoverfl开发者_StackOverflowow community now I am part of you with my first question. My problem is quite simple:

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>
}
0

精彩评论

暂无评论...
验证码 换一张
取 消