ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
int main( int argc, char** argv )
{
pbm_init(NULL, NULL);
bit **bits = NULL;
bits = pbm_allocarray(640,480);
}
2.
Add "/usr/include" to my include directory, which contains pbm.h ( I think this directory contains every head files after I install netpbm-10.25.rpm)
3.
Add "-lnetpbm" as my dynamic library, which I thought is the only
4.
Compile, pass. Success
5.
Build! Wrong!!! Obviously, Link Error. Is there anybody who can just tell me what else I'm short of?? I'm sure that those 2 functions `pbm_init(int*, char**)' and `pm_allocarray(int, int, int)' should be in the library netpbm. Besides, I tried the static library libnetpbm.a as well. the same error.. Any other libraries I need???
cd '/home/pjia/programs/netpbm_test/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
gmake all-recursive
Making all in src
/bin/sh ../libtool --mode=link --tag=CXX g++ -O0 -g3 -o netpbm_test netpbm_test.o -lnetpbm
g++ -O0 -g3 -o netpbm_test netpbm_test.o -lnetpbm
netpbm_test.o(.text+0x120): In function `main':
/home/pjia/programs/netpbm_test/src/netpbm_test.cpp:36: undefined reference to `pbm_init(int*, char**)'
netpbm_test.o(.text+0x13e):/home/pjia/programs/netpbm_test/src/netpbm_test.cpp:38: undefined reference to `pm_allocarray(int, int, int)'
collect2: ld returned 1 exit status
gmake[2]: *** [netpbm_test] Error 1
gmake[2]: Target `all' not remade because of errors.
gmake[1]: *** [all-recursive] Error 1
gmake: *** [all] Error 2
*** Exited with status: 2 ***
Yes, I will try that. But when I did the following command line
$ nm -C /usr/local/netpbm/lib/libnetpbm.a | grep "pm_allocarray"
0000043c T pm_allocarray
U pm_allocarray
U pm_allocarray
U pm_allocarray
U pm_allocarray
U pm_allocarray
$ nm -C /usr/local/netpbm/lib/libnetpbm.a | grep "pm_init"
00000000 T pbm_init
U pbm_init
U means undefined, T means contained...
Why it alwasy tell T and U at the same time? I will try netpbm 9.0...
But, in my opnion, netpbm 10.0 does work, but I don't know how to let it work correctly...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.