| Author | 
		  Message
		 | 
		
		  | Luvuyo | 
		  
		    
			  
				 Posted: Tue Aug 24, 2004 5:58 am    Post subject: ERROR: Undefined symbols during compilation of C++ prog | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 24 Aug 2004 Posts: 6
  
  | 
		  
		    
			  
				I've ported a C++ program from a Windows NT 4 environment to AIX 5.3. The program basically gets messages from an MQ Series queue and turns triggering on of another queue. Unfortunately I am not able to compile (and link) the program on the AIX platform. I keep getting the following error: 
 
 
The following symbols are in error:
 
 
 Symbol     
 
               
 
 .ImqBin::copyOut(void*,unsigned      long,char)         
 
                                                              
 
 .ImqObj::setOpenOptions(long)
 
 .ImqCac::useEmptyBuffer(const char*,unsigned long) 
 
 
The contents of the makefile is as follows:
 
 
 
===============================================
 
 
.SUFFIXES: .cpp .o
 
.DEFAULT: all
 
 
PROGRAM=myMQprog
 
 
SRCS=myMQprog.cpp
 
OBJS=$(SRCS:.cpp=.o)
 
 
CC=xlC
 
 
 
CC_FLAGS= -qnamemangling=v5  -I/usr/mqm/inc 
 
-blibpath:"/usr/vacpp/lib:/usr/lib:/lib:/usr/vac/lib"                  
 
 
all: $(PROGRAM)
 
 
.cpp.o:
 
        $(CC) $(CC_FLAGS) -c $<
 
 
myMQprog: $(OBJS)
 
        $(CC) $(CC_FLAGS) $(OBJS)  -L. -bnoquiet -L/usr/mqm/lib  
 
-limqs23ia -limqb23ia -o $@
 
 
 
===============================================
 
 
Any ideas?
 
 
I'm not sure which MQ libraries to use. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | PGoodhart | 
		  
		    
			  
				 Posted: Tue Aug 24, 2004 9:29 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Master
 
 Joined: 17 Jun 2004 Posts: 278 Location: Harrisburg PA 
  | 
		  
		    
			  
				You did change the carriage returns/line feeds?
 
Most annoying part of Windows/AIX porting sometimes is hidden characters, particularly when you are using certain compliers.
 
The other thing I always warn people about is the directionality of slashes. _________________ Patrick Goodhart
 
MQ Admin/Web Developer/Consultant
 
WebSphere Application Server Admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | JasonE | 
		  
		    
			  
				 Posted: Wed Aug 25, 2004 2:28 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 03 Nov 2003 Posts: 1220 Location: Hursley 
  | 
		  
		    
			  
				| Try compiling with the option "-q namemangling=v5" - Any help? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Luvuyo | 
		  
		    
			  
				 Posted: Wed Aug 25, 2004 6:12 am    Post subject: Removed Embedded control characters (CR/LF) | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 24 Aug 2004 Posts: 6
  
  | 
		  
		    
			  
				| I also suspected the embedded control characters and decided to compile one of sample MQ Series C++ programs - The result was a similar error i.e. unresolved symbol during the link process. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Luvuyo | 
		  
		    
			  
				 Posted: Wed Aug 25, 2004 6:17 am    Post subject: -q namemangling=v5 | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 24 Aug 2004 Posts: 6
  
  | 
		  
		    
			  
				Using the "-q namemangling=v5" option did not have any effect.
 
 
Thanks for all the help. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | JasonE | 
		  
		    
			  
				 Posted: Wed Aug 25, 2004 6:54 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 03 Nov 2003 Posts: 1220 Location: Hursley 
  | 
		  
		    
			  
				Oopos - its a link time not compile time option. What compiler are you using to do this? Its an exact match for a problem reported, and this option did solve it for them!
 
 
To quote an update:
 
   
	| Quote: | 
   
  
	I have investigated the above problem and I was able to    
 
             recreate the problem on one of the AIX machines we have in 
 
             the lab.  If the above assumption is correct, then I think 
 
             the customer has not used the VisualAge C/C++ v6.0 compiler
 
             option "-q namemangling=v5" for C++ to get all the WMQ     
 
             symbols resolved while linking the libraries.  Please      
 
             check the note in the following URL;                       
 
             http://www-306.ibm.com/software/integration/mqfamily/platfo
 
             rms/supported/wsmq_for_aix_5_3.html  | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Luvuyo | 
		  
		    
			  
				 Posted: Wed Aug 25, 2004 7:22 am    Post subject: "-q namemangling=v5" - Possible error in syntax? | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 24 Aug 2004 Posts: 6
  
  | 
		  
		    
			  
				Even after using the "-q namemangling=v5" option I still get the same error.
 
 
Below is a snippet of the command executed on AIX.
 
 
xlC "-qnamemangling=v5" -I/usr/mqm/inc -blibpath:"/usr/vacpp/lib:/usr/li
 
b:/lib:/usr/vac/lib" myMQprog.o  -L. -bnoquiet -L/usr/mqm/lib -limqs23ia -limqb23ia -o myMQprog
 
 
As you can see I tried using the "-q namemangling=v5". I removed the space between the q and n because the compiler did not like the syntax. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | JasonE | 
		  
		    
			  
				 Posted: Wed Aug 25, 2004 7:36 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 03 Nov 2003 Posts: 1220 Location: Hursley 
  | 
		  
		    
			  
				Can you compile the c++ samples?
 
 
xlC -O -qnamemangling=v5 -c imqsput.cpp                    
 
xlC  -I/usr/lpp/mqm/inc   -limqc23ia -limqb23ia -o imqsput imqsput.o 
 
 
is shown as working - does it for you? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Luvuyo | 
		  
		    
			  
				 Posted: Thu Aug 26, 2004 12:10 am    Post subject: compiling with imqsput.cpp | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 24 Aug 2004 Posts: 6
  
  | 
		  
		    
			  
				The comands:
 
 
xlC -O -qnamemangling=v5 -c imqsput.cpp 
 
xlC -I/usr/lpp/mqm/inc -limqc23ia -limqb23ia -o imqsput imqsput.o 
 
 
produced the following errors:
 
 
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(const long)
 
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::cutOut(ImqStr&,const 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::compare(const ImqStr&) const
 
ld: 0711-317 ERROR: Undefined symbol: .ImqStr::~ImqStr()
 
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setTransportType(const long)
 
ld: 0711-317 ERROR: Undefined symbol: .ImqChl::setConnectionName(const char*)
 
ld: 0711-317 ERROR: Undefined symbol: .ImqCac::useEmptyBuffer(const char*,const
 
unsigned long)
 
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::setFormat(const char*)
 
ld: 0711-317 ERROR: Undefined symbol: .ImqCac::setMessageLength(const unsigned l
 
ong)
 
ld: 0711-317 ERROR: Undefined symbol: .ImqMsg::~ImqMsg()
 
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
 
 
Your assistance is much appreciated. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | JasonE | 
		  
		    
			  
				 Posted: Thu Aug 26, 2004 1:17 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 03 Nov 2003 Posts: 1220 Location: Hursley 
  | 
		  
		    
			  
				| What compiler version are you running? What version/fixpack of MQ? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Luvuyo | 
		  
		    
			  
				 Posted: Thu Aug 26, 2004 1:52 am    Post subject: Visualage C++ 6.0.0.0 and MQ 5.3 maintenance csd05 | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 24 Aug 2004 Posts: 6
  
  | 
		  
		    
			  
				| We are running VisualAge C++ 6.0.0.0 and MQ Series 5.3 with maintenance version csd05. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | JasonE | 
		  
		    
			  
				 Posted: Thu Aug 26, 2004 3:15 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 03 Nov 2003 Posts: 1220 Location: Hursley 
  | 
		  
		    
			  
				Hmmm - That has solved it for all problems reported by customers so far, so I really dont know, Sorry!
 
 
Unless someone comes up with a better solution, I would suggest raising it wih IBM and indicate the exact syntax you have used (including the option I mentioned) and the exact errors reported. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | clindsey | 
		  
		    
			  
				 Posted: Thu Aug 26, 2004 6:08 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Knight
 
 Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx 
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	
 
xlC -O -qnamemangling=v5 -c imqsput.cpp 
 
xlC -I/usr/lpp/mqm/inc -limqc23ia -limqb23ia -o imqsput imqsput.o 
 
 | 
   
 
 
 
I just tried this with WMQ 5.3 csd04 on aix 5.2 with VisualAge C++ v6 and it worked fine for me.
 
 
One note though, using -I on the link step doesn't do anything (that is for include path during compile) . Try
 
xlC -L/usr/lpp/mqm/lib -limqc23ia -limqb23ia -o imqsput imqsput.o
 
 
You shouldn't even need the -L because links to these libs should be in /usr/lib. But, by putting in the -L, you can be certain that you are picking up the correct libs. 
 
 
Charlie | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |