IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 1 reply
  • Latest Post - ‏2013-08-27T08:49:03Z by NagenDash
SystemAdmin
SystemAdmin
6902 Posts

Pinned topic AIX/g++ linking issue

‏2008-11-26T10:48:53Z |
we are using g++ (GCC) 4.2.0 complier to compile some c++ programs which is using MQ API calls in AIX 5.3.0.0 .
Compiling is OK and able to create .o files , but when we link those files using g++ -o
It is giving us errors like

ld: 0711-317 ERROR: Undefined symbol: .ImqObj::setConnectionReference(ImqMgr*)
ld: 0711-317 ERROR: Undefined symbol: typeinfo for ImqErr
ld: 0711-317 ERROR: Undefined symbol: .ImqErr::~ImqErr()
ld: 0711-317 ERROR: Undefined symbol: .ImqMgr::ImqMgr()
ld: 0711-317 ERROR: Undefined symbol: .ImqQue::ImqQue()
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::ImqMsg()
ld: 0711-317 ERROR: Undefined symbol: .ImqGmo3::ImqGmo3()
ld: 0711-317 ERROR: Undefined symbol: .ImqPmo::ImqPmo()
ld: 0711-317 ERROR: Undefined symbol: .ImqObj::setName(char const*)
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*, unsig
ned long)
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::setFormat(char const*)
ld: 0711-317 ERROR: Undefined symbol: .ImqCac::setMessageLength(unsigned long)
ld: 0711-317 ERROR: Undefined symbol: .ImqBin::ImqBin(void const*, unsigned long
)
ld: 0711-317 ERROR: Undefined symbol: .ImqMtr::setCorrelationId(ImqBin const&)
ld: 0711-317 ERROR: Undefined symbol: .ImqQue::put(ImqMsg&, ImqPmo&)
ld: 0711-317 ERROR: Undefined symbol: .ImqBin::~ImqBin()
ld: 0711-317 ERROR: Undefined symbol: .ImqMtr::setMessageId(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()
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-345 Use the -bloadmap or -bnoquiet option to obtain more information.
we are using the commands :-

g++ -c sample1.cpp

g++ -c sample2.cpp

g++ -o out sample1.o sample2.o -L/usr/mqm/lib64 -limqb23ia -limqb23ia_r -limqs23ia.a -limqs23ia_r.a

The required lib files exist in both /usr/mqm/lib64 and current working dir .

It seems the complier not able to find mqlibraries

Can you guys able to help on this ?
  • NagenDash
    NagenDash
    1 Post

    Re: AIX/g++ linking issue

    ‏2013-08-27T08:49:03Z  

    Hi use "-Wl, -berok" option when linking all the objects together to make executable.

    Ex- g++ -c -Wl, -berok sample1.cpp