我有一个问题是编译plplot的c ++示例,例如。 ex04.cc
monkey c++ # g++ -I/usr/include/plplot -lplplotd -lltdl -ldl -lm -lcsirocsa -lfreetype x04.cc
/tmp/ccp9ygLt.o: In function `x04::x04(int, char const**)':
x04.cc:(.text+0x2c): undefined reference to `plstream::plstream()'
x04.cc:(.text+0x55): undefined reference to `plstream::parseopts(int*, char const**, int)'
x04.cc:(.text+0x64): undefined reference to `plstream::init()'
x04.cc:(.text+0x78): undefined reference to `plstream::font(int)'
/tmp/ccp9ygLt.o: In function `x04::x04(int, char const**)':
x04.cc:(.text+0x11c): undefined reference to `plstream::plstream()'
x04.cc:(.text+0x145): undefined reference to `plstream::parseopts(int*, char const**, int)'
x04.cc:(.text+0x154): undefined reference to `plstream::init()'
x04.cc:(.text+0x168): undefined reference to `plstream::font(int)'
/tmp/ccp9ygLt.o: In function `x04::plot1(int)':
x04.cc:(.text+0x22a): undefined reference to `plstream::adv(int)'
x04.cc:(.text+0x367): undefined reference to `plstream::vpor(double, double, double, double)'
x04.cc:(.text+0x392): undefined reference to `plstream::wind(double, double, double, double)'
x04.cc:(.text+0x3a6): undefined reference to `plstream::col0(int)'
x04.cc:(.text+0x3e0): undefined reference to `plstream::box(char const*, double, int, char const*, double, int)'
x04.cc:(.text+0x40e): undefined reference to `plstream::box(char const*, double, int, char const*, double, int)'
x04.cc:(.text+0x422): undefined reference to `plstream::col0(int)'
x04.cc:(.text+0x43e): undefined reference to `plstream::line(int, double*, double*)'
x04.cc:(.text+0x452): undefined reference to `plstream::col0(int)'
x04.cc:(.text+0x496): undefined reference to `plstream::ptex(double, double, double, double, double, char const*)'
x04.cc:(.text+0x4aa): undefined reference to `plstream::col0(int)'
x04.cc:(.text+0x4db): undefined reference to `plstream::mtex(char const*, double, double, double, char const*)'
x04.cc:(.text+0x50c): undefined reference to `plstream::mtex(char const*, double, double, double, char const*)'
x04.cc:(.text+0x520): undefined reference to `plstream::col0(int)'
x04.cc:(.text+0x551): undefined reference to `plstream::mtex(char const*, double, double, double, char const*)'
x04.cc:(.text+0x56f): undefined reference to `plstream::col0(int)'
x04.cc:(.text+0x59a): undefined reference to `plstream::wind(double, double, double, double)'
x04.cc:(.text+0x5ce): undefined reference to `plstream::box(char const*, double, int, char const*, double, int)'
x04.cc:(.text+0x5e2): undefined reference to `plstream::col0(int)'
x04.cc:(.text+0x5fe): undefined reference to `plstream::line(int, double*, double*)'
x04.cc:(.text+0x612): undefined reference to `plstream::col0(int)'
x04.cc:(.text+0x643): undefined reference to `plstream::mtex(char const*, double, double, double, char const*)'
collect2: ld returned 1 exit status
我没有想到这个plstream的问题是什么,这是官方的例子:/
祝你好运, nykon
答案 0 :(得分:0)
我知道你问这个问题已经有一段时间了,但我只是偶然发现了你(和我)问题的可能解决方案。指定要链接的PLPlot库时,请包含C ++绑定库plplotcxxd
。该库在磁盘上作为文件libplplotcxxd.a。
plplot-config --libs
配置实用程序从未根据需要列出此库。