Build error when trying to compile Chess.app - xcode

I have downloaded Chess.app from opensource.apple.com. When I run xcodebuild install I get an error:
fatal error: 'CoreFoundation/CFLogUtilities.h' file not found
#import <CoreFoundation/CFLogUtilities.h>
^ 1 error generated.
The same error occurs when Building within XCode.
I have looked in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/ and, sure enough, CFLogUtilities.h is not present. I see that it's available to download from Apple's Open Source Website, but I feel like if it's linked in an app bundled with the OS, it should be installed by default, or at least after installing XCode + Command Line Tools.
Do I have to manually download and bundle the header file in order to build the project, or am I missing something?

I don't know what OS version you are using, but to compile this on 10.9 simply change CFLogUtilities.h to CoreFoundation.h.
you also either need to build the CrashReporterClient.a library and add it to the project, or remove it from the "link with libraries" build setting for the target.
a shell script will fail because iconcompiler is missing, but you can comment out that script line with a # and run just fine. I will leave it as an exercise to you to figure out how best to restore the app icon.

Related

Can't compile App from Titanium Appcelerator with iOS OpenCV Module

I have an issue that is going on for over a month and I can't find any solution for it.
I created an Appcelerator Titanium Module, which uses the OpenCV framework.
I tried literally everything I found on the internet to make it work, but no sucess.
The module compiles, but it crashes when building the App that uses it.
To dig deep in the problem, I compile the App via CLI using appc run -p ios -l trace to see the whole thing. This is what I get:
[TRACE] ld: framework not found opencv2 [TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation)
This happens if I declare the framework in the module.xconfig file, like this:
OTHER_LDFLAGS=$(inherited) -framework opencv2
If I don't declare it in the file, I get:
[TRACE] symbols not found for architecture x86_64 [TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation)
Well, the opencv2.framework file is inside the /ios folder in the module.
This is what I tried so far, to put the OpenCV Framework in the project:
OpenCV Official Example for XCode
Compiling it from scratch and then adding to the Project
brew install opencv and then adding it to the project
I configured Framework Search Paths like this:
$(inherited) $(PROJECT_DIR) $(SRCROOT)
Header Search Paths like this:
$(inherited) "$(TITANIUM_SDK)/iphone/include" /usr/local/Cellar/opencv/4.4.0/include (this last one, when installed by brew CLI command.
The Other Linker Flags, is configured like this:
This configuration I got from this tutorial: OpenCV on XCode
And finally, I tried adding the .dylib files from the source of the OpenCV Framework in the project by right-clicking the project's name and Add Files.
So, I tried everything I could find to solve it, but I can't get it to work.
Sorry for the long question, but I am completly out of ideas on how to make this work.
Please, help me!
First of all, the opencv2.framework is copied automatically to the XCode /ios folder (if you selected Copy Files if Needed). BUT, Appcelerator needs 3rd party frameworks to be put on /ios/platform folder. So, I moved it there.
Secondly I added -lz to the Other Linker Flags in Build Settings.
This solved the problem. I must thank the team and developers from TiSlack (An Appcelerator platform community), which helped me through this. Michael and Hans, Thanks!
Here is a video that helped me install OpenCV4 on my Macbook Pro Mojave 10.14.6. I tried installing OpenCV using another video and it led me to getting a linker error that was similar to yours.
Basically, the problem was the path I specified as for my /lib and /include folders.
https://www.youtube.com/watch?edufilter=NULL&v=HxNZEa7Slyk

How do I Compile a Framework in Xcode?

Ever since I switched to Yosemite, I have been getting an Xcode quit unexpectedly error whenever I try to run SDL2. I can't even get a "hello world" to run.
I am trying the fix it by following the directions on this page:
Xcode 5 crashes when running an app with SDL 2
But I don't know how to "Compile the "Framework" target in Xcode/SDL/SDL.xcodeproj" I tried just simply building it but that doesn't seem to work because I don't see any framework file showing up.
Can someone help me figure out how to get rid of this error?
I assume you have got the latest version of the code either by doing hg clone http://hg.libsdl.org/SDL or by downloading the latest snapshot from https://www.libsdl.org/hg.php
This should give you a directory called SDL which contains the source and all of the projects. You will want to open 'Xcode/SDL/SDL.xcodeproj'
Then ensure the following is set as your build target - Framework > My Mac (64-bit) You can change it by clicking on it.
Then hit CMD+B (or select Product->Build from the menu) to build the framework. You will then be able to find the SDL2.framework in the following location:
/Users/*yourusername*/Library/Developer/Xcode/DerivedData/SDL2-*randomstring*/Build/Products/<*Debug/Release*>
Copy the framework to /Library/Frameworks

Library not found OpenCV

I'm on mac 10.7.5, using xcode 4.6.2 and working with the OpenCV 2.4.3 library. I went through the process of making the build directory with the cmake files in terminal and did the download.
I added the .dylib files in Xcode and changed the header path, changed C++ Library to libstdc++, but when I compiled I got this error :
ld: library not found for -lopencv_calib3d.2.4.3
clang: error: linker command failed with exit code 1
I have libopencv_calib3d.2.4.3.dylib added in the project so I have no idea what else it needs.Any ideas?
If your "make back-end" is Cmake you should stick to using it. Local config changes in Xcode can "secretly" be overwritten when the cmake is rerun (which for example happens after you make changes to it) creating weird build errors and forcing you to remember all the manual changes you made.
Your problem seems to be that the generated project doesn't seem to know where to look for opencv.
Assuming you installed opencv using macports you should add a line saying
link_directories(/opt/local/lib)
to your CMakeLists.txt. (if you installed it using brew, or compiled it manually just replace /opt/local/lib for /usr/local/lib or the path to your compiled libraries)
Also make sure to link against opencv_calib3d instead of opencv_calib3d.2.4.3 (unless you have a very particular reason for bypassing this, but that usually means that something else is weird in the setup :) )
Final pointer that you might already know of: As you are already using Cmake you should add the libraries to link against using TARGET_LINK_LIBRARIES(...) in Cmake rather than manually adding them in Xcode (referring to my previous argument).

