I have the following file:

#include <guile/gh.h>
#include <stdio.h>

SCM test_function(SCM n)
{
  printf("Die Zahl ist %d\n",SCM_INUM(n));
  return SCM_EOL;
}

void register_procs(void)
{
    gh_new_procedure("test_function",test_function,1,0,0);
}


void inner_main(int argc, char **argv)
{
    register_procs();
    gh_repl(argc, argv);
}

main(int argc,char *argv[])
{
    gh_enter(argc, argv, inner_main);
    return(0); /* never reached */
}

I am compiling the file with
 gcc -Iusr/include test2.c -o test2 -lguile -lm

This more or less works (it does not work really as I get error messages when 
I call the function test_function from Guile, but at least after the first 
call the text is displayed.)

But when I try to compile the same file as a .cpp file, it does not work:

Administrator@PAPUA-8ZRG78JQB ~/c-programme
$ mv test2.c test2.cpp

Administrator@PAPUA-8ZRG78JQB ~/c-programme
$ gcc -Iusr/include test2.cpp -o test2 -lguile -lm
test2.cpp: In function `void register_procs()':
test2.cpp:12: invalid conversion from `
   scm_unused_struct*(*)(scm_unused_struct*)' to `scm_unused_struct*(*)()'
*/

I use the latest Cygwin (with gcc 3.2) on Win2K.

Can anybody help me?

TIA,
-- 
Janos Blazi



_______________________________________________
Bug-guile mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-guile

Reply via email to