Author |
Message
|
hazard |
Posted: Thu Nov 24, 2005 12:30 am Post subject: Need help in compiling application with AIX VisualAge C++. |
|
|
Newbie
Joined: 16 Nov 2005 Posts: 8
|
the makefile just like following:
# define base dir
MQM_HOME=/usr/mqm
# define
DEFINES=-DDEBUG -DUNIX -D_PTHREAD_SAFE
LDFLAGS=-L$(MQM_HOME)/lib -limqb23ia_r -limqs23ia_r
CFLAGS=-g -q64 $(DEFINES) -qchars=signed -I/usr/mqm/inc $(LDFLAGS) \
-bhalt:8 -bloadmap:ldout
# command
CC=xlC_r
.SUFFIXES: .o .cpp
.cpp.o:
$(CC) $(CFLAGS) -o $*.o -c $*.cpp
# target
mqput:imqsput.o
touch imqsput.cpp
sleep 1
$(CC) $(CFLAGS) -o $@ $?
the file imqsput.cpp is the MQ's example.
and the following are the errors when i compiled it:
ld: 0711-317 ERROR: Undefined symbol: ImqMgr::virtual-fn-table-ptr-table
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::ImqMgr()
ld: 0711-317 ERROR: Undefined symbol: ImqQue::virtual-fn-table-ptr-table
ld: 0711-317 ERROR: Undefined symbol: .ImqQue::ImqQue()
ld: 0711-317 ERROR: Undefined symbol: ImqMsg::virtual-fn-table-ptr-table
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::ImqMsg()
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::ImqStr(const char*)
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::ImqStr()
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::ImqChl()
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setHeartBeatInterval(int)
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::cutOut(ImqStr&,char)
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setChannelName(const char*)
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::upperCase() const
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::~ImqStr()
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setTransportType(int)
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setConnectionName(const char*)
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::setChannelReference(ImqChl*)
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::setName(const char*)
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::connect()
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::setOpenOptions(int)
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::open()
ld: 0711-317 ERROR: Undefined symbol: .ImqCac::useEmptyBuffer(const char*,unsign
ed long)
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::setFormat(const char*)
ld: 0711-317 ERROR: Undefined symbol: .ImqCac::setMessageLength(unsigned long)
ld: 0711-317 ERROR: Undefined symbol: .ImqQue::put(ImqMsg&)
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::close()
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::disconnect()
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::~ImqMsg()
ld: 0711-317 ERROR: Undefined symbol: .ImqQue::~ImqQue()
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::~ImqMgr()
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::compare(const ImqStr&) const
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::setConnectionReference(ImqMgr*)
ld: 0711-344 See the loadmap file ldout for more information.
make: 1254-004 The error code from the last command is 8.
what can i do with these errors? |
|
Back to top |
|
 |
wschutz |
Posted: Thu Nov 24, 2005 3:29 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Shouldn't your LDFLAGS be this:
-L/usr/mqm/lib -limqs23ia_r -limqb23ia_r -lmqm_r
or better yet:
(do you really need threading?)
-L/usr/mqm/lib -limqs23ia -limqb23ia -lmqm _________________ -wayne |
|
Back to top |
|
 |
jsware |
Posted: Thu Nov 24, 2005 5:42 am Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
You may also need -qnamemangling=v5 if you are using VACPP v6 or more as the name mangling of functions has changed (got caught out on this myself recently).
I don't think you need -lmqm_r if you are using the C++ client, you only need libmqm.a or libmqm_r.a when using the core MQI (the C++ libraries do the MQI calls for you). _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
wschutz |
Posted: Thu Nov 24, 2005 5:53 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Well, this is from the C++ manual:
Quote: |
Server applications
32-bit unthreaded application
xlC -o imqsput_32 imqsput.cpp -qchars=signed -I/usr/mqm/inc
-L/usr/mqm/lib -limqs23ia -limqb23ia -lmqm
|
I'd try that command exactly as is...  _________________ -wayne |
|
Back to top |
|
 |
hazard |
Posted: Thu Nov 24, 2005 6:00 pm Post subject: |
|
|
Newbie
Joined: 16 Nov 2005 Posts: 8
|
Yes, It's right,When i use the -qnamemangling=v5 and remove -q64 then compiling is succeed.
But i need -q64.
And the os is AIX5.1,the version of MQ is 5.3, It doesn't support 64-bit?
Last edited by hazard on Thu Nov 24, 2005 11:08 pm; edited 1 time in total |
|
Back to top |
|
 |
|