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.
Related
I'm having an issue where I can run and use a compiled version of my project on my computer, but the moment i put the release onto another computer to run it pops up with a console for a split second saying it can't open System.Data.Common. I'm using .Net Version 4.7.2 and this is installed exactly the same on my other computer. I've even tried install VS on that one to compile the program from source code and it still doesn't work. I've checked the file it is getting the System.Data.Common.dll from and it is there and installed in the correct folder. I've tried removing it from the project through the project file and config file and I still get the same thing. It just seems to be the one dependency it is messing up for. I don't have a direct screen shot of the error since it is on another computer I was testing for but it just says that error and then says line 9 of login.cpp and that is just opening the form. Although System.Data is a necessary package for my project (since I need Data Tables), I do not use anything from System.Data.Common so if there is a way i can get it to not be considered on compilation other than the methods I've already tried, that will work too.
I have tried to remove the dependency from the vcxproj file and vcxproj.filters file. This did not work. I tried reinstalling .Net 4.7.2 on the computer I wanted to install it on. I've also tried removing the dependency from the exe.config file and none of these have worked. My last resort it to just straight up copy and paste all the code into a fresh project and keep going until I get the same error.
I just installed Qt creator (for the 10th time probably), and even when I follow the simple steps to create a new Qt Widget or Qt Console applications, I get this error. Extremely frustrated with various Qt Creator bugs. Help will be appreciate.
If you look closely at your workspace, you can see, that there are two projects. One project is called Sample, one project is called Widget. The active project is "Sample". You can tell that from the project browser as the Sample project is in bold letters. So building and debugging applies only to the Sample project.
The open file where you set your breakpoints in is "Widget/main.cpp", it belongs to the other non-active "Widget" project. So when you start the debugger, the environment warns you that this will not work. Completely correct behaviour.
Maybe try the following:
1- Ensure case sensitive typing of the file name and type the full path not just the name.
2- Delete configuration files that are automatically created.
3- Make sure the QT environment is setup correctly pointing to the required compilers, packages and resources.
4- Check if there are any missing environment variables on your machine.
The problem could be in the .pro
Check that you have the file into the source in the .pro
I am building a C++ OpenGL card game in Xcode 4.3.3, with the intention of running it on both 64-bit and 32-bit Macs, which is not my problem. My problem is that I have reached a point in the development of the program where I would like to test that it works on a different 32-bit Mac (mine is 64-bit) without having to install Xcode. This, obviously, requires me exporting it as an .app. I can find and run the exported Unix Executable File from my project, after some cd'ing, through Terminal, but that is undesirable for me and the intended audience of the program. I have trawled the google and Stack Overflow, looking for anything to help me, but all the things mentioning Archiving seem to have been unsuccessful with my particular project, and I think that's because it's a C++ command line tool project. So, can someone please help me export my project as a .app?
Thanks in advance.
The simplest way of doing this would be to create a Cocoa project, go to 'build phases' and remove all the objective-c frameworks from the 'link with libraries' build phase, remove any objective-c files added by the template (app delegate, etc.) and then replace main.c with your main.cpp file.
There's nothing really special about a Cocoa project except for the fact that it links against Cocoa and calls NSApplicationMain() from its main() function.
There are also a bunch of .plist entries used by Cocoa which you'll no longer need. But they won't affect the way OS X treats your application.
I'm searching for an XCode Settings solution but here's my current way to create an app:
You have to take your binary file (let say myapp) and put it in "MyApp.app/Contents/MacOS/myapp" then it can now be launched as a .app. That's a trick.
Just go to the targets folder in the file navigator on the left, and there will be an executable listed there. Left click on that executable and click "show in finder". (I'm describing from memory so I may have the exact details wrong.) The file path is ridiculously long (there is an arbitrary alphanumerical pathname involved, I have no idea why), so you probably won't be able to find it with the command line.
If you want you can change the extension of the file from nothing to ".app", it shouldn't affect the nature of the file at all. Also if you want a custom icon, you can "get info" on it in the finder, then click on the icon in the info window, and use Cmd-V to paste it in (obviously you have to have your icon copied to the clipboard). There is also a way to do this inside of Xcode, but I don't remember it.
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
I'm new to wxWidgets. I'm using Code::Blocks (MSW compiler), version wxWidgets-3.0.2 on Windows 7.
I started learning this, but I got stuck when I found out that I couldn't develop a good looking wxButton when I write the codes myself without using wxSmith.
All I get as output are flat wxButtons and toolbars that look like buttons. I thaught it was my fault, then I created a little frame with wxButton in it, then compiled. The output suits my taste.
I copied the exact code for this little frame and created another project file without wxSmith and I pasted them in their corresponding file. When I compile this same code, all I get is a flat wxButton.
If I hover the mouse over it, it won't turn blue as it does in wxSmith compiled code. I also noticed that anything, e.g, toolBars that is likely to be clickable, will look flat, but not menus.
What am I missing?
It seems like you need to add the manifest to your application. The manifest is the thing that describes your application needs to system: what visual style you want to use, which OS are your app compatible with, etc.
The most simple way to do it with wxWidgets is to add a resource file (*.rc) to your project (or if you already have one then edit the one you have) and put this line of code there:
#include "wx/msw/wx.rc"
You may need to change the path to wx.rc file depending on your project settings. File location is:
<wxWidgets directory>\include\wx\msw\wx.rc
wx.rc will include correct manifest based on your build type:
x86 -> "wx/msw/wx.manifest"
x64 -> "wx/msw/amd64.manifest"
ia64 -> "wx/msw/ia64.manifest"
If you don't want to use wxWidgets default manifest files, then you need to:
create a file name your_app_name.exe.manifest (or your_dll_name.dll.manifest) and fill it manually (you can find description of application manifests and an example here: MSDN: Application Manifests (Windows);
place this manifest file in the folder with your executable file (just to be clear, if your app name is MyCoolApp.exe, then manifest must be named MyCoolApp.exe.manifest) or embed manifest into executable with mt.exe tool (mt.exe is shipped with Visual Studio, you can find the tutorial on how to use it to work with manifests here: MSDN: How to: Embed a Manifest Inside a C/C++ Application.