Re: Problems compiling addrow with gcc-mingw (windows).
- To: mathgroup at smc.vnet.net
- Subject: [mg111339] Re: Problems compiling addrow with gcc-mingw (windows).
- From: "Eduardo M. A. M.Mendes" <emammendes at gmail.com>
- Date: Wed, 28 Jul 2010 02:53:46 -0400 (EDT)
Hi again Thanks for the patience. I don't know if I got what you meant so I tied the following commands a) mprep addtwo.tm -o addtwotm.c (page 48 of MathLink Development in C) b) then I try C:\msys\1.0\home\eduardo\MATHLI~1\addtwo>g++ -Ic:/msys/1.0/home/eduardo/include addtwotm.c -o addtwo.exe -Lc:/msys/1.0/home/eduardo/lib -lML32i3 -lML32i2 -lML3 i1 C:\Users\eduardo\AppData\Local\Temp\ccelsS8E.o:addtwotm.c:(.text+0x15b): undefi ed reference to `GetStockObject@4' collect2: ld returned 1 exit status c) and C:\msys\1.0\home\eduardo\MATHLI~1\addtwo>g++ -Ic:/msys/1.0/home/eduardo/include addtwo.c -o addtwo.exe -Lc:/msys/1.0/home/eduardo/lib -lML32i3 -lML32i2 -lML32i C:\Users\eduardo\AppData\Local\Temp\cc2EukU7.o:addtwo.c:(.text+0x3a): undefined reference to `MLInitializeIcon' C:\Users\eduardo\AppData\Local\Temp\cc2EukU7.o:addtwo.c:(.text+0x96): undefined reference to `MLMain' collect2: ld returned 1 exit status Which one is the right one? The Documentation is too convoluted and there is no help with cygwin. Many thanks Ed -----Original Message----- From: Patrick Scheibe [mailto:pscheibe at trm.uni-leipzig.de] Sent: Tuesday, July 27, 2010 10:17 AM To: Eduardo M. A. M.Mendes Cc: mathgroup at smc.vnet.net Subject: [mg111339] Re: [mg111326] Problems compiling addrow with gcc-mingw (windows). Hi, why are you giving > addtwo.c addtwotm.c both files? You mprep addtwo.tm into addtwo.c and then use only addtwo.c to compile. This should kill the multiple references error message. Cheers Patrick Am Jul 27, 2010 um 1:53 PM schrieb Eduardo M. A. M.Mendes: > Hello > > > > I am trying to get addwo.exe using gcc (or g++) that comes with > mingw. I > have all libs and includes from cygwin that come with Mathematica > (Mathlink) > installed in a different dir structure but unfortunately I got the > following > error > > > > > > C:\msys\1.0\home\eduardo\MATHLI~1\addtwo>g++ > -Ic:/msys/1.0/home/eduardo/include > > addtwo.c addtwotm.c -o addtwo.exe -Lc:/msys/1.0/home/eduardo/lib - > lML32i3 > > C:\Users\eduardo\AppData\Local\Temp\ccYUOj6v.o:addtwotm.c:(.text > +0x285): > multip > > e definition of `addtwo(int, int)' > > C:\Users\eduardo\AppData\Local\Temp\ccNPhnOo.o:addtwo.c:(.text+0x0): > first > defi > > ed here > > C:\Users\eduardo\AppData\Local\Temp\ccYUOj6v.o:addtwotm.c:(.text > +0x293): > multip > > e definition of `WinMain@16' > > C:\Users\eduardo\AppData\Local\Temp\ccNPhnOo.o:addtwo.c:(.text+0xe): > first > defi > > ed here > > C:\Users\eduardo\AppData\Local\Temp\ccYUOj6v.o:addtwotm.c:(.text > +0x15b): > undefi > > ed reference to `GetStockObject@4' > > collect2: ld returned 1 exit status > > > > Does anyone know what to sort this out? > > > > Many thanks > > > > Ed > >