Clion and CMake fail after updating to xcode 8 - xcode

I get the following error after updating to xcode 8 and I'm not sure how to fix.
Error:The C compiler "/usr/bin/cc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/username/Library/Caches/CLion2016.2/cmake/generated/CacheBack-27c25a9c/27c25a9c/__default__/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_e91e5/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_e91e5.dir/build.make CMakeFiles/cmTC_e91e5.dir/build
Building C object CMakeFiles/cmTC_e91e5.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_e91e5.dir/testCCompiler.c.o -c /Users/username/Library/Caches/CLion2016.2/cmake/generated/CacheBack-27c25a9c/27c25a9c/__default__/CMakeFiles/CMakeTmp/testCCompiler.c
cc: error: unable to find utility "clang", not a developer tool or in PATH
make[1]: *** [CMakeFiles/cmTC_e91e5.dir/testCCompiler.c.o] Error 72
make: *** [cmTC_e91e5/fast] Error 2
CMake will not be able to correctly generate this project.

Please check
xcode-select -p, make sure it points to Xcode 8 installation and run xcode-select --install after that.

I had to accept the license dialog after starting Xcode to get the updated components. After that I restarted Clion and it worked.

Related

OCaml: How do I compile/make a program which has file extensions .ml.x?

I have downloaded a project which contains the following files:
assert.mli
assert.ml
deque.ml
deque.mli
eventloop.ml
eventloop.mli
g.ml
gctx.ml
gctx.mli
gdemo.html
gdemo.ml
gdemo.mli
g-js.ml.x
g-native.ml.x
lightbulb.html
lightbulb.ml
lightbulb.mli
Makefile
paint.html
paint.ml
paint.mli
widget.ml
widget.mli
widgetTest.ml
widgetTest.mli
I can compile some of the files that do not depend on other files by doing
$ ocamlc assert.mli assert.ml
for instance. However, eventloop.ml depends on widget.ml and widget.ml depends on gctx.ml. gctx seems to depend on a module G which I believe is a graphics library. When I peek inside g-js.ml.x I see it confirmed that this file is importing a fixed version of the graphics library. However, I have no clue how to use this file. I tried a few guesses in the terminal but to no avail. One example guess was
$ ocamlc g-js.ml.x g.ml
I tried googling "how to compile ocaml ".ml.x"" but didn't come up with anything and I'm not sure if I should be searching for anything else, or if there just isn't much out there about how to handle these files.
I also tried in the terminal $ make -f Makefile and got the error
+ ocamlfind ocamldep -package js_of_ocaml-lwt.graphics -package js_of_ocaml-lwt -package js_of_ocaml -modules gdemo.mli > gdemo.mli.depends
ocamlfind: Package `js_of_ocaml-lwt.graphics' not found
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
Makefile:51: recipe for target 'gdemo.byte' failed
make: *** [gdemo.byte] Error 10
Looking up this error, other people found it fixed by updating OPAM's libraries and especially updating cppo_ocamlbuild but that didn't fix it for me.
Edit: After following some instructions in the comments, I get a new error message when trying to make the Makefile:
rm -rf g.ml
cp g-js.ml.x g.ml
ocamlbuild -use-ocamlfind -pkg js_of_ocaml -pkg js_of_ocaml-lwt -pkg js_of_ocaml-lwt.graphics gdemo.byte
Failure: ocamlfind not found on path, but -no-ocamlfind not used.
Compilation unsuccessful after building 0 targets (0 cached) in 00:00:00.
Makefile:51: recipe for target 'gdemo.byte' failed
make: *** [gdemo.byte] Error 2

MinGW gcc isn't able to compile a simple test program(same with cygwin) in CLion

I've just installed CLion and i needed compiler. I installed Cygwin.
But there was an error:
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
CMake Error: Error executing cmake::LoadCache(). Aborting.
Error code: 1
So, CMake was "bundled" and i tried to install it from site. But there was the next error:
Selected CMake might be incompatible with the Cygwin environment.
In order to run on Cygwin, CMake needs to be specially compiled.
Please select either CMake bundled with CLion or CMake from the Cygwin installation.
CMake Error: The source directory "/cygdrive/c/Users/Пользователь/AppData/Local/Temp/cmake_check_environment" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Error code: 1
Then i've tried to install MinGW - this time it was the following problem:
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: D:/MinGW/mingw64/bin/gcc.exe
-- Check for working C compiler: D:/MinGW/mingw64/bin/gcc.exe -- broken
CMake Error at D:/CLion 182.2574.4/bin/cmake/share/cmake-3.11/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"D:/MinGW/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Пользователь/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp
Run Build Command:"D:/MinGW/mingw64/bin/mingw32-make.exe" "cmTC_a4ce5/fast"
D:/MinGW/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_a4ce5.dir\build.make CMakeFiles/cmTC_a4ce5.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/╧юы№чютрЄхы№/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a4ce5.dir/testCCompiler.c.obj
D:\MinGW\mingw64\bin\gcc.exe -o CMakeFiles\cmTC_a4ce5.dir\testCCompiler.c.obj -c C:\Users\╨Я╨╛╨╗╤М╨╖╨╛╨▓╨░╤В╨╡╨╗╤М\AppData\Local\Temp\cmake_check_environment\_build\CMakeFiles\CMakeTmp\testCCompiler.c
gcc.exe: error: C:\Users\╨Я╨╛╨╗╤М╨╖╨╛╨▓╨░╤В╨╡╨╗╤М\AppData\Local\Temp\cmake_check_environment\_build\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
mingw32-make.exe[1]: *** [CMakeFiles\cmTC_a4ce5.dir\build.make:65: CMakeFiles/cmTC_a4ce5.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/╧юы№чютрЄхы№/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp'
mingw32-make.exe: *** [Makefile:125: cmTC_a4ce5/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Пользователь/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Пользователь/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeError.log".
Error code: 1
In both cases it's problems with paths, i think. I tried to give root to CLion, gcc, etc. - nothing.
I've tried to find logs or just way to this path - but all was worthless - path doesn't exist.I just can't find out, why that's happening.
Help me, please
Looks like there is a problem with encodings somewhere between windows/cygwin/clion/cmake (I assume you user name is non-ascii).
As a quick workaround try:
installing CLion in the location without non-latin symbols
changing CLion's system and config folders to the location without non-latin symbols. instructions
And to troubleshoot the problem, could you please check if the cygwin's console shows the user home path correctly? (e.g. use ls /cygdrive/c/Users/, then cd to the user home path).
If Cygwin can correctly work with the user home, could you please file a bug report and attach CLion's log files? (Help | Show Log in Explorer)

Xcode project built - Permission denied

I built an Xcode project from CMake and when I attempt to build it I get the following error.
PhaseScriptExecution CMake\ Rules /Users/LaserTech/NewBuild/Myjob2/NameCreate.build/Debug/lsjob2.build/Script-E70CB352E1334BCA9B8BE7C1.sh
cd /Users/LaserTech/NameCreate-OSG-Qt5
/bin/sh -c /Users/LaserTech/NewBuild/Myjob2/NameCreate.build/Debug/Myjob2.build/Script-E70CB352E1334BCA9B8BE7C1.sh
make: *** No rule to make target `/Users/LaserTech/NameCreate-OSG-Qt5/Myjob2/PROTOBUF_PROTOC_EXECUTABLE-NOTFOUND', needed by `/Users/LaserTech/NewBuild/Myjob2/common.pb.cc'. Stop.
Command /bin/sh failed with exit code 2
I am not sure what this means. I would appreciate it if someone could shine some light onto what I should be looking at ?
Update:
I did have thoses packages installed. I needed to simply add the path to the binaries to the environment variable. However now xcode is giving me this
echo "Running C++ protocol buffer compiler on protocol/common.proto"
Running C++ protocol buffer compiler on protocol/common.proto
/Users/..../cmake/osxbuild/Release --cpp_out /Users/..../Myjob2 -I /Users/.../Myjob2/protocol /Users/../Myjob2/protocol/common.proto
make: /Users/.../protobuf/cmake/osxbuild/Release: Permission denied
make: *** [/Users/../NewBuild/Myjob2/common.pb.cc] Error 1

