This looks like a classic case of not reading the manual, and then compounding 
it by not reading the posting guide. The manual would be the "Writing R 
Extensions" pdf that comes with R or you can google it. The posting guide is 
referenced at the bottom of this and every other posting on this mailing list.
There are nearly an infinite variety of errors that can lead to a "crash", so 
it is really unreasonable of you to pose this question this way and expect 
constructive assistance.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnew...@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Grigory Alexandrovich <alexandrov...@mathematik.uni-marburg.de> wrote:

Hello,

I wrote a function in C, which works fine if called from the 
main-function in C.

But as soon as I try to call this function from R like .C('foo', 
as.double(x), as.integer(y)), the programm crashes.

I created a dll with the cmd command R --arch x64 CMD SHLIB foo.c and 
loaded it into R with dyn.load().

What can be the cause of such behaviour?
Again, the C-funcion itself works, but not if called from R.

Thanks
Grigory Alexandrovich

_____________________________________________

R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to