[Top][All Lists]

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

Re: Problem compiling .cpp file

From: Marius Vollmer
Subject: Re: Problem compiling .cpp file
Date: 05 Nov 2002 22:07:23 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

jblazi <address@hidden> writes:

> test2.cpp: In function `void register_procs()':
> test2.cpp:12: invalid conversion from `
>    scm_unused_struct*(*)(scm_unused_struct*)' to `scm_unused_struct*(*)()'
> */

You need to use an explicit cast in C++:

    gh_new_procedure("test_function",(SCM (*)())test_function,1,0,0);

You also should not use SCM_INUM.  It does no error checking and works
only with 'fixnums' (small integers).  Use scm_num2int instead:

    SCM test_function(SCM n)
      printf ("Die Zahl ist %d\n", scm_num2int (n, 1, "test_function"));
      return SCM_EOL;

GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405

reply via email to

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