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.
Hi ,
I created a lib.a from several c files.
now I write a test. c case which suppose to call some functions from
the lib.a.
the compilation succedded but the linking not. I get : undefined reference to 'function name' .....
but I have a '.h' file which has the prototypes to these functions and it is included in the test.c file.
please tell me what do I do wrong.
ok ,
I build some libs ( libname1.a.... )with 'ar.....'
after that I wrote a test.cpp file to check these libs.
and the compilation is ok but linking not.
I get some errors of : undefined reference to '.....'
in the makefile of test I have LIBS = -lname ....
and also IFLAGS = -Iincludefiles.h
alraedy done this ,
p.s. the libs , code and exe are in the same folder
just to make it simple.
the develop machine isnot connected to the net , so I'ii try to copy
the msg : In function 'aaa()' file :file_from_libname1.cpp:54 :undefined reference to 'Funcionname from lib'
In Function 'JpgFile::JpgStartCompress(int, int ,int )':
JpgFile.cpp:94: undefined reference to 'jpeg_destroy_compress'
.
.
.
and many lines like this one
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.