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 » MQSeries using C

Post new topic  Reply to topic
 MQSeries using C « View previous topic :: View next topic » 
Author Message
mqguy
PostPosted: Sat May 18, 2002 4:04 am    Post subject: MQSeries using C Reply with quote

Newbie

Joined: 01 May 2002
Posts: 6

Hi all,
I am having MQSeries5.1 on Win2000.
I am trying to compile and run a C program.
I have Borland's C++ builder. I am trying to compile one simple MQPut Sample but I got error like..
-----------------
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_MQCONN' referenced from C:\C\C\AMQSPUT0.OBJ
Error: Unresolved external '_MQOPEN' referenced from C:\C\C\AMQSPUT0.OBJ
Error: Unresolved external '_MQPUT' referenced from C:\C\C\AMQSPUT0.OBJ
Error: Unresolved external '_MQCLOSE' referenced from C:\C\C\AMQSPUT0.OBJ
Error: Unresolved external '_MQDISC' referenced from C:\C\C\AMQSPUT0.OBJ
Process completed with exit code 1
----------
Can anyone help me what I am missing.
I have copied all files from C:\Program Files\MQSeries\tools\c\include
to D:\Borland\BCC55\Include.
and copied all files from C:\Program Files\MQSeries\tools\lib
to D:\Borland\BCC55\Lib.
and my compile parameters are
-I"d:\Borland\Bcc55\include" -L"d:\Borland\Bcc55\lib" $File -eamqsput0.exe

or can anyone tell me steps to compile and run a c program.what are files to be inculded and linked and how to compile and run.?

Thanks.
Back to top
View user's profile Send private message
kolban
PostPosted: Sat May 18, 2002 7:00 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

You must also link with the IBM supplied mqm libraires. This will be mqm.lib

Note that:

1. Copying MQSeries files to different locations is a bad idea
2. Borland C compiler is not officially supported by IBM for MQSeries
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Sat May 18, 2002 8:31 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3253
Location: London, ON Canada

I have had friends use Borland C/C++ with MQSeries and the only issue is that the libraries HAVE to be converted to Borland's format from Microsoft's proprietary one using a utility (COFF2OMF.EXE) which is provided.

later
Roger...
Back to top
View user's profile Send private message Visit poster's website
mqguy
PostPosted: Mon May 20, 2002 1:03 am    Post subject: Reply with quote

Newbie

Joined: 01 May 2002
Posts: 6

Yes it worked...
When i converted mqmlib using COFF2OMF.EXE and linked it.

Thanks for your replies..
Back to top
View user's profile Send private message
mqguy
PostPosted: Mon May 20, 2002 4:42 am    Post subject: Reply with quote

Newbie

Joined: 01 May 2002
Posts: 6

Oh No....
I am again getting errors when I try to compile C++ program using same Borland compiler with preferences
-I"d:\Borland\Bcc55\include" -L"d:\Borland\Bcc55\lib" "C:\Program Files\MQSeries\tools\lib\mqm.lib" "C:\Program Files\MQSeries\tools\lib\imqb23in.lib" "C:\Program Files\MQSeries\tools\lib\imqc23in.lib" "C:\Program Files\MQSeries\tools\lib\imqs23in.lib" $File -eamqsput0.exe

and already converted all this LIBs into borland's format using COFF2OMF.EXE

----------------
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
c:\cpp\imqsput.cpp:
Warning W8027 d:\Borland\Bcc55\include\imqstr.hpp 56: Functions containing some return statements are not expanded inline in function operator +(const char *,const ImqStr &)
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'ImqMgr::~ImqMgr()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqObj::~ImqObj()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqErr::~ImqErr()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqQue::~ImqQue()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqMtr::~ImqMtr()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqMsg::~ImqMsg()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqCac::~ImqCac()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqMgr::ImqMgr()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqQue::ImqQue()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqMsg::ImqMsg()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqMgr::connect()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqObj::setConnectionReference(ImqMgr *)' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqObj::setName(const char *)' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqObj::setOpenOptions(const long)' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqObj::open()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqCac::useEmptyBuffer(const char *, const unsigned int)' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqMsg::setFormat(const char *)' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqCac::setMessageLength(const unsigned int)' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqQue::put(ImqMsg&)' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqObj::close()' referenced from C:\CPP\IMQSPUT.OBJ
Error: Unresolved external 'ImqMgr::disconnect()' referenced from C:\CPP\IMQSPUT.OBJ
Process completed with exit code 1

---------------
I don't know how to use switches while compiling..

can anybody help please..

Thanks in advance.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Mon May 20, 2002 7:28 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3253
Location: London, ON Canada

Hi,

You are getting the error because you are pointing to the IBM supplied LIBs rather than your converted LIBs.

Change your "-L" LIB names to point to your converted mq LIBs rather than the LIBs supplied by IBM.

later
Roger...
Back to top
View user's profile Send private message Visit poster's website
mqguy
PostPosted: Mon May 20, 2002 10:10 pm    Post subject: Reply with quote

Newbie

Joined: 01 May 2002
Posts: 6

No I have taken back up of original libs and pasted modified OMF files for borland in LIB path.
I think I am not using switches options, so is the problem.
I am using borland commandinline compiler.
can anyone tell me what is the problem or what switches and how to use it with borland compiler.

The problem is same as pasted above for C++.

Thanks in advance.
Back to top
View user's profile Send private message
mrlinux
PostPosted: Tue May 21, 2002 3:15 am    Post subject: Reply with quote

Grand Master

Joined: 14 Feb 2002
Posts: 1261
Location: Detroit,MI USA

My guess is you are suffering from the name mangleing C++ does to function names, and since the name mangleing isnt standard if the libs werent compiled to support a specific compiler you are out of luck unless the compiler has a way to change it mangleing method.
_________________
Jeff

IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries
Back to top
View user's profile Send private message Send e-mail
mqguy
PostPosted: Sun May 26, 2002 10:28 pm    Post subject: Reply with quote

Newbie

Joined: 01 May 2002
Posts: 6

Hi all,
Have any one tried using Borland Compiler for MQ C++ programs?
Please reply me the settings to be done to achieve it.
Back to top
View user's profile Send private message
dgolding
PostPosted: Mon May 27, 2002 12:08 am    Post subject: Reply with quote

Yatiri

Joined: 16 May 2001
Posts: 668
Location: Switzerland

IMHO I think you're stuck here - unless Borland C++ can be instructed to generate names in the Visual C++ standard.

Ways around this are to:

a) Use the C functions direct (MQCONN, MQGET, etc)

b) Get the supportpac MA0H that gives you an alternative to the MQ classes supplied by IBM. This is source code that you need to build into your own library. I HAVE NO IDEA WHAT IT IS LIKE.

c) Pay microsoft some money or obtain VC++ by some other means
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 » IBM MQ API Support » MQSeries using C
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.