No joy using gcc 2.95.3 + MathLink v3r9 + Windows 2000 SP2
- To: mathgroup at smc.vnet.net
- Subject: [mg31600] No joy using gcc 2.95.3 + MathLink v3r9 + Windows 2000 SP2
- From: "Matthew D. Langston" <langston at SLAC.Stanford.EDU>
- Date: Fri, 16 Nov 2001 06:38:04 -0500 (EST)
- Organization: Stanford Linear Accelerator Center
- Sender: owner-wri-mathgroup at wolfram.com
I'm trying to recompile, using gcc 2.95.3, a library of functions
written in C/C++ that I have already successfully exported to
Mathematica (using MathLink) with cl.exe version 6 (from Microsoft
Visual Studio 6.0) and cl.exe version 7 (from Microsoft Visual
I'm running Windows 2000 SP2, Mathematica 4.1, and using mldev32 from
the MathLink Developer's Kit v3r9. The version of gcc I am using is
2.95.3-5 from the Cygwin 1.3.5 release (which is the latest version as I
I'm linking against the ml32i2m.lib import library (the version for
Microsoft Visual Studio 6.0).
I'm passing "-mwindows" to gcc at both compile time and link time, and
passing "-e _mainCRTStartup" to gcc at link time. This *should* give me
an official, respectable Win32 application. And indeed, these options
do work in creating working Win32 applications.
My library of C/C++ functions compiles and links fine with all three
compilers (i.e. gcc 2.95.3, cl.exe version 6, and cl.exe version 7). My
functions work just fine (after Installing them in Mathematica ) using
the two Microsoft compilers, but the gcc version "appears" to hang
When I run Install["Minuitgcc`"] (to load the gcc version of my MathLink
exported functions) from within the Mathematica Front End, I get a
dialog box with the title "MathLink" that has a "Create link:" label, a
text entry box and an "OK" and "Cancel" button.
If I click the "OK" button (without entering anything in the text box)
then I get another dialog box with the title "MathLink" that has a "Link
created on: 628" label and an "OK" button.
My MathLink program appears in the Windows Task Manager as task
"Minuitgcc(628)" with a status of "Running". However, Mathematica just
hangs on the cell that executed the Install["Minuitgcc`"] command. The
title of the Front End Mathematica window is "Running...m2c.nb" (my
notebooks name is m2c.nb).
The exact same code is being used by all three compilers (i.e. my source
code of functions, the same mathlink.h file, the same output file from
mprep, the same ml32i2m.lib import library, etc.). The only difference
is the compiler/linker.
Why do the two Microsoft compilers create working MathLink programs,
while gcc doesn't?
Thank you for your help.
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
langston at SLAC.Stanford.EDU
Prev by Date:
Re: Keeping terms of certain order in expand command
Next by Date:
Re: JLink installation w95
Previous by thread:
Re: Keeping terms of certain order in expand command 
Next by thread:
Re: No joy using gcc 2.95.3 + MathLink v3r9 + Windows 2000 SP2