|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Linking ...LIBs |
« View previous topic :: View next topic » |
Author |
Message
|
Gopi |
Posted: Thu May 30, 2002 7:34 pm Post subject: Linking ...LIBs |
|
|
Novice
Joined: 23 May 2002 Posts: 18
|
Guys ..
Can anybody tell me wat are the .libs should i link with .c files ?
I am working on win2k. Both Mq Series server & Client were on same m/c.
currently iam trying to link like this:
Visual c++ comiler iam using. (.NET)
c:\ cl mqput.c /link mqic32.lib
When i link like this, Its saying
Link:fatal error: and asking me for libc.lib.
But i dont know where this file is..
Can anybody tell mw wats wrong with my linking???
And another problem i got is , in the cmcq.h file, NULL is not defined. so when i tried to compile my .c file , it said
fatal error: undelcared identifier NUUL..
and exiting without creting any .exe file. so i tried to define NUUL as char in the cmcq.h file. is it right to do like that? did anyone faced this problem?
I am struck up. I really appreciate if anybody can solve my problem..
Thanks,
Gopi. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Thu May 30, 2002 8:27 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Here is a sample makefile for compiling & linking my 'C' program mmx.c . Copy the snippet to a file called: makefile.nt
Then from the command line type: nmake -f makefile.nt
later
Roger...
Code: |
# Nmake macros for building Win32 applications
TARGETOS=WINNT
#/**********************************************************/
#/* */
#/**********************************************************/
MQMDIR = "c:\Program Files\MQSeries"
MQMLIB = "c:\Program Files\MQSeries\tools\lib"
MQMINC = "c:\Program Files\MQSeries\tools\c\include"
MYdiagFlag =
#MYdiagFlag = -DDIAGNOSE
!include <ntwin32.mak>
# Inference rules
.c.obj:
$(cc) $(cdebug) $(cflags) $(MYdiagFlag) $(cvars) -I$(MQMINC) $<
.obj.exe:
$(link) $(ldebug) $(conlflags) -out:$*.exe $** $(conlibs) user32.lib $(MQMLIB)\mqm.lib
# Target List
All: mmx.exe
# Source Objects
mmx.obj : mmx.c
# Executables
mmx.exe : mmx.obj
# Clean up everything
cleanall : clean
del *.exe
# Clean up everything except .exe files
clean:
del *.obj
|
|
|
Back to top |
|
 |
Gopi |
Posted: Fri May 31, 2002 5:18 am Post subject: |
|
|
Novice
Joined: 23 May 2002 Posts: 18
|
Hi Roger,
Thanx a lot.
Its very nice. Now it's worrking fine with comipling & linking.
When iam comiling , i am getting Fatal error: undeclared identifier NULL.
But in my C code i dont have any NULL identifier, so the only include file is cmcq.h.
so i opened that file & checked it, there i found NULL, which is passed to some function calls. I guess its something like default value. for that reason when i compile its saying undeclared identifier NULL, i think.so did anybody got this fatal error ever?
for the time being i modified char NULL in cmcq.h file , & saved the file. And started recompiling . Now its working fine. i mean i am able to generate .obj, .exe files.. and evrything. But still i do have some feeling like, i shouldnt modify .h files like this. So if you can suggest wat i should do.. its really helpful.
Thanx a lot..
Gopi. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri May 31, 2002 7:41 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hummm, that's interesting. Well, I just checked stdio.h for VS C++ v6 and it has the following:
Code: |
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
|
Therefore, if the stdio.h in VS .NET does not have it, I would just add it to the top of your program rather than modify all of the MQSeries include files.
later
Roger... |
|
Back to top |
|
 |
Gopi |
Posted: Fri May 31, 2002 8:55 pm Post subject: |
|
|
Novice
Joined: 23 May 2002 Posts: 18
|
Roger,
Cool..I will go ahead and do this way..
Thanx a lot.
Gopi |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|