C functions in RB 
Author Message
 C functions in RB

Hi all,
In one of the programs I am currently writing it would be really handy
to use some functions I have previously written in C. These are
compiled pieces of code that I was previously using in a routine in R
(the GNU version of S+, in case you're wondering), but I have decided
to try and move the functionality from R to a standalone application.
Therefore my question is, is it possible to call functions written in
C from within RB?
Thanks, Jonck


Wed, 26 Oct 2005 09:25:37 GMT  
 C functions in RB

Quote:
> Hi all,
> In one of the programs I am currently writing it would be really handy to
> use some functions I have previously written in C. These are compiled
> pieces of code that I was previously using in a routine in R (the GNU
> version of S+, in case you're wondering), but I have decided to try and
> move the functionality from R to a standalone application. Therefore my
> question is, is it possible to call functions written in C from within RB?

Sure. Ways:

1. put them into a plugin.
2. put them into a CFM shared library or DLL.
3. put them into a framework.

1&2 requires Codewarrior.
3 requires Mac OS X and project builder and a plugin with something like
the SoftDeclareMBS class.

Mfg
Christian

--
Four thousand functions in one REALbasic plug-in. The MBS Plugin.

<http://www.monkeybreadsoftware.de/realbasic/plugins.html>



Wed, 26 Oct 2005 21:38:57 GMT  
 C functions in RB
Hi Christian,
Thanks for your reply. I don't have CodeWarrior so I guess that leaves
me with option 3.

I have never made a framework before in my life so I'm a bit mystified
by the process of how one would go about doing this.

Is it difficult? Does it require a lot of time? Is it also possible to
re-use old fortran functions using this method?

Thanks very much, Jonck

Quote:


> > Hi all,
> > In one of the programs I am currently writing it would be really handy to
> > use some functions I have previously written in C. These are compiled
> > pieces of code that I was previously using in a routine in R (the GNU
> > version of S+, in case you're wondering), but I have decided to try and
> > move the functionality from R to a standalone application. Therefore my
> > question is, is it possible to call functions written in C from within RB?

> Sure. Ways:

> 1. put them into a plugin.
> 2. put them into a CFM shared library or DLL.
> 3. put them into a framework.

> 1&2 requires Codewarrior.
> 3 requires Mac OS X and project builder and a plugin with something like
> the SoftDeclareMBS class.

> Mfg
> Christian



Fri, 28 Oct 2005 19:04:21 GMT  
 C functions in RB
Hi,
Ok, I answered some of my own questions already. It seems that
ProjectBuilder is able to compile fortran files. Also I've found a
.pdf on the Internet that shows how to make a framework so I'm going
to give that a try.

That still leaves me the problem of the plugin, what do I need that
for? Also, another question, using a framework probably means that the
new compiled app will only run under OS X, correct? Is there a way to
make it compatible with Windows or would that mean me having to use
one of the first two options Christian gave me?
Thanks, Jonck


Quote:
> Hi Christian,
> Thanks for your reply. I don't have CodeWarrior so I guess that leaves
> me with option 3.

> I have never made a framework before in my life so I'm a bit mystified
> by the process of how one would go about doing this.

> Is it difficult? Does it require a lot of time? Is it also possible to
> re-use old Fortran functions using this method?

> Thanks very much, Jonck



> > > Hi all,
> > > In one of the programs I am currently writing it would be really handy to
> > > use some functions I have previously written in C. These are compiled
> > > pieces of code that I was previously using in a routine in R (the GNU
> > > version of S+, in case you're wondering), but I have decided to try and
> > > move the functionality from R to a standalone application. Therefore my
> > > question is, is it possible to call functions written in C from within RB?

> > Sure. Ways:

> > 1. put them into a plugin.
> > 2. put them into a CFM shared library or DLL.
> > 3. put them into a framework.

> > 1&2 requires Codewarrior.
> > 3 requires Mac OS X and project builder and a plugin with something like
> > the SoftDeclareMBS class.

> > Mfg
> > Christian



Sat, 29 Oct 2005 18:59:07 GMT  
 C functions in RB
Hmmm... I guess I spoke too soon, it appears it is NOT possible to use
Fortran code in Project Builder. Does anyone have any suggestions
about how to incorporate my Fortran code into a RealBasic project?

Thanks very much, Jonck


Quote:
> Hi Christian,
> Thanks for your reply. I don't have CodeWarrior so I guess that leaves
> me with option 3.

> I have never made a framework before in my life so I'm a bit mystified
> by the process of how one would go about doing this.

> Is it difficult? Does it require a lot of time? Is it also possible to
> re-use old Fortran functions using this method?

> Thanks very much, Jonck



> > > Hi all,
> > > In one of the programs I am currently writing it would be really handy to
> > > use some functions I have previously written in C. These are compiled
> > > pieces of code that I was previously using in a routine in R (the GNU
> > > version of S+, in case you're wondering), but I have decided to try and
> > > move the functionality from R to a standalone application. Therefore my
> > > question is, is it possible to call functions written in C from within RB?

> > Sure. Ways:

> > 1. put them into a plugin.
> > 2. put them into a CFM shared library or DLL.
> > 3. put them into a framework.

> > 1&2 requires Codewarrior.
> > 3 requires Mac OS X and project builder and a plugin with something like
> > the SoftDeclareMBS class.

> > Mfg
> > Christian



Sat, 29 Oct 2005 19:53:36 GMT  
 C functions in RB

Quote:
>Hmmm... I guess I spoke too soon, it appears it is NOT possible to use
>Fortran code in Project Builder. Does anyone have any suggestions
>about how to incorporate my Fortran code into a RealBasic project?

Perhaps, by compiling it with the terminal (with f77 or f90, I just
use Fortran once on a Sun). Insert the executable in a package and run
it with the shell class.

--
Frdric Testuz



Sat, 29 Oct 2005 21:14:56 GMT  
 C functions in RB
Good suggestion, I had thought of this as well but the problem is that
I don't know how to make a UNIX application that accepts arguments and
returns values with Fortran. I guess there are no shortcuts... <sigh>
I'll have to leap in and figure these things out. Problem is, that if
I start investing much time in such things, I might as well translate
the functions from C and Fortran to RB and be done with all these
hassles. I was hoping to save some time by not having to translate the
old functions and simply re-using them someway. But it seems like my
recycling attempts will end up costing just as much time and result in
a very sketchy solution.
Too bad, thanks for your comments though guys,
Jonck
Quote:


> >Hmmm... I guess I spoke too soon, it appears it is NOT possible to use
> >Fortran code in Project Builder. Does anyone have any suggestions
> >about how to incorporate my Fortran code into a RealBasic project?

> Perhaps, by compiling it with the terminal (with f77 or f90, I just
> use Fortran once on a Sun). Insert the executable in a package and run
> it with the shell class.



Sun, 30 Oct 2005 00:38:27 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. to CS: or not to CS: in F-PC assembler

2. need OCR function in RB

3. Odd and Even functions missing in RB

4. Help rewriting a C function in RB

5. RB QuickStart Guider from RB

6. launching an RB app from another RB app - appleevents

7. RB Entwickler gesucht / RB Developers wanted

8. RB: row order by RB database

9. protocol.rb http.rb 1.1.24

10. replace setup.rb/install.rb with builtin module

11. install.rb/setup.rb question

12. Bugs corrected in DBD/ODBC/ODBC.rb and DBD/Proxy/Proxy.rb

 

 
Powered by phpBB® Forum Software