LinuxQuestions.org
Help answer threads with 0 replies.
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 12-30-2004, 05:11 PM   #1
Quest101
LQ Newbie
 
Registered: Nov 2004
Posts: 27

Rep: Reputation: 15
undefined reference error


Hi ,
I downloaded JRTPLIB which is an API used to build Real time protocol software.
Well i added a function to a source file as well as definining it in the corresponding header file,

The problem is now i am trying to run a test file "example1" which calls on this newly made function and i keep getting that the function "SendInitPacket(....) " is not defined .

Now i am new to linux but i am assuming that you need to remake the the code , inorder for the modifications [ SendInitPacket(....) ] to be reflected in the corresponding object file. And that this may be causing the error. However i tried remaking the code , and still got the same error .

So , i am looking for a helping hand , Thanks in advance

Quest

ps by the way the error looked like :

undefined reference to `RTPSession::SendInitPacket(void const*, unsigned, unsigned char, bool, unsigned)'
collect2: ld returned 1 exit status
 
Old 12-30-2004, 06:02 PM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
You probably need to tell the compiler to link in the library. It's usually something like g++ myprog.c -o myprog -lresolv. The -l tells the compiler to link in the library, and resolv is the name of the library. So maybe you need to add something like -ljrtp
 
Old 12-31-2004, 06:26 AM   #3
cppkid
Member
 
Registered: Jul 2004
Location: Pakistan
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
Yes itsme86 is right about that. In linux we have shared Libraries, that have got the functionality of the function you using in your program, so your program will compile well but when you link it you must tell your program to go for some shared library for the implementation of the function so you adds the library name using -l and then the Lib name
 
Old 01-01-2005, 12:27 PM   #4
Quest101
LQ Newbie
 
Registered: Nov 2004
Posts: 27

Original Poster
Rep: Reputation: 15
Thanx alot guys , this brings me a lot closer to the problem , i think i can take it from here , nuff respect
 
  


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
Undefined reference error jacques83 Programming 20 04-11-2013 07:23 AM
Undefined reference error in MD5_Init() jacques83 Programming 3 11-13-2005 09:41 PM
Undefined reference error in MD5_Init() jacques83 Linux - Networking 0 11-11-2005 09:44 PM
gcc ld error. Undefined reference redness Linux - Software 4 02-08-2005 02:01 AM
make error/ undefined reference apljdi Linux - Newbie 1 10-29-2002 01:10 PM

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

All times are GMT -5. The time now is 03:00 PM.

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