LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-05-2005, 12:23 AM   #1
pavan
LQ Newbie
 
Registered: Jun 2005
Location: bangalore
Distribution: redhat
Posts: 3

Rep: Reputation: 0
linker error


Hi,
I am facing problem while building my project, which has some 5 .cpp files and some libraries to be linked with. This is on linux2.4 GCC compiler (REDHAT 9)

I am able to compile it using the commands. But its not compiling when i use the same command in MAKEFILE or in some bash script. Even though I mentioned the path of my libraries to be linked, it says undefined reference for the functions defined in library header files. I have included these header files in my .cpp files also...

Please help me!!!!
thanks in advance...
Pavan
 
Old 10-05-2005, 04:49 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
The exact link command (and the exact error message) - would be helpful...
 
Old 10-06-2005, 01:58 AM   #3
pavan
LQ Newbie
 
Registered: Jun 2005
Location: bangalore
Distribution: redhat
Posts: 3

Original Poster
Rep: Reputation: 0
Hi,
I got the solution. The problem was the libraries i linked were ".C" file libraries. and my programs are ".CPP" files. So while including the header files of the libraries, I had not put the
extern
{xxx.h
yyy.h
}
in my declaration. So it gave me errors while linking. After putting the extern tag, the problem got solved.
Thanks for ur response.
pavan
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ld linker error Ankit mittal Programming 2 09-30-2005 07:40 AM
Linker error eddydw Linux - General 0 09-20-2004 01:21 PM
Linker Error dim79 Programming 2 06-28-2003 09:53 AM
Kylix3 Linker Error dim79 Linux - Software 0 06-27-2003 10:57 AM
linker error Config Programming 8 06-04-2002 03:33 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration