Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 05-08-2005, 04:18 AM   #1
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, 08:00 AM   #2
Senior Member
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

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

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


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 10:15 AM
message queues - please some checkup from the pros kirmet Programming 4 09-20-2005 08:40 AM
Posix Message queues? gdipierro Programming 20 07-26-2005 04:59 PM
POSIX message queues... infamous41md Programming 6 05-25-2004 02:53 PM
Message Queues BoldKiller Programming 1 05-28-2003 05:40 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:31 AM.

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