> By the way, if I have some C files and some C++ files. How can I put
them together in a project?
> Should I just name them with .cpp extension?

If you want to mix languages, just use C as normal, but for the C++
files, use a prototype that has extern "C" before the functions, for
example


foo.c:     int foo(int x, int y) { ..... }

bar.cpp:   extern "C" int foo(int x, int y);   void bar() { foo(1, 2); }

The 'extern "C"' on the prototype tells C++ that the external function
was compiled in C, so it doesn't have parameter information encoded in
its name.  This will make C++ generate a reference to just the function
name, not an expanded name that includes type information.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to