ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Compiling and Linking a simple program on LINUX

Post new topic  Reply to topic
 Compiling and Linking a simple program on LINUX « View previous topic :: View next topic » 
Author Message
noles321
PostPosted: Wed Feb 21, 2007 7:50 am    Post subject: Compiling and Linking a simple program on LINUX Reply with quote

Apprentice

Joined: 15 Nov 2004
Posts: 43

I have a simple getmsg.c program that is being ported from AIX. I am new to LINUX and can't seem to figure out how to compile and link the correct libraries. The program was a simple get program that ran on an AIX 5.3 queue manager and is being ported to LINUX 6.0 queue manager. I simply used a

cc getmsg -o getmsg.c /usr/mqm/lib/libmqm.a to compile and link on the AIX

I can't seem to get the appropriate parameters for
gcc on the LINUX.

Thanks in advance for the help.
Back to top
View user's profile Send private message Send e-mail AIM Address
Vitor
PostPosted: Wed Feb 21, 2007 7:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Which distro of Linux are you using?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
noles321
PostPosted: Wed Feb 21, 2007 7:56 am    Post subject: we are using Reply with quote

Apprentice

Joined: 15 Nov 2004
Posts: 43

We are using Redhat RHEL 4 on an intel platform.
Back to top
View user's profile Send private message Send e-mail AIM Address
jefflowrey
PostPosted: Wed Feb 21, 2007 8:06 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzal.doc/amq8340.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 21, 2007 8:09 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

You might have more luck with a make file. Can I shamlessly plug the efforts of a fellow poster, which you'll find at:

http://www.capitalware.biz/unix_general.html

Far greater knowledge of such matters than me
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
noles321
PostPosted: Wed Feb 21, 2007 8:09 am    Post subject: i have read this Reply with quote

Apprentice

Joined: 15 Nov 2004
Posts: 43

I have read this and tried it and still can't seem to get anywhere.
Back to top
View user's profile Send private message Send e-mail AIM Address
jefflowrey
PostPosted: Wed Feb 21, 2007 8:13 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So you ran
Quote:
C server application, 32-bit, non-threaded

gcc -m32 -o amqsput_32 amqsput0.c -I/opt/mqm/inc -L/opt/mqm/lib -Wl,
-rpath=/opt/mqm/lib -Wl,-rpath=/usr/lib -lmqm



And got... what?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
noles321
PostPosted: Wed Feb 21, 2007 8:17 am    Post subject: Reply with quote

Apprentice

Joined: 15 Nov 2004
Posts: 43

gcc: unrecognized option `-rpath=/opt/mqm/lib'
gcc: unrecognized option `-rpath=/usr/lib'
Back to top
View user's profile Send private message Send e-mail AIM Address
jefflowrey
PostPosted: Wed Feb 21, 2007 8:19 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Are you using the GCC that came with RHEL 4? Or did you install one yourself from source or something?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
noles321
PostPosted: Wed Feb 21, 2007 9:10 am    Post subject: Reply with quote

Apprentice

Joined: 15 Nov 2004
Posts: 43

yes I am using the gcc compiler that came with RHEL 4
Back to top
View user's profile Send private message Send e-mail AIM Address
noles321
PostPosted: Wed Feb 21, 2007 9:37 am    Post subject: got past last problem Reply with quote

Apprentice

Joined: 15 Nov 2004
Posts: 43

[jgovert@shldvmq0 source]$ gcc -m32 -o /home/jgovert/source/getmsg /home/jgovert/source/getmsg.c -I/opt/mqm/inc -L/opt/mqm/lib -Wl,-rpath=/opt/mqm/lib -Wl,-rpath=/usr/lib/ -lmqm
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status



Any ideas?
Back to top
View user's profile Send private message Send e-mail AIM Address
dgolding
PostPosted: Wed Feb 21, 2007 9:54 am    Post subject: Reply with quote

Yatiri

Joined: 16 May 2001
Posts: 668
Location: Switzerland

This has nothing to do with loading the MQ libraries - it's crt1.o you're missing.

I googled it and it seems quite a common problem - you need to install this library libc-devel-2.3.3-74.i386

But as I say just look at the search results, there's some good ones. Isn't Google wonderful?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Compiling and Linking a simple program on LINUX
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.