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 04-14-2004, 07:55 AM   #1
illuminatedwax
LQ Newbie
 
Registered: Apr 2004
Posts: 19

Rep: Reputation: 0
Trouble linking with libmqueue on Linux 2.6.5 -mm


I am trying to use the new realtime message queues with Linux and I have installed the new 2.6.5 -mm kernel and I have also installed the mqueue.h library.

However, whenever I try to link my file I get the message:

cache.o(.text+0x1dd4): In function `createCache(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned, unsigned, int, bool)':
: undefined reference to `mq_open(char const*, int, ...)'

I have even tried compling the library myself and then linking to it and even that doesn't work. I do 'nm' on the library and sure enough mq_open shows up on the list. I even checked the source code to make sure that the library and the header agreed on the function parameters.

I am also using C++ (and therefore g++) to compile this code.

What does work is if I try a) compiling the library myself as an object file instead of a library, b) writing a test program in C and use gcc to compile it. It links fine then.

What is going on?
--Stephen
 
  


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
how linking in linux works juanbobo Programming 10 02-17-2006 11:14 PM
Linking three Linux systems together... SonoranFun Linux - Networking 3 06-29-2005 05:49 AM
Trouble: mounting, linking, permissions. crackery Linux - Newbie 2 01-28-2005 09:03 PM
g++ trouble linking against archive exitsfunnel Programming 3 01-05-2005 09:16 AM
trouble linking with g++ WanglessOlasov Programming 5 12-28-2003 12:25 PM

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

All times are GMT -5. The time now is 02:42 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