Xcode "make" error

Since I updated to Xcode 7.2 I always get the following error when I try to compile a program using the make command:
iMac-de-Martin:~ Martin$ cd /Users/Martin/Desktop/iOS_OTA-Payload_Extractor-master
iMac-de-Martin:iOS_OTA-Payload_Extractor-master Martin$ make
make: error: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild didn't return any data
make: error: unable to find utility "make", not a developer tool or in PATH
iMac-de-Martin:iOS_OTA-Payload_Extractor-master Martin$
I tried to reinstall the Command Line Tools but it didn't help.

Cutecom installation fails on OSX Mavericks

I'm trying to install cutecom on OSX Mavericks but I'm getting some erros.
Here are the steps that I followed.
install qt through brew
brew install qt
update path on .bashprofile
export PATH=/usr/local/Cellar/qt/4.8.6/bin:$PATH
extract files of cutecom
compile source code of cutecom
$ mkdir build
$ cd build
$ cmake ..
$ make
And the output of make is:
[ 20%] Generating ui_cutecommdlg.h
/Users/kc/Downloads/cutecom-0.22.0/cutecommdlg.ui: Warning: The form file has external pixmaps or qPixmapFromMimeSource() set as a pixmap function. This requires Qt 3 support, which is disabled. The resulting code will not compile.
[ 40%] Generating moc_qcppdialogimpl.cxx Scanning dependencies of target cutecom
[ 60%] Building CXX object CMakeFiles/cutecom.dir/main.cpp.o
In file included from /Users/kc/Downloads/cutecom-0.22.0/main.cpp:21:
In file included from /Users/kc/Downloads/cutecom-0.22.0/qcppdialogimpl.h:22:
/Users/kc/Downloads/cutecom-0.22.0/build/ui_cutecommdlg.h:12:10: fatal error:
'Qt3Support/Q3MimeSourceFactory' file not found
#include <Qt3Support/Q3MimeSourceFactory>
^
1 error generated.
make[2]: *** [CMakeFiles/cutecom.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/cutecom.dir/all] Error 2
make: *** [all] Error 2
Any suggestions ?
Thank you very much for your time.
Kostas.
The Qt package you have is missing Qt3Support (on purpose). This component is necessarily for some Qt4 software that still uses deprecated features dating back to Qt3.
Based on the documentation I've been able to find online, you should be able to reinstall Qt4 with the extras you need using a command like this:
brew install --with-qt3support qt

Resources