Author |
Message
|
Keka |
Posted: Mon Apr 05, 2004 8:00 am Post subject: Building MQSeries exit dll using Cygwin |
|
|
Voyager
Joined: 28 Dec 2002 Posts: 96
|
Hi,
I am trying to build aan exit related dll using Cygwin , gcc on Windows XP. It builds with out any problems but when I try to use it on the server connection channel, the channel dies with the error the dll is invalid.
Has anybody tried using cygwin to build the exit dll??
Any help is appreciated.
thanks _________________ Keka |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Apr 05, 2004 11:30 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
I use MinGW (with Eclipse) without any problems. Here is the make file that I use:
Code: |
#
# This Makefile makes the mysecexit MQ Exit
#
all: mysecexit.dll
# CC defines the compiler.
CC = gcc
DLLTOOL= dlltool
DLLWRAP= dllwrap
# Set CCOPTS - the compiler options.
CCOPTS = -c -DUNIX -DMINGW32
# MQM directories
MQMLIB = "C:\Program Files\IBM\WebSphere MQ\Tools\Lib"
MQMINC = "C:\Program Files\IBM\WebSphere MQ\Tools\c\include"
LIBS = -lm -lmqm
mysecexit.dll : mysecexit.o
$(CC) -shared -mthreads -o mysecexit.dll mysecexit.o -lwinmm -lm
$(DLLWRAP) --export-all --output-def=libmysecexit.def --output-lib=libmysecexit.a --dllname=mysecexit.dll mysecexit.o -lwinmm -lm
$(CC) -shared -Wl,--enable-auto-image-base -o mysecexit.dll -Wl,--out-implib=libmysecexit.a mysecexit.o -lwinmm
########################################################################################################################################### The above 3 commands are on 1 line each
###########################################################################################################################################
#the object files depend on the corresponding source files
.c.o:
$(CC) $(CCOPTS) -I. -I/usr/include -I/usr/include/sys -I$(MQMINC) $< |
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
Michael Dag |
Posted: Mon Apr 05, 2004 11:50 pm Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Apr 06, 2004 7:20 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
I'm not sure who that question was for, but everything is in the make file.
After the install of MinGW (Minimalist GNU For Windows), I globally set the PATH environment (via the Control Panel) to include MinGW's bin directory. i.e. C:\MinGW\bin
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
Keka |
Posted: Tue Apr 06, 2004 7:59 am Post subject: |
|
|
Voyager
Joined: 28 Dec 2002 Posts: 96
|
I tried to use the options Rogr provided for CygWin but it did not recognize log those options and threw exceptions.
Below is the command line options I used to build the dll.
gcc -c RecvExit.c -I "C:\Program Files\IBM\WebSphere MQ\Tools\C\Include"
Then below command in one line to build the dll.
gcc -shared -o cygReceiveExit.dll \
-Wl,--out-implib=libReceiveExit.dll.a \
-Wl,--export-all-symbols \
-Wl,--enable-auto-import \
-Wl,--whole-archive "RecvExit.o" \
-Wl,--no-whole-archive "C:\Program Files\IBM\WebSphere MQ\Tools\Lib\mqm.lib"
it builds the dll but the size is really less like 18KB. It looks like it is not building it right or something else..
I will also try to download and try minGW.
Thanks _________________ Keka |
|
Back to top |
|
 |
Michael Dag |
Posted: Tue Apr 06, 2004 11:12 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
it's a long time ago I used cygwin, I thought there also was a -nocygwin
option on the compiler so it can run 'outside' the cygwin environment... _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
Keka |
Posted: Tue Apr 06, 2004 4:29 pm Post subject: |
|
|
Voyager
Joined: 28 Dec 2002 Posts: 96
|
I downloaded minGW and tried to use the commands you provided. It throws me errors.
I made sure that I modified it to include the tabs required by the makefile. But It still throws me the following errors.
************ERROR******************
$ makefile
./makefile: all:: command not found
./makefile: recvexit.dll: command not found
./makefile: CC: command not found
./makefile: -shared: command not found
C:\msys\1.0\mingw\bin\DLLWRAP.exe: Must provide at least one of -o or --dllname options
./makefile: --export-all: command not found
./makefile: CC: command not found
./makefile: -shared: command not found
./makefile: .c.o:: command not found
./makefile: CC: command not found
./makefile: CCOPTS: command not found
./makefile: MQMINC: command not found
./makefile: -Irecvexit.c: command not found
************ERROR******************
******Modified Make file*************
all: recvexit.dll
#CC defines the compiler.
CC=gcc
DLLTOOL=dlltool
DLLWRAP=dllwrap
# Set CCOPTS - the compiler options.
CCOPTS="-c -DUNIX -DMINGW32"
# MQM directories
MQMLIB="C:\Program Files\IBM\WebSphere MQ\Tools\Lib"
MQMINC="C:\Program Files\IBM\WebSphere MQ\Tools\c\include"
LIBS="-lm -lmqm"
recvexit.dll : recvexit.o
$(CC) -shared -mthreads -o recvexit.dll recvexit.o -lwinmm -lm
$(DLLWRAP) --export-all --output-def=librecvexit.def --output-lib=librecvexit.a --dllname=recve
xit.dll recvexit.o -lwinmm -lm
$(CC) -shared -Wl,--enable-auto-image-base -o recvexit.dll -Wl,--out-implib=librecvexit.a recve
xit.o -lwinmm
#the object files depend on the corresponding source files
.c.o:
$(CC) $(CCOPTS) -Irecvexit.c -I/usr/include -I/usr/include/sys -I$(MQMINC)
******Modified Make file*************
Any Idea?? _________________ Keka |
|
Back to top |
|
 |
Keka |
Posted: Tue Apr 06, 2004 4:52 pm Post subject: recall last post |
|
|
Voyager
Joined: 28 Dec 2002 Posts: 96
|
I recall my last post.
I think I found the problem. I was invoking makefile instead of make all.
Sorry _________________ Keka |
|
Back to top |
|
 |
|