Xcode - No such module after importing framework - swift3

I have imported a framework to using Xcode 9 Swift 3
The code works well as long as I build the project for simulator devices
However as soon as I select Gereric iOS Devices so I can Archive my project I get this error
Can someone please help on what I can do to fix this issue?

Make sure to add this framework in Binary.
Go to -> Target project -> Genral -> Embeded Binary.
Hope it works!

If it is not the (possibly Framework) top-level modulemap file, ensure that the module map file is named exactly module.modulemap.
(Whereas the top-level module map for export should be named something other than module.modulemap.)

Related

Xcode can't find files that exist (using c++ fopen)

I've been running into this strange problem lately where in my Cocoa app project in Xcode I get the error that the file was not found when using "fopen" (errno 2), called from a C++ file. I made sure to copy these files into the project's directory, then I dragged them from the Finder directory into the Xcode project tree. And finally, in the scheme's options I checked "use custom directory" and entered the directory where I have the project and all the files. The programme builds fine, but during runtime I get a BAD ACCESS error and I can see that my FILE* variable is still NULL. The command that throws the exception is actually "fread" two lines later, but it's only because "fopen" didn't do its job.
This whole setup has worked fine before in pure C++ projects. But this is different because it started as a Cocoa app in Objective-C (because I intended to use C++ for the programme's main logic). At some point I also had to change the extensions of all the ".m" files to ".mm" or the compiler wouldn't even find the C++ standard library! (but this is probably beside the point)
So the question is.. what else do I need to check in order to have the programme find the files I'm trying to open?
NOTE: the backbone of the project is written in C++, and I'm only using Cocoa in order to be able to dram images on the screen, so if anyone has a better approach to including graphics in a C++ project I'm all ears.
Thanks for reading
EDIT: I'm using Xcode 12.4 and Catalina 10.15.7
Cocoa apps do not work with files the same way as command-line C++ apps. Cocoa apps create an app bundle, which is where the files you want to read should be. If you have files you want to read in a Cocoa app, add them to the project. When you add the files to the project, they will get copied to the app bundle. Make sure they are in the app target's Copy Bundle Resources build phase.
Use the methods in the Bundle class to locate the files instead of fopen. The following Swift code locates a file named "MyFile.txt" in the main app bundle:
let mainBundle = Bundle.main
let fileURL = mainBundle.url(forResource: "MyFile", withExtension: "txt")

Using QtTest inside a Library project

I'm confused on how I'm supposed to use the QtTest FrameWork inside a Library project (Windows). I have created a library project and added some tests, but I had a lot of issues trying to run the tests. The key to solve my problem was to set:
TEMPLATE = app
However, I'm making a lib... also app makes an exe, not a dll. I really hope that it's not intent to have to change the project file manually to 'app' when testing and changing to 'lib' for actual building the library. This seems unproductive.
So, what's up with QtTests inside library projects?
Thanks

NSCameraUsageDescription needed for C++ projects in Xcode for MacOS Mojave

I am trying to run OpenCV projects in Xcode and it seems like there's a new need to provide an info.plist for C++ applications NSCameraUsageDescription.
2018-09-28 00:03:15.181948+0800 k_nearest_detector_v2[23505:710470] [access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
Program ended with exit code: 9
How do I go about creating a .plist file for a C++ project as it has never been needed before.
Found a solution. Put the file with the desired NSCameraUsageDescription, NSMicrophoneUsageDescription (or others) with the assembled file from XCode (See screen shots below). For the Release and Debug versions.
You can even automate the steps described by #Valery Gromov. Just copy the file in the Build Phases. Uncheck the Copy only when installing checkbox to be able to run it directly from Xcode.

Apple Mach-O Linker Error Using JUCE And Heavy-Compiler

I am currently writing a super basic plugin using the JUCE framework and C code generated from a the Heavy Pure Data Online Compiler. The source code builds fine, however no standalone application, AudioUnit or VST are created by Xcode. My guess is that the project is not setup properly to use the included code, however I am still learning my way around Xcode and can't seem to work out what the problem is to fix the below errors. Any suggestions on how I can fix this?
Edit: Finally started using git and uploaded the project to GitHub here.
The projucer file you included is missing the heavy source folder. Add them in projucer on the left side in the file explorer area (right click in the file area on source and choose add existing files...
Hint the save and open in ide icon on top of the window
and there you go ... no linker error.
tested with XCode 8.3.3
Two remarks:
Never add files anywhere else than in projucer
You canĀ“t use XCode 9 beta with JUCE

Cocos2d-x C++ Error when I try to build macOS Version

We develop an app, in ios version an works fine. But when we change to MacOS appear this error: Cannot initialize object parameter of type cocos2d::Layer.
I think that this isn't the real error. Because in IOS versions works.
I think that could be something about linked libraries, but we don't found it.
Someone can help me?
Make sure all your custom class cpp files also target desktop. you have the option to do this when you add a new file into the project. If you are not sure wheter if your custom class files targeting desktop, you can check it by looking at Target Membership section of the Utilities. make sure that both the mobile and desktop targets are ticked in order to target both.