LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 05-08-2005, 05:18 AM   #1
rag_mg
LQ Newbie
 
Registered: Oct 2004
Location: Bangalore
Distribution: Red Hat 7.2
Posts: 9

Rep: Reputation: 0
Message Queues


I am getting an error when I compile a simple code which send and recieve a message thru message queues.....I feel its something to do with library file,,,can any one help me out
the error is :
tmp/ccGeGuhX.o(.text+0x141): In function `main':
: undefined reference to `mq_open'
/tmp/ccGeGuhX.o(.text+0x181): In function `main':
: undefined reference to `mq_send'
/tmp/ccGeGuhX.o(.text+0x1b3): In function `main':
: undefined reference to `mq_receive'
/tmp/ccGeGuhX.o(.text+0x234): In function `main':
: undefined reference to `mq_close'
collect2: ld returned 1 exit status
 
Old 05-08-2005, 09:00 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
Yes; this is a library problem. You need to pass the -llibname option to gcc, where libname is the name of the /usr/lib/libname.so (or .a) file to include.

Alternatively, just add the full path to the .so or .a file to the command-line.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
POSIX message queues(Solaris) to SYS V message queues(Linux) devershetty Programming 1 01-22-2007 11:15 AM
message queues - please some checkup from the pros kirmet Programming 4 09-20-2005 09:40 AM
Posix Message queues? gdipierro Programming 20 07-26-2005 05:59 PM
POSIX message queues... infamous41md Programming 6 05-25-2004 03:53 PM
Message Queues BoldKiller Programming 1 05-28-2003 06:40 PM


All times are GMT -5. The time now is 09:14 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration