ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Building MQSeries exit dll using Cygwin

Post new topic  Reply to topic
 Building MQSeries exit dll using Cygwin « View previous topic :: View next topic » 
Author Message
Keka
PostPosted: Mon Apr 05, 2004 8:00 am    Post subject: Building MQSeries exit dll using Cygwin Reply with quote

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
View user's profile Send private message
RogerLacroix
PostPosted: Mon Apr 05, 2004 11:30 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Michael Dag
PostPosted: Mon Apr 05, 2004 11:50 pm    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

what did you specify as the commandline options on gcc?
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
RogerLacroix
PostPosted: Tue Apr 06, 2004 7:20 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Keka
PostPosted: Tue Apr 06, 2004 7:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Michael Dag
PostPosted: Tue Apr 06, 2004 11:12 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Keka
PostPosted: Tue Apr 06, 2004 4:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Keka
PostPosted: Tue Apr 06, 2004 4:52 pm    Post subject: recall last post Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Building MQSeries exit dll using Cygwin
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.