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 » problems compiling IMQ C++ samples

Post new topic  Reply to topic
 problems compiling IMQ C++ samples « View previous topic :: View next topic » 
Author Message
RobertJ
PostPosted: Sun Sep 01, 2002 9:12 pm    Post subject: problems compiling IMQ C++ samples Reply with quote

Newbie

Joined: 01 Sep 2002
Posts: 4

Hi,

I've just started to use MQ and need to write a C++ program to read/write messages. I've taken a look at the C++ samples provided during the installation and tried to compile these, but get a link error. I am using AIX and the GNU g++ compiler. This is the makefile I am using and error message:

swadmin:/home/swadmin/dev/eai/cpp$ cat makefile
OPTS=-DUNIX
INC=-I/usr/mqm/inc -I/usr/mqm/include
LIBS=-L/usr/lib -L/usr/mqm/lib -limq -limqapi -limqb23ia -limqc23ia

imqsget: imqsget.o
g++ $(OPTS) $(LIBS) $(INC) -o imqsget $?

imqsget.o:
g++ $(OPTS) $(INC) -c -o imqsget.o imqsget.cpp

swadmin:/home/swadmin/dev/eai/cpp$ make
g++ -DUNIX -I/usr/mqm/inc -I/usr/mqm/include -c -o imqsget.o imqsget.cpp
g++ -DUNIX -L/usr/lib -L/usr/mqm/lib -limq -limqapi -limqb23ia -limqc23ia -I/usr/mqm/inc -I/usr/mqm/include -o imqsget imqsget.o
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::ImqMgr[in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqQue::ImqQue[in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::ImqMsg[in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqGmo3::ImqGmo3[in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::setName(char const*)
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::ImqStr[in-charge](char const*)
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::ImqStr[in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::ImqChl[in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setHeartBeatInterval(long)
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::cutOut(ImqStr&, char)
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setChannelName(char const*)
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::upperCase() const
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::~ImqStr [in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setTransportType(long)
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setConnectionName(char const*)
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::setChannelReference(ImqChl*)
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::connect()
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::setOpenOptions(long)
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::open()
ld: 0711-317 ERROR: Undefined symbol: .ImqCac::useEmptyBuffer(char const*, unsigned long)
ld: 0711-317 ERROR: Undefined symbol: .ImqMtr::setMessageId(unsigned char const*)
ld: 0711-317 ERROR: Undefined symbol: .ImqMtr::setCorrelationId(unsigned char const*)
ld: 0711-317 ERROR: Undefined symbol: .ImqQue::get(ImqMsg&, ImqGmo3&)
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::formatIs(char const*) const
ld: 0711-317 ERROR: Undefined symbol: .ImqCac::dataLength() const
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::close()
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::disconnect()
ld: 0711-317 ERROR: Undefined symbol: .ImqGmo3::~ImqGmo3 [in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::~ImqMsg [in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqQue::~ImqQue [in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::~ImqMgr [in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::compare(ImqStr const&) const
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::setConnectionReference(ImqMgr*)
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
make: 1254-004 The error code from the last command is 1.


Stop.

Any help is appreciated.

Thanks,
Robert
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Sep 03, 2002 4:55 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I don't believe that the gnu compiler is supported:

http://www-3.ibm.com/software/ts/mqseries/platforms/supported.html

However, I've never used the gnu compiler so I can't comment on whether or not it will build or work.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
RobertJ
PostPosted: Tue Sep 03, 2002 2:08 pm    Post subject: Reply with quote

Newbie

Joined: 01 Sep 2002
Posts: 4

bower5932 wrote:
I don't believe that the gnu compiler is supported:

http://www-3.ibm.com/software/ts/mqseries/platforms/supported.html

However, I've never used the gnu compiler so I can't comment on whether or not it will build or work.


Pity. You'd think though that linking is done by "ld" so should have no dependancy on the compiler once I've generated object code.

Anyway, looks like I'll need to push to get Visual Age installed.
Back to top
View user's profile Send private message
RobertJ
PostPosted: Tue Sep 03, 2002 9:18 pm    Post subject: Reply with quote

Newbie

Joined: 01 Sep 2002
Posts: 4

I just got the Visual Age compiler installed. There are now less errors but it still wont link. Does anyone have any ideas? Am I posting to the right group?


xlC -qchars=signed -L/usr/lib -L/usr/mqm/lib -limqb23ia -limqc23ia -I/usr/vac/include -I/usr/mqm/inc -o imqsget imqsget.o
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setHeartBeatInterval(long)
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::cutOut(ImqStr&,char)
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setTransportType(long)
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::setOpenOptions(long)
ld: 0711-317 ERROR: Undefined symbol: .ImqCac::useEmptyBuffer(const char*,unsigned long)
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make: 1254-004 The error code from the last command is 8.


Thanks,
Robert
Back to top
View user's profile Send private message
abalan
PostPosted: Wed Sep 25, 2002 7:35 am    Post subject: Reply with quote

Newbie

Joined: 23 Sep 2002
Posts: 2

You needto link the cpp libraries
imqb23ia
imqb23ia_r
imqc23ia
imqc23ia_r
etc..


I guess * _r are the threaded verions of the libs (so do either/or)

cheers
Back to top
View user's profile Send private message
RobertJ
PostPosted: Wed Sep 25, 2002 2:06 pm    Post subject: Reply with quote

Newbie

Joined: 01 Sep 2002
Posts: 4

I am and its not working.

Anyway, don't worry about it. I've decided its too much trouble and will do it another way.
Back to top
View user's profile Send private message
racer
PostPosted: Fri Feb 13, 2004 9:19 am    Post subject: Reply with quote

Newbie

Joined: 13 Feb 2004
Posts: 2

I have the same problem.
I have tried diferent libraries but doesn't work.
I think that declarations from *.hpp header files do not corespond with implementations from libraries (libimqb32ia.a, libimqc32ia.a, libimqs32ia.a or *_r.a). I think parameter types are diferent.
Or maybe i'm wrong.
Is there anyone who use C++ API on AIX and it works?
There are some fixes for MQ libraries? Or some known incompatibilities between MQ and the compiler?
I've seen that Undefined symbol error do not apear at all functions. Two functions that allways throw this error are
ImqObj::setOpenOptions(long)
and
ImqCac::useEmptyBuffer(const char*,unsigned long).
Can anyone help?

Sorry for my english!
Back to top
View user's profile Send private message Send e-mail
racer
PostPosted: Mon Feb 16, 2004 2:50 am    Post subject: Reply with quote

Newbie

Joined: 13 Feb 2004
Posts: 2

I have the solution.

Go to:

http://www-306.ibm.com/software/integration/mqfamily/platforms/supported/wsmq_for_aix_5_3.html


"Please use the VisualAge C/C++ v6.0 compiler option "-q namemangling=v5" for C++ to get all the WMQ symbols resolved while linking the libraries.. "

It works!
Back to top
View user's profile Send private message Send e-mail
fmr57
PostPosted: Thu May 06, 2004 7:11 am    Post subject: Reply with quote

Newbie

Joined: 06 May 2004
Posts: 2

I got the same errors withe a Borland C++ Builder on Windonw NT.

Can anyone help?
Back to top
View user's profile Send private message
clindsey
PostPosted: Thu May 06, 2004 8:39 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Sorry,

Borland compiler is ok for c programs that link with mqm.lib or mqic32.lib but not for programs that link with the C++ imq* libraries. It will not work.

Charlie
Back to top
View user's profile Send private message
mhubbard
PostPosted: Fri Oct 08, 2004 5:37 am    Post subject: Same Problem on Linux Reply with quote

Acolyte

Joined: 25 Aug 2004
Posts: 54

Hello - I am also trying to compile the c++ samples and am having exactly the same problem on Linux...and I don't have Visual Age as an option. The requirements page specifies gnu v3 which I have. I have set all the switches specified in the "Using C++" manual as follows:

Switches
g++ -fsigned-char -I/usr/mqm/inc


Libraries (v2.95.2)
-L/opt/mqm/lib/2.95.2 -W,-rpath/opt/mqm/lib/2.95.2 -limqb23gl[_r]
-limq{c|s}23gl[_r]

Has anyone conquered this on Linux? Here is some of my sample output:

gcc -o DEBUG/bubbaMQ -W,-rpath/opt/mqm/lib/3.0.3 DEBUG/imqwrld.o -nodefaultlibs -L/opt/mqm/lib/3.0.3/ -limqb23gl_r -limqs23gl_r
DEBUG/imqwrld.o: In function `main':
/opt/mqm/samp/imqwrld.cpp:45: undefined reference to `ImqMgr::ImqMgr(int)'
/opt/mqm/samp/imqwrld.cpp:51: undefined reference to `ImqStr::ImqStr(char const *)'
/opt/mqm/samp/imqwrld.cpp:52: undefined reference to `ImqStr::ImqStr(void)'
/opt/mqm/samp/imqwrld.cpp:54: undefined reference to `__builtin_new'
/opt/mqm/samp/imqwrld.cpp:54: undefined reference to `ImqChl::ImqChl(void)'
/opt/mqm/samp/imqwrld.cpp:54: undefined reference to `__throw'

Thanks for any suggestions.




Libraries (v3.0.3)
-L/opt/mqm/lib/3.0.3 -W,-rpath/opt/mqm/lib/3.0.3 -limqb23gl[_r]
-limq{c|s}23gl[_r]
_________________
Michael J. Hubbard
Back to top
View user's profile Send private message
Amazone
PostPosted: Mon Jun 12, 2006 12:00 am    Post subject: Reply with quote

Novice

Joined: 17 Oct 2005
Posts: 14

I've got the same problem on Sun OS.

Did you found the solution ?

Thankx
Back to top
View user's profile Send private message Visit poster's website
mvic
PostPosted: Mon Jun 12, 2006 12:19 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

Amazone wrote:
I've got the same problem on Sun OS.

Did you found the solution ?

Almost certainly it's a different problem; would you please start a new thread, and post the precise outputs you're seeing? Also the details of what version of compiler, what OS version etc.
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 » problems compiling IMQ C++ samples
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.