[okl4-developer] iguana cc
Ben Leslie
benno at ok-labs.com
Mon May 28 11:09:01 EST 2007
On Fri May 25, 2007 at 04:54:20 -0400, Jorge Torres wrote:
>Hi okl4.org,
>
>I tried to change the example/manyelfsegs/src/main.c to main.cc, and I had
>some linking problems with stdio.h, does someone knows what is the correct
>way of doing this (iguana style :), my temporal solution was:
>-----
>at this new example/manyelfsegs/src/main.cc
>#define CTOCPP extern "C"
>#include <stdio.h>
>------
>and at libs/c/include/stdio.h
>#ifndef CTOCPP
>#define CTOCPP
>#endif
>.
>.
>CTOPCPP int printf(const char *, ...);
>------
Hi Jorge,
We don't really have a C++ runtime, but, if you are trying to use the
C library runtime, within a C++ program you should wrap the include
within an extern C block, e.g:
"""
extern C {
#include <stdio.h>
}
"""
More information about the Developer
mailing list