Cannot compile Qt address book example on OSX

I have the sample address book project loaded up and it is failing to compile on OSX 10.6.8. Here is the output I am getting:
No valid Qt version set. Set one in Preferences
Error while building project part1
When executing build step ‘QMake’
Canceled build.
I click on the Projects tab on the left and I scroll to the “General” section, and I click on “Show Details”. I see the “Qt Version” is set to “Default Qt Version (Qt in PATH)”. I click on the manage button and it shows me that the version it is using is in /usr/bin/qmake. So I got to the terminal and I type “/usr/bin/qmake” and I get the help output. What am I missing?
Edit: Some additional details:
I can use the terminal in the project's root directory to run the command 'qmake part1.pro -spec macx-g++ -r' which is defined under the Projects tab in Qt Creator. It produces no output, which leads me to believe it worked correctly.
I then run the listed make command which is 'make -w'. I receive:
make: /Developer/Tools/Qt/uic: No such file or directory
make: *** [ui_addressbook.h] Error 1
make: Leaving directory `/Users/jsmaupin/part1'
When I check, the Qt directory does not exist under /Developer/Tools. However, there is a directory at /Users/[user directory]/QtSDK, but it does not contain anything named 'uic'.
I know I asked this a long time ago, but I saw this on my profile and I just wanted to post what my solution was. The problem stemmed from the Qt installation. There was an error dialog which I had ignored.
Qt requires XCode's command line tools in order to install on the Mac. If you open XCode and go to Xcode > Preferences > Downloads > Components, you'll find a list of installable packages. Click install on Command Line Tools and let it install.
Then, try to install Qt once more. It should work without any problems.

Added Mac target to iOS project in Xcode, now 'Error Starting Executable File'

I've decided to make a Mac OSX port of my iOS app, so based on a number of suggestions I've received I've simply added a new Cocoa target to my iOS project, and set up a series of 'libraries' (which encapsulate the core business logic of my app) which I have added to the OSX target. I have not added all of the UIViewController code to the OSX target - I will have to rewrite the UI code, for obvious reasons. The app is building fine (no compiler errors for missing libraries, etc.), but for some reason I get the following error message when I try to run the 'hello world' program, which I'd like to get working before I start coding in earnest. Here's the message:
Error Starting Executable 'MyExecutableMac'
No executable file found.
Use "file" or "exec-file" command.
As per this SO question, I made sure that the proper executable file was listed under the scheme build settings, so that it will actually run. However it actually appears that the .app file is not being packaged properly - the .app file is stil listed as "red" in the file list, meaning the file is missing. What might be causing this error?
I had this problem in Xcode 4.2, I found that first doing a clean (Xcode > Product > Clean and option clicking Product > Clean Build Folder…) fixed it.

Resources