Quote:
/* ScriptParser.cpp*/
#include <string>
#include <cstdio>
#include "ScriptParser.h"
extern "C" {
#include "tiny_scheme_interpreter.h"
}
bool ScriptParser::init(string initFile) {
FILE *fscript;
printf("Initializing TinyScheme...");
scheme_init(&sc);
puts("Done");
...
}
|
Code:
/* tiny_scheme_interpreter.h */
...
int scheme_init(scheme *sc);
...
Code:
/* tiny_scheme_interpreter.c */
...
int scheme_init(scheme *sc) {
return scheme_init_custom_alloc(sc,malloc,free);
}
...
I checked the build properties and found that .c and .cpp files are compiled with the same flags but a different variable/macro is used (%ccompilerprefix% and %cppcompilerprefix%) in the command.
Code:
echo "building $@";%ccompilerprefix% $(TOOL_PATH)ccppc %DebugModeFlags% %ToolFlags% $(ADDED_CFLAGS) %Includes% $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o %OutFile% -c %InFile%
$(CC_ARCH_SPEC) -ansi -Wall -MD -MP -mlongcall
Code:
echo "building $@";%cppcompilerprefix% $(TOOL_PATH)ccppc %DebugModeFlags% %ToolFlags% $(ADDED_CFLAGS) %Includes% $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o %OutFile% -c %InFile%
$(CC_ARCH_SPEC) -ansi -Wall -MD -MP -mlongcall
I checked the console output and the function definitely seemed mangled...any ideas on howto change compilation to C?