I've created a static library C++ project but when I compile I get the following error:
XCode 4.1 (Lion) doesn't show me any more information what's going wrong. I'm using clang.
How can I find out what went wrong?
I have read elsewhere, and confirmed myself, that the problem is that Xcode is suppressing the output from stdout.
As a work around, in Xcode, flip open the display of the commands being executed and copy and paste them into a Terminal session and run lib tool from there.
Related
I am getting the error with leveldb while running the following.
./rebar3 shell
The dependency {eleveldb, "2.2.20"} compiled fine for me when I executed $ rebar3 shell on Mac OSX 10.13.6.
Your error message says that you should upgrade rebar3. Did you do that?
Finally, don't ever post screen shots of your output--instead post the output itself. Presumably, you know how to copy and paste text.
I used to use the Terminal to compile C-programs written in Xcode so far(it is so much easier..). Now i would like to use the debugger as well.
I found this manual http://classes.engr.oregonstate.edu/eecs/winter2017/cs261-001/Resources/XcodeTutorial.pdf and am trying to act exactly how it suggests.
However, every time i tried to press the 'build' button i got this error:
Command /usr/bin/make failed with exit code 2
The only posts i find regarding this are
Using CocoaPods stops iOS build using ionic Project (as it concerns cocoapods i guess that plugin is not helpful.)
These guys had a similar problem..
/usr/bin/make failed with exit code 2 but i do not get the solution in the last post.
If you know what the error wants to tell..please translate it for me.
I realise that this is no programming but rather an i_am_lost_with_Xcode question. Please help though by sending a link to another manual or giving me a hint how to just compile with Xcode.
Well..it worked out. I created a new project and chose as a template OS X>Application>Command Line Tool. I am not sure how but it builds fine now.
As you can see near the screenshot Logs infos pic, the .sh Script can run normal inside terminal, but failed to run via Xcode custom behavior, Is there missing some configuration? I've Googled a lot of infos. still can't solve it. I really need someone's help. Thanks
XCode version: Version 8.3.2 (8E2002)
Add a New Run Script Phase in your projects Build Phases to run a Shell script. You do not need to open -a Terminal:
Update:
How I understand your comment, your actual question is how to get the Xcode project directory. Xcode provides a enviromental variable for this, ${PROJECT_DIR}:
prints:
You can find a list of Xcodes enviromental variables in this repo and helpful information in Apples documentation.
I'm trying to make an OSX bundle using CMake/CPack on OSX that involves OpenCV and Qt (although I don't think those dependencies matter at this point). Everything compiles and the bundle is created fine, and I have a script that modifies the necessary library paths such the executable I'm making works if I run it from the Terminal within the bundle. The problem I'm having is if I try to run the MyApp.app file via the open command or by simply double clicking the app it gives me the error:
LSOpenURLsWithRole() failed with error -10810 for the file /Applications/
I've seen other solutions to other LSOpenURLsWithRole() errors involving modifying permissions, but that hasn't helped me. Also, this error code is an "unknown error" so I'm not sure how to proceed.
The solution for this ended up being that the libcocoa.dylib library was not finding the requisite libraries. See Building OSX App Bundle for a thorough answer on the subject. otool -L is your best friend.
I'm working on a project in Xamarin.iOS, and it happens to go through a build server (running on a Mac).
The build seems to commonly fail, but even with the --verbose or -v it seems to Silently fail. For example, right now, it seems to fail after optimizing the graphics for iOS. The last line of the build says Build complete -- 0 errors, 0 warnings. But then I get a Build step 'Execute shell' marked build as failure from Jenkins. I know that this is a failure in the mdtool build, because I have had a successful build before, and I know there are several more steps before it actually succeeds.
The next step in the successful process should be Compiling to native code, but for some reason it fails before getting to that, or at least outputting it to the console.
Thanks in advance for the help!
There's a few places in the mdtool build logic that didn't properly catch exceptions when executing shell programs which I (hopefully) fixed for Xamarin Studio 4.0.2.
Without seeing the full build log it's hard to say for sure, but it might be that whatever shell command that it is trying to execute either doesn't exist or isn't marked with execute permissions.
The programs that I can think of off the top of my head that mdtool will invoke for the iOS builds are:
pngcrush (optimizes .png files)
plutil (optimizes .plist and .strings files)
codesign (although this one gets called after compiling to native code)
and of course, mtouch which is what is used to compile IL to native code. The mtouch command is part of Xamarin.iOS while the other 3 utilities are part of Mac OS X (or Xcode).
The solution for the other person with a similar problem that I helped debug a week or 2 ago was because he had modified his PATH environment that launchd launched apps with to not include /usr/bin and so mdtool couldn't find the utility programs listed above.
I'm not very familiar with Jenkins (I know we use it at Xamarin, but I'm not part of the team that does), so make sure that the PATH environment that it launches mdtool under is setup to include /usr/bin.
Hope that helps.