Running C++ in Eclipse on MacOS - eclipse

I am using Eclipse IDE for C/C++ Developer on Mac OS Sierra 10.12.6. When I build a project (HelloWorld Project) I see a message:
"xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
"make clean" terminated with exit code 1. Build might be incomplete.
22:30:31 Build Finished. 0 errors, 0 warnings. (took 74ms)"
And I can't run the program

... three years later ...
Try installing the Xcode command-line tools by running xcode-select --install.

Related

.Net7 MAUI app unable to debug/publish with iOS16/Xcode 14

I can debug on MyMac (Mac Catalyst) no problem but not on the simulator, I get the following errors in the Application Output:
xcodebuild[4480:64944] Writing error result bundle to /var/folders/wh/z7x5swm90fb6f6cxfp39760h0000gn/T/ResultBundle_2022-30-10_10-46-0020.xcresult
xcodebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" cannot be located.
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find simctl 2> /dev/null' failed with exit code 16384: (null) (errno=Invalid argument)
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
I'm using VS17.4 (preview 5 I think, how do I check? It just says 17.4 build 2339) and Xcode 14 for the iOS 16 SDK. I've checked in Preferences > SDK Locations > Apple and everything looks as it should... I'm a Mac noob so is there just a setting I'm missing somewhere?
If I try to build the release for publish like so VisualStudio crashes!
dotnet publish -f:net7.0-ios -c:Release
Update:
I just dropped back to net6.0 and am getting the same error. I didn't have Xamarin.Mac installed but installing it made no difference.
Below are some more component details of VS:
Xamarin.iOS Version: 16.0.0.72 (Visual Studio Community)
Xcode 14.0.1 (21336)
Xamarin.Mac Version: 8.12.0.2 (Visual Studio Community)
I can also see that the directory referenced does exist, or is it not supposed to look like that?
I had two version of Xcode installed which seems to have confused things. Uninstalling both then reinstalling 14 has fixed the issue.

Xcode 13.2 command PhaseScriptExecution failed with a nonzero exit code

While building my project, I get this error:
line 2: /usr/local/bin/carthage: No such file or directory. Command PhaseScriptExecution failed with a nonzero exit code
Tried so many methods to resolve this issue, including switching Xcode versions.
It's worth to mention that it only occurs on an M1 Mac device which I'm currently using, same project without changing any part of the configurations works on an Intel Mac.
The project is using Carthage, which is likely installed using Homebrew. On M1 Macs, Homebrew links its binaries into /opt/homebrew/bin while on Intel Macs, they are linked into /usr/local/bin.
This means that on an M1 Mac, Carthage is probably found at /opt/homebrew/bin/cartage.
Your build script should use something like $(which carthage) or simply carthage instead of relying on an absolute installation path.
I had a similar error. My issue was that I didn't have a ~/.bash_profile. Creating an empty file fixed the error

Command Line Tool - Error - xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH

I am getting this error while building the SwiftJSON framework to the Some Xcode project through Carthage Dependency Manager.
Sivaramaiahs-Mac-mini:GZipDemoApp vsoftMacmini5$ carthage update
--platform iOS
*** Fetching GzipSwift
*** Fetching SwiftyJSON
*** Checking out GzipSwift at "3.1.1"
*** Downloading SwiftyJSON.framework binary at "3.1.3"
*** xcodebuild output can be found in /var/folders/7m/y0r2mdhn0f16zz1nlt34ypzr0000gn/T/carthage-xcodebuild.apLXCc.log
A shell task (/usr/bin/xcrun xcodebuild -project
/Users/vsoftMacmini5/Desktop/GZipDemoApp/Carthage/Checkouts/GzipSwift/Gzip.xcodeproj
CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list)
failed with exit code 72:
xcrun: error: unable to find utility "xcodebuild", not a developer
tool or in PATH
I solved that problem by setting the Command Line Tools in Xcode. Go to:
Xcode > Preferences > Locations
And select the command line tool from the dropdown. If you have only one version of Xcode installed, there should be only one option. If you have several versions of Xcode, then you must choose the one you need.
Update (added image for reference)
The simplest fix is from CLI:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
(this should be path to your Xcode.app)
By the way this can happen even if you have only one version of Xcode . It happens when you instal homebrew before the first Xcode installation (which makes sense because you may want to install Xcode through mas install 497799835 and mas needs homebrew).
Following command worked for me
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

launch failed . binary not found in eclipse europa

*** Internal Builder is used for build ****
g++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\first.o ..\src\first.cpp
Internal Builder: Exec error:Launching failed
Build error occurred, build is stopped
Time consumed: 62 ms.
I am getting the above error in eclipse console when I tried to build my first "hello world" CPP program. Below are the steps I followed.
Installed Eclipse Europa.
Installed MinGW.
Open Eclipse goto window->preferences->c/C++->NEW CDT project wizard-> changed the Tool chain as "MinGW GCC".
When I opened the eclipse workspace manually there is no exe generated for the program.
My PATH variable in the project properties has "C:\MinGW" as value.
I searched much in net and still this "Launch Failed No Binaries" did not go off.
Please help...
"Launch failed No Binaries" means the program is not compiled.So this is the problem
related with MinGW GCC.Check you gave all the environmental variables necessary for the MINGW
correctly.
MoreOver I Suggest CodeBlocks IDE as a replacement.It is much Better than eclipse for c++
The link is CodeBlocks Download Link

Nsight Eclipse Edition not finding nvcc

I just installed CUDA 5.0 Preview (Mac OS X Lion) and I'm having trouble with Nsight.
The toolkit seems to be installed correctly. (Driver loads, nvcc -V works in bash, samples work fine).
When I create a new project I get warnings:
Error launching external scanner info generator (nvcc -dryrun ...)
Program 'nvcc' is not found in $PATH
In Preferences -> CUDA Toolkit I get no CUDA-compatible devices detected. Which is strange because I have nVidia GT 650M on my machine. So why doesn't Nsight recognize it?
If I try to build a project I get 2 errors:
/bin/sh: nvcc: command not found
make: * [src/test.o] Error 127
How do you start Nsight? Do you use /usr/local/cuda/bin/nsight? Unfortunately, it is not currently possible to launch Nsight by double-clinking the application on Mac OS X.
In the CUDA 5.0 Preview build we had a bug when shell script did not properly setup paths. This is how this script looks like in latest internal toolkit builds (you may need to adjust paths depending on your toolkit install location - in the final release installer will handle it):
#!/bin/sh
PATH="$PATH:/Developer/NVIDIA/CUDA-5.0/bin" DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Developer/NVIDIA/CUDA-5.0/lib" "/Developer/NVIDIA/CUDA-5.0/libnsight/nsight.app/Contents/MacOS/nsight" $#