.c works but .cpp doesnt??
BlitzMax Forums/BlitzMax Programming/.c works but .cpp doesnt??| 
 | ||
| i tried to do a hello world in C++ which worked when the file was called keefy.c but didnt work when it was called keefy.cpp it said 'undefined reference to Say' here are the sources: keefy.cpp 
#include <stdio.h>
void Say(char *str)
{
printf(str);
}
keefy.c 
#include <stdio.h>
void Say(char *str)
{
printf(str);
}testc.bmx 
Import "keefy.cpp"
Extern
Function Say(str:Byte Ptr)
EndExtern
Say ("hello".toCstring())
 | 
| 
 | ||
| "void Say(char *str)" try "void Say(const char* str)" | 
| 
 | ||
| Try this #include <stdio.h>
extern "C" void Say(char *str); // It says this somewhere in the BlitzMAX Docs about using the extern keyword with c++
void Say(char *str)
{
printf(str);
} | 
| 
 | ||
| oh yeah it was extern "C" thanks how do you do it 'the other way around'? I want to call a blitz function in a .cpp file it works in C but not in CPP | 
| 
 | ||
| Look in the bmax generated assembly file for the properly named function. | 
| 
 | ||
| i got it to work now thanks | 
| 
 | ||
| Don't mix C++ and Blitz on your own if you can avoid it. It will give you a headache. | 
| 
 | ||
|  Don't mix C++ and Blitz on your own if you can avoid it. It will give you a headache.  How so? | 
| 
 | ||
| I'm not talking about wrapping useful C++ code to be used in Blitz :P |