Posted: Tue Feb 28, 2012 6:42 am Post subject: linkage error
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
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.
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
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.
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