Calling C++ from IDL [message #28044] |
Thu, 15 November 2001 23:38  |
jicicuendez
Messages: 12 Registered: November 2001
|
Junior Member |
|
|
Hi,
I am writing you all to see if you could help me because I am
trying to call C++ code from IDL (I am working in Sun solaris). We
compile the C++ with CC with extern "C" and produced the .so and when
we
use call_external in IDL, it does not find the C++ template library
which were used in my C++ classes. Is any way to tell IDL where to
look for this library, or can this be done with make_dll (I don't know
the compilation options). Could you help me somehow, maybe there are
other ways, I am a bit desperate. Anyone know the compilation options
if you want to compile with gcc.
The compilation options I used were:
CC -c -xarch=v9 otra.c
CC -G -xarch=v9 otra.o -o libotra.so
from IDL we do:
S=call_external('libotra.so','mas')
Thanks a lot,
Juan Cicuendez
|
|
|
Re: Calling C++ from IDL [message #28078 is a reply to message #28044] |
Wed, 21 November 2001 01:27  |
jicicuendez
Messages: 12 Registered: November 2001
|
Junior Member |
|
|
Hi,
I finally found the solution with gcc. It does not work with CC but I
am suspicious that my intallation is not correct. I used IDL 5.4 and
It turns out that it work at 64bits so it needs the libraries compiled
at 64bits. The last version of gcc gives you this choice with the
compilation option of -m64. I did not have this version but the
problem can be solved if we launched idl in 32bit mode, this could be
achieved with idlde -32 & idl -32, and then it works fine.
Just you know in case someone comes across with the same problem.
Thanks for your help folks.
Juan
Richard Younger <younger@ll.mit.edu> wrote in message news:<3BFA8B4D.51A0BDDB@ll.mit.edu>...
> Martin Downing wrote:
>>
>> Hi Jauan,
>>
>> If Nigel's advice doesnt solve your problem then it may be down to a
>> bug in the CC compiler. Many moons ago I reported a bug to Sun where
>> template methods were not being instantiated when building as a
>> library. The fault was not corrected in the next few upgrades of
>> solaris, but we are talking 5 years ago now! Note this had nothing
>> to do with IDL, and if this is the fault you will not be able to
>> build C++ executables linked to the template libraries either. If
>> this is the case then maybe they never corrected it, I could dust
>> off the workaround I came up with.
>>
>> good luck
>>
>> Martin
>
> I don't know if this is related to your problems, but as a side note,
> the most intensive user of template libraries I know of is the Blitz++
> numerics library, which uses obscure (to me, anyway) template features
> to gain numerical speed while saving object orientation. They have a
> website: <http://www.oonumerics.org/blitz>, and they list the solaris
> compilers as being incompatible due to incomplete template
> implementation.
>
> A list of template-friendly compilers (but only skimpy discussion) is at
> <http://www.oonumerics.org/blitz/platforms/>.
>
> Best,
>
> Rich
|
|
|