| Author | Message | 
		
		  | lejal | 
			  
				|  Posted: Wed Apr 17, 2002 7:10 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 Apr 2002Posts: 13
 
 
 | 
			  
				| I modified the programm amqsput0.c to be able to put a complete file toto.txt in a queue. I imported the library mqm.lib. When I try to build the amqsput0.c file, I get an error : undefined reference to "MQCONN" and this message for all MQ command.
 Any idea ?
 Thierry
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mqonnet | 
			  
				|  Posted: Wed Apr 17, 2002 7:24 am    Post subject: |   |  | 
		
		  |  Grand Master
 
 
 Joined: 18 Feb 2002Posts: 1114
 Location: Boston, Ma, Usa.
 
 | 
			  
				| Probable cause would be that mqm.lib is not linked properly or are using the wrong version of it.  Are you using C compiler from command prompt, or are you using Visual Studio.  If you are using the latter you need to add mqm.lib to project->settings->link->library module. 
 Cheers.
 Kumar
 
 _________________
 IBM Certified WebSphere MQ V5.3 Developer
 IBM Certified WebSphere MQ V5.3 Solution Designer
 IBM Certified WebSphere MQ V5.3 System Administrator
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | lejal | 
			  
				|  Posted: Wed Apr 17, 2002 11:47 pm    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 Apr 2002Posts: 13
 
 
 | 
			  
				| That's exactly the problem. This library isn't linked properly. But I don't use Visual Studio and I don't build my programs from the prompt. My compiler is called Dev-C++ 4 by "Bloodshed". It's a freeware. Do you know it? I have copied the file called mqm.LIB in the Dev-C++ lib directory and I've still got the same error message given by the linker : "undefined reference to "MQCONN", undefined reference to "MQOPEN", etc...
 What could be the solution?                                Thanks.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | lejal | 
			  
				|  Posted: Thu Apr 18, 2002 1:37 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 Apr 2002Posts: 13
 
 
 | 
			  
				| Hi! Thank you for your tip but it still doesn't work. I have built this program with another compiler and ther's the same problem. So, I tried to build a source file of an executable supplied by MQSeries and there's the same linker errors again. I'm really lost...
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | vedbhat | 
			  
				|  Posted: Thu Apr 18, 2002 1:48 am    Post subject: |   |  | 
		
		  |  Disciple
 
 
 Joined: 19 Mar 2002Posts: 186
 Location: Singapore
 
 | 
			  
				| Hi, 
 1) In the LIB Environment variable add "X:...MQSeriestoolslib"
 2) In the INCLUDE Environment variable add "X:..MQSeriestoolscinclude;X:..MQSeriestoolscplusinclude;"
 
 Where X is the drive and directory where MQSeries is installed
 
 Regards
 Ved
 
 [ This Message was edited by: vedbhat on 2002-04-18 02:50 ]
 
 [ This Message was edited by: vedbhat on 2002-04-18 02:52 ]
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | lejal | 
			  
				|  Posted: Thu Apr 18, 2002 1:53 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 Apr 2002Posts: 13
 
 
 | 
			  
				| There's no LIB variable on my system and I'm not allowed to create any (I'm not the administrator). Is there another solution? Thank you for your help.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | vedbhat | 
			  
				|  Posted: Thu Apr 18, 2002 1:55 am    Post subject: |   |  | 
		
		  |  Disciple
 
 
 Joined: 19 Mar 2002Posts: 186
 Location: Singapore
 
 | 
			  
				| Hi, 
 What is the OS that you are using.
 
 Regards
 Ved
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mqonnet | 
			  
				|  Posted: Thu Apr 18, 2002 3:30 am    Post subject: |   |  | 
		
		  |  Grand Master
 
 
 Joined: 18 Feb 2002Posts: 1114
 Location: Boston, Ma, Usa.
 
 | 
			  
				| If you are running from the prompt using your DEV C++ compiler, there should be a flag to supply Library paths.  Check the compiler flags through it's help.  If it is an IDE, then there must be a way out in it to specify the Library paths. Check them out.
 
 Hope this helps.
 Cheers.
 Kumar
 
 _________________
 IBM Certified WebSphere MQ V5.3 Developer
 IBM Certified WebSphere MQ V5.3 Solution Designer
 IBM Certified WebSphere MQ V5.3 System Administrator
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mrlinux | 
			  
				|  Posted: Thu Apr 18, 2002 3:54 am    Post subject: |   |  | 
		
		  |  Grand Master
 
 
 Joined: 14 Feb 2002Posts: 1261
 Location: Detroit,MI USA
 
 | 
			  
				| Well reading your subject you used the word CLIENT does that mean you have MQ Client installed, if so the correct lib to link on NT is mqic32.lib not mqm.lib 
 _________________
 Jeff
 
 IBM Certified Developer MQSeries
 IBM Certified Specialist MQSeries
 IBM Certified Solutions Expert MQSeries
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | lejal | 
			  
				|  Posted: Thu Apr 18, 2002 4:21 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 Apr 2002Posts: 13
 
 
 | 
			  
				| Sorry for having made you wait for my answer. I'm using Windows 2000. Finally, I've found the environment variable LIB and I set it like you told me.
 I have checked all the Libraries paths on my IDE. And with the mqic32.lib there is the same errors. I'm beginning to think that someone put a spell on me to prevent me to work.
 I'm really lost. I've never met such a strange problem and I have built thousands of programs yet!
 Once again thank you so much for trying to help me!
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mrlinux | 
			  
				|  Posted: Thu Apr 18, 2002 4:41 am    Post subject: |   |  | 
		
		  |  Grand Master
 
 
 Joined: 14 Feb 2002Posts: 1261
 Location: Detroit,MI USA
 
 | 
			  
				| I dont know your C++/C Compiler but is there a switch to turn off the C++ Name Mangling ??? 
 _________________
 Jeff
 
 IBM Certified Developer MQSeries
 IBM Certified Specialist MQSeries
 IBM Certified Solutions Expert MQSeries
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | lejal | 
			  
				|  Posted: Thu Apr 18, 2002 4:47 am    Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 16 Apr 2002Posts: 13
 
 
 | 
			  
				| What is the C++ Name mangling? |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | bower5932 | 
			  
				|  Posted: Thu Apr 18, 2002 9:04 am    Post subject: |   |  | 
		
		  |  Jedi Knight
 
 
 Joined: 27 Aug 2001Posts: 3023
 Location: Dallas, TX, USA
 
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mrlinux | 
			  
				|  Posted: Thu Apr 18, 2002 9:12 am    Post subject: |   |  | 
		
		  |  Grand Master
 
 
 Joined: 14 Feb 2002Posts: 1261
 Location: Detroit,MI USA
 
 | 
			  
				| One of the c++ features of have the same function name with different parameters requires the function names be modified at link link time to some mangled name
 This is just a made up sample to give you and idea about mangling, actual mangled names look real strange and every c++ compiler appears to do it differently (bright idea)
 ie   add(int,int)
 add(long,long)
 
 mangled names  addINT
 addLONG
 
 Check cmqc.h header file find the following
 does your c++ compiler generate the ___cplusplus symbol if so then name mangling isnt the issue if not then remove the if defined
 
 #if defined(__cplusplus)
 extern "C" {
 #endif
 
 _________________
 Jeff
 
 IBM Certified Developer MQSeries
 IBM Certified Specialist MQSeries
 IBM Certified Solutions Expert MQSeries
 
 [ This Message was edited by: mrlinux on 2002-04-18 10:21 ]
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | StefanSievert | 
			  
				|  Posted: Thu Apr 18, 2002 12:35 pm    Post subject: |   |  | 
		
		  |  Partisan
 
 
 Joined: 28 Oct 2001Posts: 333
 Location: San Francisco
 
 | 
			  
				| OK, I am going to add to that lengthy discussion...   I just downloaded the compiler and tried it; with no problems.
 If you open the Project options (Alt-P), you will see an entry field at the bottom titled: 'Linker Options/Optional Libs or Object files'. If you put in c:msmqctoolslibmqic32.lib, replacing the path with your path to the library, it should work.
 Cheers,
 Stefan
 
 _________________
 Stefan Sievert
 IBM Certified * WebSphere MQ
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |