How to compile C code with cpp-lib plugin?


(Vladimir Šor) #1

To compile a pure C code on a MacOS X with g++ version 4.2.1 I have to specify ‘-x c’ argument

to switch g++ in C mode (gcc, as opposed to g++, can figure that out by itself btw) as a first argument.

Cpp-lib plugin generates a file called build/compileWork/main/compiler-options.txt

which contains some basic arguments including sources and everything I specify in the spec is appended to the end of command. So ‘-x c’ gets to g++ after input arguments which doesn’t work.

What other options do I have to compile pure C code for JNI?


(Luke Daley) #2

Hi Vladimir,

This is a shortcoming of the current native code support. There’s currently no way to specify to compile with GCC in C mode.