Author |
Message
|
RobertJ |
Posted: Sun Sep 01, 2002 9:12 pm Post subject: problems compiling IMQ C++ samples |
|
|
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 |
|
 |
bower5932 |
Posted: Tue Sep 03, 2002 4:55 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
RobertJ |
Posted: Tue Sep 03, 2002 2:08 pm Post subject: |
|
|
Newbie
Joined: 01 Sep 2002 Posts: 4
|
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 |
|
 |
RobertJ |
Posted: Tue Sep 03, 2002 9:18 pm Post subject: |
|
|
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 |
|
 |
abalan |
Posted: Wed Sep 25, 2002 7:35 am Post subject: |
|
|
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 |
|
 |
RobertJ |
Posted: Wed Sep 25, 2002 2:06 pm Post subject: |
|
|
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 |
|
 |
racer |
Posted: Fri Feb 13, 2004 9:19 am Post subject: |
|
|
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 |
|
 |
racer |
Posted: Mon Feb 16, 2004 2:50 am Post subject: |
|
|
Newbie
Joined: 13 Feb 2004 Posts: 2
|
|
Back to top |
|
 |
fmr57 |
Posted: Thu May 06, 2004 7:11 am Post subject: |
|
|
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 |
|
 |
clindsey |
Posted: Thu May 06, 2004 8:39 am Post subject: |
|
|
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 |
|
 |
mhubbard |
Posted: Fri Oct 08, 2004 5:37 am Post subject: Same Problem on Linux |
|
|
 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 |
|
 |
Amazone |
Posted: Mon Jun 12, 2006 12:00 am Post subject: |
|
|
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 |
|
 |
mvic |
Posted: Mon Jun 12, 2006 12:19 am Post subject: |
|
|
 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 |
|
 |
|