🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.soft-sys.matlab
1 messages
1 total messages Started by James Gallagher Wed, 26 Jan 2000 00:00
Using g++ to link a Mex file
#200
Author: James Gallagher
Date: Wed, 26 Jan 2000 00:00
37 lines
2214 bytes
Hi,

Has anyone had any success using g++ (or GNU ld) to link a mex file? 

System information: Sparc 5, Solaris 2.6, gcc/g++ 2.95.1 with matching
stdc++ library, Matlab 5.3.0... .

Here's why I'm asking:

I'm working on a mex file written in C++. The mex file uses two C++
libraries, one that I've written and also the stdc++ library. I've built
many programs using these, so I'm fairly confident they are OK. However,
my mex file crashes whenever a global C++ object is used and the
exception processing is screwed up - ecxceptions thrown from within
try/catch blocks are not caught. 

I suspect that constructors for global objects, and other setup code, is
not being run by the mex file. I think that if g++ (or GNU ld
appropriately instructed) is used to do the link rather than the
system's linker, this problem would go away.

I searched the help desk on the web and found an item that described
building mex files using g++, but that seemed targeted at g++ 2.7.x
which is fairly different from 2.95.x. In addition, I noticed that the
gxxopts.sh file it showed used the system linker to actually build the
mex file.

Any help would *really* be appreciated!

Thanks,
James
-- 
__________________________________________________________________________
James Gallagher		         The Distributed Oceanographic Data System
jgallagher@gso.uri.edu              
http://unidata.ucar.edu/packages/dods
Voice: 541.757.7992					 Fax: 541.758.3254
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads