GHUnit/GHTestApp.h: No such file or directory - xcode

I'm very new to objective-c, xcode, and mac development in general (I
come from a java development background). I'm attempting to integrate
GHUnit into xcode to write some simple unit tests for an objective-c/
cocoa project I've recently been tasked with.
I've attempted to follow the directions here :
http://gabriel.github.com/gh-unit/_installing.html for:
Installing (Mac OS X)
-- Installing in /Library/Frameworks.
I'm working with xcode 3.1.3 running under Mac OS 10.5.8
I have created the new Target "Tests", and Link Binary With Libraries
shows the GHUnit.Framework.
I've added the GHUnitTestMain.m to the project as the directions
describe. However, I get "error: GHUnit/GHTestApp.h: No such file or
directory" for the #import
I looked for this header file in the framework and I don't see it
included. #import is not causing any errors, and I
DO see this file in the framework directories.
Is the downloaded framework and the GHUnitTestMain.m out-of-synch with
each other? or have I missed something in the configuration?
As another note, in the directions:
"If your main target is an application, you will need to include these
source files in the Test project manually."
I don't understand what action is required from this statement. I
have no idea if it's related to my current compilation error.
Thanks for any help in sorting this out.

Make sure you downloaded the OS X version of GHUnit. The github page lists a few downloads for iOS aswell. At the time GHUnit-0.4.26.zip is the latest OS X version.

I encountered the same problem.
You might add the test class to the main application target. Uncheck the target and then, the error "GHUnit/GHUnit.h file not found" disappeared.

Related

XCode doesn't archive unity build

I am trying to push a unity app to the app store (this is a first for me).
Unity builds the project fine, however when I import it in XCode, Archiving or building doesn't work.
The problem occurs when precompiling Prefix.pch
I need to use the geolocalization of the device in order to run my app.
I think that is what creates the framework related issues I am getting (it seems that the errors are in the APK and not in my code).
There files that are giving me errors are located in ios15.5>Frameworks>CoreLocation
I suppose CoreLocation is not imported ?
I did however try to Embed the CoreLocation framework in the Targets>General Tab like so but I have no idea if that is the way to do it:
I am definitely missing something but I don't know what to do at this point.
I am trying to do this using a mac mini with Monterrey OS, XCode 13.4, unity 2021.3.7.
My target os is iOS14.
If someone could give me some advice it would be greatly appreciated !
It seems this question was already answered here:
In the files generated by the unity builds, in
Libraries>Plugins>iOS>NAtiveToolkit
there are files named Locale.h and locale.mm that are conflicting with the Locale.h file of the project.
Renaming them to LocaleTools.h and LocaleTools.mm seemed to do the trick

AudioKit 4.11.2 Playgrounds: "No such module AudioKitPlaygrounds"

It has been a year since updating so I downloaded AudioKit 4.11.2 yesterday. I built all of the frameworks, including the AudioKit and AudioKitUI xcframeworks.
Then I began playing with the Playgrounds. Right away Xcode tells me the build failed because it can't find the AudioKit frameworks. It appears that the Search Paths that are set in the original project file need tweaking so I set it to "$(inherited)../Frameworks".
Now it builds but still will not run, saying on the import AudioKitPlaygrounds statement that there is No such module AudioKitPlaygrounds.
Odd, because that is the target of the build and it exists in the Derived Data Products folder.
Searching through StackOverflow shows that AudioKit has had similar problems like this in the past but none of the proposed solutions seemed relevant to my situation.
What other tricks are necessary to get the Playgrounds running? Shouldn't it build and run straight out of the box without messing with the project search paths?
My environment is:
macOS 10.15.6
MacBookPro
Xcode 12.0.1
I ran through a similar problem with macOS 10.15.7, XCode 12.1 and AudioKit 4.11.2.
I got the same “No such module AudioKitPlaygrounds” message.
The "Build Active Scheme" option was unchecked in my File Inspector >> Playground Settings, so I checked it, rebuild the "Introduction and Hello World" .playground and it worked.
Edit (04/15/2021): David Thery gave a more complete answer in the following answers.
Also, make sure to:
run 'pod install' + automatically converting to swift5 in XCode
check "Build Active Scheme" as mentioned by Miguel FOR EACH single playgrounds you want to run.
run the playground with the play button in the editor, not the xcode main run button
If you want instead to use AudioKit in another XCode project, only two steps:
download AudioKit and AudioKitUI frameworks from here:
embed them in General > Frameworks, Libraries, and Embedded content, as shown on the screenshot below.
How did you build the frameworks? The assumption when it comes to the paths in other projects (including Playgrounds) is that they have been built via the build_frameworks.sh and build_xcframework.sh scripts in the Frameworks directory.
The end result should be a set of XCFrameworks in that same Frameworks directory, which is in turn referenced by examples and the playgrounds project.
To anyone still experiencing this issue, I just found a really simple solution. I was opening my playground files directly from 'Open Recent'. Problem is, Xcode doesn't automatically look at the parent directory and included files. Just close Xcode and open the AudioKitPlaygrounds.xcodeproj from finder. When you open your playground files from there they should work properly.

Compiling Xcode project from zipped open-source GitHub download

Possibly basic question but I'm not sure where to begin for an answer. I am very much a newbie to Xcode, Cocoa, Swift and Objective-C.
I'm interested in developing an open-source Markdown editor for the Mac that will build from existing open-source code. I have gone to GitHub to download the source code for two existing projects, MacDown and WriteDown! For both projects I download the project .zip file (and am happy that the button to do so is now easily available), and extract the .zip file's contents on my hard drive. In each project there is an .xcodeproj file which I open up in Xcode... and I see tons of errors, mostly because of things that are missing, so I cannot build and run them.
With WriteDown I see "missing base SDK" (and get a corresponding error when I try to run it), and many other files missing (frameworks, products, and "pods"). With MacDown I get a lot of errors mentioning missing pod files.
If it were just the one project that gave me errors I would assume this was something specific to that project, but since they're both giving me errors it sure seems like I'm doing something wrong in general. Should I be downloading something other than the downloadable zip? Downloading extra frameworks? Taking an extra step in between?
I am using Xcode 6.1.1 on OS X 10.9.5, which MacDown seems to indicate it's compatible with.
Few things:
1) If an .xcworkspace is available, you should open that in lieu of the .xcproj. The workspace contains multiple projects that are important for the building of the application.
2)
Check out this answer for "Missing Base SDK" XCODE Base SDK Missing
3) Go to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs and check to make sure you have the proper system SDKs available
4) It looks like those projects also require CocoaPods, a OS X Dependency Manager. You need to download the "pods" AKA 3rd party dependencies in order to build the application

Bundle can't find copied framework from XCode

I have an XCode project which copies SDL.framework to my app bundle and, up until recently, this worked fine. I could give my bundle to someone who didn't have SDL.framework and it would work. But yesterday a friend of mine said my app was crashing because it couldn't find SDL.framework. I removed SDL.framework from my /Library/Frameworks folder to test it on my machine and he's right. Even though SDL.framework exists in my bundle the app still crashes because it can't find it.
Why would this be? The only thing I can think of is that the last time I did a working build was on MacOS 10.6 and using XCode 3. I'm now on 10.7. I've tested a new build with XCode 3 and XCode 4 but both produce the problem listed above.
I had this happen to me the other day when I was building a tool for sending Email. I was linking against the Pantomime framekwork. Here are the settings that I had to set in order for it to start working and stop crashing with "could not find library" You can see where I have the framework in relation to the project files / workspace files.

Adding a Library to your build and link path in XCode

I am tryingo to build a GUI application using the JUCE framework on MAC OSX.
I have dowloaded all the API's and got a small hello World program running fine.
However, when I add files to my Xcode project I get compilation errors that say that the Juce library files don`t exist. I would like to know how to get the library API in the build and link path in XCode so that it finds the neccesary files for compilation.
What I would do on Visual Studio going to properties and adding aditional library dependencies, is what I need to do in XCode but I don't know how.
Any help greatly appreciated.
thanks.
Old question but maybe a useful answer in the future....
If you have the "Hello World" up and runnning, it should already be linked to the library. Are you using the introjucer? This should help get everything up and running for you. If you are, you need to add classes etc to the introjucer, as this sets up Xcode / VStudio for you. If not, (Presuming XCode 3 as you are using leopard) goto Xcode > Preferences. Scroll along to source trees, and add the path to the juce folder in there.

Resources