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 » Compiling C application on HPUX without installation of MQ

Post new topic  Reply to topic Goto page 1, 2  Next
 Compiling C application on HPUX without installation of MQ « View previous topic :: View next topic » 
Author Message
Mushroom
PostPosted: Fri Jan 12, 2007 8:08 am    Post subject: Compiling C application on HPUX without installation of MQ Reply with quote

Newbie

Joined: 12 Jan 2007
Posts: 5
Location: Russia

Hi!
I wrote small c application. It must work on HPUX and put messages to queue on Windows server.
I did not install mqseries on HPUX, but I have all libraries at /opt/mqm/lib.
And when I try to compile it

apxs2 -i -c mod_aqtmon.c -L/opt/mqm/lib -llibmqm

error message is appear:

ld: cannot find -llibmqm
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536


It's strange, because I have this library at /opt/mqm/lib
Anybody knows what does it mean?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 12, 2007 8:14 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can't do this without installing MQ.

Also, you need to go back to the Application Programming guide, and read it's discussion on client versus server connections - and make sure you know which one you are trying to create!

Hint: If there isn't a queue manager on HP, you can't make a server connection.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
rtsujimoto
PostPosted: Fri Jan 12, 2007 6:36 pm    Post subject: Reply with quote

Centurion

Joined: 16 Jun 2004
Posts: 119
Location: Lake Success, NY

Here's a makefile I use to compile C programs on HP-UX. You may want to try it:

restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause in DFARS 252.227-7013.

Hewlett-Packard Company
all: testrecioread

TARGET = testrecioread

CC = cc
CCOPTS = -c -DUNIX -Ae

INCLUDE = -I. -I/home/mqm/tools/source/COMMON -I /home/mqm/tools/source/MQMFTPV2 -I/opt/mqm/inc
MQMLIB = /opt/mqm/lib
LIBS = -lm -lmqm
OBJS = testrecioread.o
PROG = testrecioread

$(PROG): $(OBJS)
$(CC) -o $(PROG) $(OBJS) -L$(MQMLIB) $(LIBS) $(INCLUDE)

testrecioread.o: testrecioread.c

.c.o:
$(CC) $(CCOPTS) $(INCLUDE) $<
Back to top
View user's profile Send private message
gunter
PostPosted: Mon Jan 15, 2007 6:39 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2004
Posts: 307
Location: Germany, Frankfurt

All compiler I know uses -lmqm not -llibmqm

Maybe thats your problem.
_________________
Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jan 15, 2007 6:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

gunter wrote:
All compiler I know uses -lmqm not -llibmqm

Maybe thats your problem.


There are really a few problems.

The first is trying to compile against an improper MQ installation. You need at least an MQ Client installed.

The second is probably using "libmqm" instead of "mqm".

The third is it needs to be mqic, and not mqm, as this appears to need a client connection.

The fourth is that mushroom didn't read the appropriate sections of the Application Programming Guide and the Quick Beginnings guide for HP.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Mushroom
PostPosted: Tue Jan 16, 2007 4:51 am    Post subject: Reply with quote

Newbie

Joined: 12 Jan 2007
Posts: 5
Location: Russia

Thank you all,
I thought I don't need to install MQ, because early I ran my java application on the station without MQ and it worked.
I don't understand, why c-application is different?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 16, 2007 4:58 am    Post subject: Reply with quote

Grand High Poobah

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

Mushroom wrote:
Thank you all,
I thought I don't need to install MQ, because early I ran my java application on the station without MQ and it worked.
I don't understand, why c-application is different?


Because C & Java handle libraries differently. Same reason you can't get orange juice from an apple even if you use an orange squeezer...
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 16, 2007 5:12 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Your Java application should use the MQ install, too.

If you're moving the mq jar files around manually, then a) you're never quite sure what version of the jars you're using, and b) you're in an unsupported configuration - as far as I know.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Mushroom
PostPosted: Tue Jan 16, 2007 5:24 am    Post subject: Reply with quote

Newbie

Joined: 12 Jan 2007
Posts: 5
Location: Russia

Yes, I moved jar files manually.
ok, thanx again.
I will install MQ.
Back to top
View user's profile Send private message
gunter
PostPosted: Tue Jan 16, 2007 6:49 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2004
Posts: 307
Location: Germany, Frankfurt

jefflowrey wrote:
There are really a few problems.

The first is trying to compile against an improper MQ installation. You need at least an MQ Client installed.

No runtime environment is nessessary.
It's ok, if the compiler finds the header and the linker the libraries.
_________________
Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 16, 2007 7:12 am    Post subject: Reply with quote

Grand High Poobah

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

gunter wrote:
jefflowrey wrote:
There are really a few problems.

The first is trying to compile against an improper MQ installation. You need at least an MQ Client installed.

No runtime environment is nessessary.
It's ok, if the compiler finds the header and the linker the libraries.


The client has no runtime environment - it's a series of libraries and headers. All the good stuff is done by the queue manager as part of the syncronous activity.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 16, 2007 7:31 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I personally wouldn't want to try and copy all necessary libs and headers for the purposes of compiling - particularly for building server applications - too messy and fraught with potential for error. Plus, no way to know what version the libs and headers are!

Plus, it's a non-supported install.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
gunter
PostPosted: Tue Jan 16, 2007 8:19 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2004
Posts: 307
Location: Germany, Frankfurt

It's only possible to install one mq-server and/or one mq-client, so you need one system for every mq version and maybe for every CSD, Fixpack, Refreshpack.
For every mq server you need an mq license, even if it is only used to compile the code.
_________________
Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 16, 2007 8:25 am    Post subject: Reply with quote

Grand High Poobah

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

gunter wrote:
It's only possible to install one mq-server and/or one mq-client, so you need one system for every mq version and maybe for every CSD, Fixpack, Refreshpack.


IMHO it's bad housekeeping to have that many levels of software around. It makes problem resolution tricky because you can never be sure what level a given machine is on. Personally I prefer to upgrade in waves - one dev sandbox, rest of dev, unit testing, regression testing, etc all the way to production and not restart the cycle until prod is at that level.

gunter wrote:

For every mq server you need an mq license, even if it is only used to compile the code.


True, but development is typcialy done on clients grouped round a single dev queue manager for exactly this reason.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Mushroom
PostPosted: Wed Jan 17, 2007 2:35 am    Post subject: Reply with quote

Newbie

Joined: 12 Jan 2007
Posts: 5
Location: Russia

Now I have working C application without local MQ installing.
So, it's possible.
It was the problem when I try to link wrong library.

P.S. Vitor, it seems, I can teach you how to make orange juice from an apple.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » Compiling C application on HPUX without installation of MQ
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.