"unable to find utility g++" while trying to compile a MobileSubstrate tweak with Theos (OSX) - clang

OSX Yosemite 10.10.2
I recently installed Theos following this guide, got no problems. However when I try to compile a simple MS tweak, I get this error in Terminal.app:
MBP:noeditnc ned$ cd /Users/ned/noeditnc
MBP:noeditnc ned$ make
Making all for tweak NoEditNC...
Preprocessing Tweak.xm...
Compiling Tweak.xm (armv7)...
xcrun: error: unable to find utility "clang++", not a developer tool or in PATH
make[3]: *** [.theos/obj/armv7/Tweak.xm.5e67a2f0.o] Error 72
make[2]: *** [.theos/obj/armv7/NoEditNC.dylib] Error 2
make[1]: *** [internal-library-all_] Error 2
make: *** [NoEditNC.all.tweak.variables] Error 2
I have Command Line Tools and Xcode both installed and updated to the latest version. Google couldn't help... What am I doing wrong?
EDIT: Clang++ is installed.
MBP:noeditnc ned$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
EDIT 2: Found a solution! I had the wrong sdk version number in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ (iPhoneOS8.1 instead of iPhoneOS8.2)

Related

When trying to build Halide on Linux system with llvm-10.0 on release/10.x and master branches, facing the below issue

