Author |
Message
|
MQWays |
Posted: Wed Apr 30, 2008 3:26 am Post subject: Compiling MQ Code in C |
|
|
Acolyte
Joined: 20 Jan 2008 Posts: 61
|
I am new to writing MQ Code in C on Linux. I am trying to do a 'gcc' on the C program and it returns the following:
:undefined reference to 'main'
/tmp/cchvNJQe.o(.text+0x6f3): In function 'PutAfter':
:undefined reference to 'MQPUT'
/tmp/cchvNJQe.o(.text+0xab8): In function 'Put1After':
and many similar lines......
Am I missing any library required for the compilation. Please assist. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 30, 2008 3:39 am Post subject: Re: Compiling MQ Code in C |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MQWays wrote: |
I am new to writing MQ Code in C on Linux. I am trying to do a 'gcc' on the C program and it returns the following:
|
There are instructions on compilation & linking (which varies according to client or sever side requirements) in the APG.
A search on gcc within the forum may also throw up useful tips. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Gaya3 |
Posted: Wed Apr 30, 2008 3:40 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
did you include cmqc.h header
Regards
Gayathri _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 30, 2008 3:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Moved to non-Java forum _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
MQWays |
Posted: Wed Apr 30, 2008 3:44 am Post subject: |
|
|
Acolyte
Joined: 20 Jan 2008 Posts: 61
|
I am modifying the mirrorq utility. I am sure everything is already in place. My environment probably needs to be set for compilation. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 30, 2008 3:49 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MQWays wrote: |
I am modifying the mirrorq utility. |
It's not a utility, it's a sample exit. As some of the discussions on mirrorq in here have aluded to, in it's current form it's not considered production strength.
If you're new to C code (in this environment or generally) I urge you to be cautious and extensively. A badly coded/compiled/linked exit (which has different rules to an app) can at best kill the performance of the queue manager and at worst bring the queue manager down in flames.
Exits are an advanced topic, and you would be well advised to review some of the material in the forum. There's a good thread somewhere from Roger about writing & compiling exits, and avoiding some of the pitfalls. Mirrorq has also been the subject of discussion.
Caution & testing, caution & testing.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Apr 30, 2008 7:12 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
|
Back to top |
|
 |
tleichen |
Posted: Thu May 01, 2008 5:56 am Post subject: |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
Vitor wrote: |
...
If you're new to C code (in this environment or generally) I urge you to be cautious and extensively. A badly coded/compiled/linked exit (which has different rules to an app) can at best kill the performance of the queue manager and at worst bring the queue manager down in flames.
Exits are an advanced topic, and you would be well advised to review some of the material in the forum. There's a good thread somewhere from Roger about writing & compiling exits, and avoiding some of the pitfalls. Mirrorq has also been the subject of discussion.... |
I agree. Exits ARE an advanced topic and if you are new to the programming language, please don't try to get your feet wet in programming ANY language by writing MQ exits! It WILL turn out badly!  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
|