comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » C/C++ conversion to IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
C/C++ conversion to IDL [message #44215] Sun, 29 May 2005 03:13 Go to next message
nasalmon is currently offline  nasalmon
Messages: 33
Registered: August 2003
Member
Would anybody know if there is there software available to convert
programs in C into IDL (i know you can link in C programs to running
under IDL)? However, i am more interested in getting shorter, more
transparent code which is easier to work with. I obviously want the
minimum of hassel in converting the C code into IDL, so i dont want to
trawl through this myself converting it.
Thank you,
Neil
Re: C/C++ conversion to IDL [message #44305 is a reply to message #44215] Tue, 07 June 2005 09:05 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Michael Wallace wrote:
>> Would there be any prefererence for C or C++, as i am not really that
>> familar with either and dont really have the time to learn one and
>> realise later that the other one is more appropriate?
>
> C++ is almost, but not quite, a superset of C. Because of this, I'd
> advise learning C first and then go on to learn C++ should you need to.
> The primary difference between the languages is that C++ supports
> object-oriented programming while C is procedural. If you won't be
> using objects, don't worry about learning C++ now. There are other
> differences between the languages, but none of those make a compelling
> case to learn C++ in this situation.

Most well-written C programs (for a particular definition of
"well-written") can be compiled as C++ programs without a change in
meaning. So in that sense C++ is "almost" a superset of C. However,
there's a great many features of C that are supported by C++, but
shouldn't be used when writing C++ code; C++ has much better ways of
doing the same thing. Learning how those features works is necessary
for a expert C++ programmer, but a bad idea for the novice; the novice
might make the mistake of actually using them.
Therefore, I'd recommend learning C++ first; learn C only if and when
you need it.
Re: C/C++ conversion to IDL [message #44320 is a reply to message #44215] Mon, 06 June 2005 10:25 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
> Basically i wanted to increase the speed of my IDL programs by calling
> certain time consuming modules compled in C or C++. I do a lot of
> calling of routines recursively and working with binary trees.

You'll want to get Ronn Kling's "Calling C from IDL" (which now includes
a chapter on C++). I have found this to be a great introduction to
creating .dlms in IDL. www.kilvarock.com (it is "unavailable" from
Amazon but hopefully Ronn still has copies)

Some good suggestions were given regarding a compiler. As for editors,
I like jEdit (www.jedit.org). It's an editor, not an IDE, but a fine
editor indeed.


> Would there be any prefererence for C or C++, as i am not really that
> familar with either and dont really have the time to learn one and
> realise later that the other one is more appropriate?

I would look for appropriate examples in both C/C++ and go from there.
For example, if you can find an implementation of you data structure in
C that gives you 90% of what you want then go with that code in C. Or
if you find some C++ code that is just what you want, then C++. This
isn't about learning a new language, it's about solving your problem
quickly. IMO.


-Rick
Re: C/C++ conversion to IDL [message #44324 is a reply to message #44215] Mon, 06 June 2005 09:06 Go to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> Would there be any prefererence for C or C++, as i am not really that
> familar with either and dont really have the time to learn one and
> realise later that the other one is more appropriate?

C++ is almost, but not quite, a superset of C. Because of this, I'd
advise learning C first and then go on to learn C++ should you need to.
The primary difference between the languages is that C++ supports
object-oriented programming while C is procedural. If you won't be
using objects, don't worry about learning C++ now. There are other
differences between the languages, but none of those make a compelling
case to learn C++ in this situation.

-Mike
Re: C/C++ conversion to IDL [message #44325 is a reply to message #44215] Mon, 06 June 2005 08:53 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
I have never gotten the gnu compiler to work with IDL despite hard trying so
I went to M$ C. However, in the meantime there is a techtip on the RSI
website to get it working with cygwin version of gcc. Give that a shot.

Haje


<nasalmon@onetel.net.uk> wrote in message
news:1118070782.438499.233390@o13g2000cwo.googlegroups.com.. .
> Just searching for a free C / C++ compiler, are there any that anyone
> could recommend that might work well under Windows XP and enabling
> calling object files from and interfacing with IDL? Might it even be
> possible to run / comple C / C++ from with inside IDL using the IDL
> editor?
>
> Free compilers i heard about are DJGPP, GNU, Borland and Dev-C++, would
> any of these be suitable or preferable?
>
> Cheers,
> Neil
>
Re: C/C++ conversion to IDL [message #44326 is a reply to message #44215] Mon, 06 June 2005 08:53 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
On Mon, 06 Jun 2005 08:13:02 -0700, nasalmon wrote:

> Just searching for a free C / C++ compiler, are there any that anyone
> could recommend that might work well under Windows XP and enabling
> calling object files from and interfacing with IDL? Might it even be
> possible to run / comple C / C++ from with inside IDL using the IDL
> editor?
>
> Free compilers i heard about are DJGPP, GNU, Borland and Dev-C++, would
> any of these be suitable or preferable?

I have not actually tried it (yet), but this looks promising:

http://msdn.microsoft.com/visualc/vctoolkit2003/

You can probably use IDL's MAKE_DLL procedure and this compiler to build
your C/C++ code from "inside IDL". And I suppose that you could use IDL's
editor as well, but if you are going to do a lot of C code, you would want
to use emacs or something with more C language syntax support.

Karl
Re: C/C++ conversion to IDL [message #44327 is a reply to message #44215] Mon, 06 June 2005 08:13 Go to previous message
nasalmon is currently offline  nasalmon
Messages: 33
Registered: August 2003
Member
Just searching for a free C / C++ compiler, are there any that anyone
could recommend that might work well under Windows XP and enabling
calling object files from and interfacing with IDL? Might it even be
possible to run / comple C / C++ from with inside IDL using the IDL
editor?

Free compilers i heard about are DJGPP, GNU, Borland and Dev-C++, would
any of these be suitable or preferable?

Cheers,
Neil
Re: C/C++ conversion to IDL [message #44333 is a reply to message #44215] Mon, 06 June 2005 02:43 Go to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
For simple routines: Use C.
Learning C++ takes longer (learning C++ includes learning (most of)
C).
C++ would be the better choice if you expect your programs to get
complex.

just my 2 cent,
marc
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CALL_EXTERNAL in idl virtual machine
Next Topic: delete variable name from memory

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:40:01 PDT 2025

Total time taken to generate the page: 0.00652 seconds