bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem compiling .cpp file


From: jblazi
Subject: Problem compiling .cpp file
Date: Tue, 5 Nov 2002 17:41:06 +0100

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:

address@hidden ~/c-programme
$ mv test2.c test2.cpp

address@hidden ~/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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]