[ 53%] Linking CXX executable test_function_dag
/bin/ld: ../../libHalide.so.10.0.0: undefined reference to `typeinfo for llvm::SectionMemoryManager'
collect2: error: ld returned 1 exit status
make[2]: *** [src/autoschedulers/adams2019/CMakeFiles/test_function_dag.dir/build.make:134: src/autoschedulers/adams2019/test_function_dag] Error 1
make[1]: *** [CMakeFiles/Makefile2:2328: src/autoschedulers/adams2019/CMakeFiles/test_function_dag.dir/all] Error 2
make: *** [Makefile:182: all] Error 2
I'm using pre-built LLVM binaries and below cmake command to configure
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=/home/harry/llvm/lib/cmake/llvm ../
Any advice and suggestions will be greatly appreciated.
I cloned Halide from release/10.x, and compiled against the LLVM 10.0.0 binaries obtained here. On Ubuntu 20.04 LTS, I had to also apt install libtinfo5 because these binaries are built against old system libraries.
I noticed that the official binaries are not built with RTTI enabled (ugh) and was able to repro and fix. There's a bug in dependencies/llvm/CMakeLists.txt. Find the line that reads:
$<$<COMPILE_LANG_AND_ID:CXX,GCC,Clang,AppleClang>:-fno-rtti>)
and change GCC to GNU. We don't test with non-RTTI LLVM, which is why this wasn't caught.

Armadillo compiler error

I am using armadillo C++ library. I see below error when doing the compile. Does it require new version of GCC compiler I am having "gcc version 4.1.2" right now with my system
[ 50%] Building CXX object CMakeFiles/armadillo.dir/src/wrapper.cpp.o
In file included from /home/mukuar01/armadillo/armadillo-7.800.3/src/wrapper.cpp:29:
/home/mukuar01/armadillo/armadillo-7.800.3/tmp/include/armadillo_bits/compiler_setup.hpp:168:6: error: #error "*** Need a newer compiler ***"
make[2]: *** [CMakeFiles/armadillo.dir/src/wrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/armadillo.dir/all] Error 2
make: *** [all] Error 2
Yes, you do need a newer version of gcc. At least version 4.4.0 is required. You can check in the source code, line 167. Versions 4.7.0 and 4.7.1 are also not supported due to a bug.
You could try to use clang instead of gcc, but not sure which version is needed.
Or you could try with older versions of armadillo, but I am not sure how far you'd need to go back.

Compilation of OpenCV 3.1.0 videoio error

Im trying to compile Opencv 3.1.0 with MingW 4.9.2 but i have the follow error
modules\videoio\CMakeFiles\opencv_videoio.dir\build.make:187: recipe for target
'modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dshow.cpp.obj' failed
mingw32-make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dsho
w.cpp.obj] Error 1
CMakeFiles\Makefile2:4340: recipe for target 'modules/videoio/CMakeFiles/opencv_
videoio.dir/all' failed
mingw32-make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
makefile:159: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
I found that is a OpenCV build error during cap_dshow.cpp build. The solution showed here is no necessary because the file in Opencv 3.1 is already fixed.
During Cmake phase i've changed this (trough Cmake GUI 3.4.3), but doesnt work
CMAKE_BUILD_TYPE = Debug
WITH_EIGEN = 0
WITH_OPENGL = 0
WITH_IPP = 0
WITH_QT = 1
I've tried the solution given in this post, but doesnt work neither
add_extra_compiler_option(-Werror=non-virtual-dtor)
My intention is work with C++, Opencv and the GUI designer of QT. I have installed the library qt-5.4.0-x64-mingw492r0-sjlj, it comes with its own MingW 4.9.2.
(PS/for another proyect i've compiled Opencv3.1.0 with Mingw 4.9.3 and its works perfectly)
Can anybody helpme please!!!
In file %OPENCV_HOME%\sources\modules\videoio\src\cap_dshow.cpp
Add in top:
#define STRSAFE_NO_DEPRECATE
Work for me in Qt 5.6.2, Mingw 4.9.2 OpenCV 3.2.0

OpenCV installation issue on mac mavericks

So yesterday CleanMyMac destroyed some system files of mavericks, I repaired (reinstalled) mavericks and after that I got an error from Xcode that "assert.h" cannot be found. So I figured I install command line tools with "xcode-select --install" which I have no idea if it has solved my issue or not, and then I noticed all opencv libraries can not be found too.
I uninstalled OpenCV with "brew unisntall opencv"
I have been trying to reinstall it ever since but I had No luck.
Running "brew install opencv" tells me :
==> make
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.o] Error 1
1 error generated.
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2
Unfortunately I don't know what to do with this error,
I used cmake -j8 and I got:
[ 6%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/transupp.c.o
Linking C static library ../lib/liblibjpeg.a
[ 6%] Built target libjpeg
make: *** [all] Error 2
I tried what was my last hope, "sudo port install opencv" and I get :
Computing dependencies for opencvError: Unable to execute port: can't read "configure.cxx_stdlib": no such variable
I tried selfupdate for macports but it doesnt work either.
so now Im stuck does anybody have any idea? it would be much appreciated.
ps I have assigned my user as the owner of /usr/local just in case: "sudo chown -R $User /usr/local"
I finally fixed it,
my Xcode was 5.1 and I was trying to avoid the upgrade, but as I ran out of options, I updated to Xcode 6 and after that "brew update" found few updates and then "brew install opencv" worked like it should have done in the first place.

Theos problems with g++ darwin9

Hey guys im on ipad 2 3g ios 5.1.1
Anyway i tried compiling an app through theos and this is the problem
I find the helloworld directory with makefile and through terminal i type make
It says it's compiling but it then gives me this error
/bin/sh: /usr/bin/arm-apple-darwin9-g++: no such file ir directory
make [2] : *** [obj/main.mm.o] Error 127
make [1] : *** [internal-tool-all_] Error 2
make: *** [helloworld.all.tool.variables] Error 2
Using this theos template
Choose template: 4 (iphone/tool)
Project Name: helloworld
Package Name: com.memyself.helloworld
Author Maintainer Name: me myself
I get that its looking for arm-apple-darwin9-g++ in /usr/bin (i have arm-apple-darwin9-c++ in that directory)
But what is that and where do i get? Oh and what are those errors i dont get it at all help
Thats easy,
Download the libgcc package from here http://apt.saurik.com/cydia/debs/libgcc_4.2-20080410-1-6_iphoneos-arm.deb and then install it. After that install the GNU C Compiler from Cydia and remember to put the headers in the var/theos/include directory. Good luck!

Resources