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 » IBM MQ API Support » linkage error

Post new topic  Reply to topic
 linkage error « View previous topic :: View next topic » 
Author Message
bittu
PostPosted: Tue Feb 28, 2012 6:42 am    Post subject: linkage error Reply with quote

Novice

Joined: 25 Mar 2008
Posts: 22

I am compiling MQAPI.c program in sun OS using below command
gcc -c MQAPI.c -lmqm -lmqmcs -lmqmzse -lsocket -lnsl -ldl


i am getting following exception

gcc: -lmqm: linker input file unused because linking not done
gcc: -lmqmcs: linker input file unused because linking not done
gcc: -lmqmzse: linker input file unused because linking not done
gcc: -lsocket: linker input file unused because linking not done
gcc: -lnsl: linker input file unused because linking not done
gcc: -ldl: linker input file unused because linking not done

Please help me where i am missing
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Feb 28, 2012 7:39 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So it's telling you that you gave it options to do both compilation and linking, but didn't tell it to do anything other than compile.

If I understand the errors as you have posted them. Which I might not.

It's not clear if you've posted the full set of exceptions, either. If there are *any* other errors, you should fix those *first* before worrying about these.

Also review http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzal.doc%2Ffg16580_.htm and the parent and sibling topics.
Back to top
View user's profile Send private message
bittu
PostPosted: Tue Feb 28, 2012 8:17 am    Post subject: Reply with quote

Novice

Joined: 25 Mar 2008
Posts: 22

Now i am getting below exception

gcc MQAPI.c -lmqm -lmqmcs -lmqmzse -lsocket -lnsl -ldl

Undefined first referenced
symbol in file
main /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/crt1.o
ld: fatal: Symbol referencing errors. No output written to a.out
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Feb 28, 2012 9:09 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I can't provide any advice from that set of information.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Tue Feb 28, 2012 12:44 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

[code] tags can make the error message more readable:

bittu wrote:
Now i am getting below exception

Code:
gcc MQAPI.c  -lmqm -lmqmcs -lmqmzse -lsocket -lnsl -ldl

Undefined                       first referenced
 symbol                             in file
main                                /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/crt1.o
ld: fatal: Symbol referencing errors. No output written to a.out

Standard C requires a function definition for main(), when compiling an executable program.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » linkage error
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.