Re: A note on MathLink: cygwin Makefile for building addtwo.exe
- To: mathgroup at smc.vnet.net
- Subject: [mg78429] Re: [mg78395] A note on MathLink: cygwin Makefile for building addtwo.exe
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Sun, 1 Jul 2007 07:46:20 -0400 (EDT)
- References: <11890055.1183200418868.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
With 66 steps to perform, some of them quite complicated, it would be a shock if you DID get it to work. Bobby On Sat, 30 Jun 2007 05:06:42 -0500, Rolf.Mertig at gmail.com <Rolf.Mertig at gmail.com> wrote: > Somehow I could not get the instructions for > "Building MathLink programs with Microsoft Visual Studio" > http://reference.wolfram.com/mathematica/tutorial/MathLinkDeveloperGuide-Windows.html > (i.e., steps 39. up to 66.) to work. > Did anybody do this successfully? With or without VS-service packs? > -- > > Instead I played with cygwin, and just a GNU "make" of the Makefile > below will nicely build addtwo.exe on Windows XP. > This works similar for C++ projects. > > Rolf > > > # Makefile for addtwo using cygwin > # > # Rolf Mertig, GluonVision GmbH, http://www.gluonvision.com > # > # run from a Cygwin bash shell, or an xterm: make > # > # Assumes installation of cygwin (http://cygwin.com) > # > # the important linker flag ( in order to suppress the DOS window) is > -mwindows, > # see: http://www.wxwidgets.org/wiki/index.php/Cygwin > > > # change this to your Mathematica 6 installation > MLINKDIR=/cygdrive/c/Programme/Wolfram\ > Research/Mathematica/6.0/SystemFiles/Links/MathLink/DeveloperKit > > RM = rm > BINARIES = addtwo.exe > > # Set this value with the result of evaluating $SystemID > SYS=Windows > > # since we use the -mno-cygwin option we can use mldev32 instead of > cygwin > CADDSDIR = ${MLINKDIR}/${SYS}/CompilerAdditions/mldev32 > > INCDIR = ${CADDSDIR}/include > LIBDIR = ${CADDSDIR}/lib > > EXTRALIBS = -mwindows # see also: http://www.cygwin.com/faq/faq_3.h tml > MLLIB = ML32i3m # Set this to ML64i3 if using a 64-bit system > > MPREP=${CADDSDIR}/bin/mprep > > all : addtwo > > addtwo : addtwotm.o addtwo.o > ${CC} -I${INCDIR} addtwotm.o addtwo.o -L${LIBDIR} -l${MLLIB} > ${EXTRALIBS} -o $@ > > .c.o : > ${CC} -c -mno-cygwin -mwin32 -I${INCDIR} $< > > addtwotm.c : addtwo.tm > ${MPREP} $? -o $@ > > clean : > @ ${RM} -f addtwotm.c *.o ${BINARIES} > > -- DrMajorBob at bigfoot.com