I am new to iOS programming, recently I am working on a framework project. I am using iOS 8.4 SDK before, I use this project to generate framework for iOS device and simulator, then use some script to merge them into one framework.
My build settings:
architecture: Standard architecture; i386
Valid architecture: armv7; arm64; i386
However, when I update iOS SDK to 9.0, there are some errors shown there. It used to build successfully in iOS 8.4.
It shows
1./Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/sys/cdefs.h:707:2: Unsupported architecture
2./Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/machine/_types.h:34:2: Architecture not supported
3./Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/sys/_types.h:55:9: Unknown type name '__int64_t'
4./Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/sys/_types.h:56:9: Unknown type name '__int32_t'
.............and lots of similiar __int43/64_t
5./Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/sys/_types/_intptr_t.h:30:9: Unknown type name '__darwin_intptr_t'
6./Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:10: Could not build module 'Darwin'
If I remove i386 from architectures, several errors will be gone. Also, if I change Apple LLVM 7.0 - Language - Modules: Enable Modules (C and Object-C) from yes to no, the module problem will be fixed. I can build the framework correctly.
However, when I use this framework in my framework test app, which used to work before as well. It will have some error:
Undefined symbols for architecture x86_64.
Can someone explain to me what happened with the iOS update? How can I generate the correct framework I can use as SDK in another project.
With iOS SDK 12.1, I received same error. The reason was when compiling with CMake I changed target architecture from x86_64 to arm64 but did not clean up build folder. After cleaning
/Users/yourname/Library/Developer/Xcode/DerivedData and re-running CMake everything worked.
Related
I have Qt 5.5.1 custom build (cross compiled on x86 for ARM development). So the project is building on x86 host and then deployed to Jetson TK1 development board.
I have the error:
Project ERROR: Unknown module(s) in QT: serialport
I can see build library: /home/alan/work/qt/qt-everywhere-opensource-src-5.5.1/qtserialport/lib/libQt5SerialPort.so.5.5.1, source and header files for QtSerialPort module in qt build directory. So I think the module is build but not properly installed. Never deal with custom Qt modules so how to check if module build and installed correctly?
Update: Qt was build but was not installed into OS (Qt Creator allows to use such builds to creating kits).
Modules only available after install. Another option - link module as separate library.
I'm trying to use the Canon EDSDK (latest version, v3.6 as of writing) in a simple, C++, command-line program on macOS (Sierra 10.12.6). I wish to utilize a simple Makefile environment and the usual apple compiler tools (llvm-clang) and avoid Xcode or any other heavy-weight IDE. The samples included with the SDK are all Xcode centric so I've had to roll my own here.
At present, I am able to compile a program to init the SDK and list connected cameras. As soon as I execute any EDSDK command however, I am getting a dynamic linking error:
Error loading /Library/Frameworks/EDSDK.framework/Versions/A/DppCore.bundle/Contents/PlugIns/DppCoreG.bundle/Contents/MacOS/DppCoreG: dlopen(/Library/Frameworks/EDSDK.framework/Versions/A/DppCore.bundle/Contents/PlugIns/DppCoreG.bundle/Contents/MacOS/DppCoreG, 262): no suitable image found
Did find: ... snip ... mach-o, but wrong architecture
The same error lists twice (both for DppCoreG). Upon examination, DppCoreG is compiled for 64bit architecture:
file /Library/Frameworks/..snip../DppCoreG
/Library/Frameworks/..snip../DppCoreG: Mach-O 64-bit bundle x86_64
However, there are other critical parts of the EDSDK that are compiled for 32bit architecture only:
file /...snip.../DPP.framework/DPP
/...snip.../DPP.framework/DPP: Mach-O dynamically linked shared library i386
How do I resolve this? The path of least resistance so far is to compile to i386 architecture explicitly (and the documentation explicitly states EDSDK is not 64-bit compatible). All is well except this one dynamic linking error (and in fact everything I've tried so far, which is just listing connected cameras, seems to work okay) but it is something I'm sure I can't continue to ignore or allow to persist in a production version of this project.
Here's a minimal example to cause the DYLD error:
#include <EDSDK.h>
#include <EDSDKTypes.h>
#include <EDSDKErrors.h>
int main(int argc, char** argv) {
EdsInitializeSDK();
EdsTerminateSDK();
return 0;
}
And probably more informative is the command to compile:
c++ -D __MACOS__ -g -arch i386 -I./deps/mac/include -framework DPP -framework EDSDK -o min min.cpp
I have the headers in the local include directory shown in the command and the frameworks installed under /Library/Frameworks.
Note that the c++ command is Apple LLVM version 8.1.0 (clang-802.0.42)
I've concluded that this is just an error on the part of those that deliver the EDSDK for mac. They should be compiling this particular bundle as a universal binary, not a 64bit binary. You can work around the problem by simply removing the offending bundle. It appears to just be a plugin and removing it does not seem to immediately affect the SDK. Assuming you have installed the EDSDK framework in /Library/Frameworks then just do this:
sudo rm -rf /Library/Frameworks/EDSDK.framework/Versions/Current/DppCore.bundle/Contents/PlugIns/DppCoreG.bundle
Enter your password when prompted (this assumes you are an admin account) and it will delete the offending plugin.
I have to believe that there may be consequences for removing this plugin at some point and if anyone knows more about this particular bundle/plugin and can explain what removing it will do I'd appreciate the additional insight.
In addition to #OllieBrown answer, I found in Xcode building for MacOS I had an additional item to remove to stop the link warnings.
link warning- EDSDK.framework/Versions/Current/DPPLibCom.bundle/Contents/MacOS/DPPLibCom: mach-o, but wrong architecture
removing EDSDK.framework/Versions/Current/DppLibCom.bundle stopped the warning.
Since the 3.x version there is a split between intergrated versions of DPP RAW capabilities. The original DPP works in x86 mode only and allows inspection and conversion of CR2 files on cams up until a certain models. See the API doc for the list. For recent camera models which rely on the new 64bit DPP engine (v4+?, dppcoreg) you would need x86_64 bit build so it dynamically links to use the latest features. Quite some (Raw) features are dropped, and gradually make their way back in in beta state.
I am currently trying to port an android application on iOS. The application was developped on Linux. But I can't manage to use Qt on macOs for iOS developpement.
I followed those (rather unclear) instructions : http://doc.qt.io/qt-5/ios-support.html
First, I installed successfully XCode and I managed to deploy a dummy app on my iPhone. Then, I installed Qt and opened the ".pro" project file.
But the only kit I can use is "Desktop Qt 5.4.1 clang 64 bit". The kits for iOS don't seem to be detected.
Did I do something wrong ? Am I missing something ?
EDIT:
When I launch the ".pro", I got this error :
Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.
Unfortunately, it is NOT related to this well known issue (Qt Creator - Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild)
When I run the command :
/usr/bin/xcodebuild
I get this error:
xcodebuild: error: The directory /Users/<UserName> does not contain an Xcode project
Okay I managed to solve my problem by re installing Qt with version 5.8 (instead of 5.9.1).
But I am not sure this is what was causing the issue though. In deed, I realized I installed Qt prior to configuring XCode the first time(with my Developer Account).
Using CMake to build both an app and plugin for it. Everything works fine on developer's PC, but on remote clean Linux Mint x64 installation there is an error:
plugin uses incompatible qt library Qt 5.3.1 [release]
Plugin and Application was build in release mode (actually I have tryed different combinations, with no luck)
I saw one guy here already asked about similar issue on Windows, but his question not answered.
Any ideas?
Problem fixed by exporting QML2_IMPORT_PATH and QT_PLUGIN_PATH, and copy dependebncies of Qt platform plugins (xcb)
Like many others, I'm taking the CS106B class on iTunes and, although the class is old, I am attempting to use the Stanford C++ libraries that are current. They are found here: http://www.stanford.edu/class/cs106b/.
During the Build Phase of projects, I have inserted into "Link Binary with Libraries" the files "random.h" and "libStanfordCPPlib.a". When I do this, I get the following error messages:
Check dependencies
warning: skipping file '/Users/lewis/Documents/Think Like a Programmer/CS106/VotingSimulation/../../../Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/random.h' (unexpected file type 'sourcecode.c.h' in Frameworks & Libraries build phase)
ld: warning: ignoring file /Users/lewis/Documents/Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/libStanfordCPPLib.a, file was built for archive which is not the architecture being linked (x86_64): /Users/lewis/Documents/Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/libStanfordCPPLib.a
Undefined symbols for architecture x86_64:
"randomChance(double)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am using Mac OS X 10.7.5 and XCode 4.6.2. I have set the Build Settings Base SDK to OS X 10.7 for both the Project and the Target.
It appears to me that the "libStanfordCPPlib.a" file may be an archive file that I have to unarchive before I can link the implementation code for the header files. Is this what I need to do, and if so, how do I do it? Am I doing something else wrong in linking the files?
I'm a noob and I'd appreciate help from anyone who has been successful in getting the current Stanford CS106B C++ libraries to work in XCode 4.6.2.
I just ran into this problem myself after upgrading to the newest version of xcode (ver. 5.0, OSX ver. 10.8.5).
Try switching the architecture of the project to 32-bit Intel (i386). The default is "Standard Architectures 64-bit Intel (x86_64)".
I'm currently using xcode 6.4 and trying to work through the cs 106b course work, I had the same issue of not being able to run the sample files and assignment files (can be found here btw http://web.stanford.edu/class/archive/cs/cs106b/cs106b.1136/ ). After changing the Architectures for both the Project and Target to 32-bit-intel as listed above I still received errors. I had to take the additional step of changing the OSX deployment target from 10.10 to 10.8 under the Project info.
This allowed the program to build but I received a notification that i needed to install the Java Runtime Environment, and there was no consult output. Installing this did not resolve the issue. I was only able to fully execute the code after installing the Java Development Kit. I am now able to compile all files for the course.
I hope this update helps more recent attempts to access this info.
I hope you've found an answer to your problem by now, but as I was suffering from a similar problem, trying to get xcode 5.1 to compile Warmup.cpp, I thought I'd post my solution for those others trying to get xcode to work with the cs106b libraries.
After struggling with xcode 5.1.1 and 5.0.2, I downloaded xcode 4.6.3 off of the apple dev site, www.developer.apple.com, and trashed the later versions. After installing 4.6.3, I still got errors, but after switching the Architecures for the Project and for the Target, to "32-bit-Intel", as messysaurus suggests, the warmupp.cpp compiled fine. Trying this same technique with xcode 5.1.1 and 5.0.2 yielded no results.
Hope this helps anyone else running into problems.