I’m not new to Gradle, but am new to building C++ in Gradle.
I’ve tried several examples in the “gradle-native-samples” project on github and get this error:
“fatal error: ‘iostream’ file not found”
I believe that Gradle is launching the clang compiler without specifying the standard includes, so I’m stumbling around trying to add the includes as part of the “cppCompiler.args”, but without success thus far.
I’m working on Mac OS X 10.13 and XCode 9.
I’ll add more if I figure this out, but any suggestions would be helpful…
Oh, and if you can provide a build scan, we could see a bunch of information that would help us debug this issue further. If not, could you run Gradle with the -s argument and paste the stack trace in here?
My Java is:
java -version
java version “1.8.0_121”
Java™ SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot™ 64-Bit Server VM (build 25.121-b13, mixed mode)
I just deleted and tried again from scratch. Here are the steps I took:
You should see a line (among a lot of output) that contains org.gradle.process.internal.DefaultExecHandle and shows the entire command-line used for invoking clang. Of special interest will be the path to the options.txt file which contains the command-line options passed to clang.
Also, if you could upload a buildscan, it would be pretty easy to troubleshoot remotely.
I haven’t actually upgraded to High Sierra yet, so I’m not sure if something might have moved.
Ah, thanks for pointing out what to look for. The “options.txt” tip was what lead me in the right direction.
The problem was that I had previously built clang++ from source. Gradle was using that. I removed the custom clang++ from the path and everything works fine.