This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Xcode 4 and Allegro 5.1 - Linker can't find Framework
I've been trying to get Allegro working on my Mac running OS X 10.8. I followed these instructions:
http://wiki.allegro.cc/index.php?title=OSX,_Xcode_4,_Framework
I go down and do everything they say for a simple Xcode application but it fails during the build with the following error:
ld: framework not found Allegro-5.1
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've tried using Allegro 5.0.7 and 5.1.3 and both times I get the same result that it can't find the framework. Am I missing something? Here's my very basic app that I'm trying to run.
#include <allegro5/allegro.h>
int main(int argc, char **argv) {
al_init();
al_create_display(640, 480);
al_clear_to_color(al_map_rgb_f(1, 1, 0));
al_flip_display();
al_rest(5.0);
return 0;
}
The answer for "Xcode 4 and Allegro 5.1 - Linker can't find Framework" helped me.
In the project target, go to "Build Settings" and change the "Framework Search Paths" to /Library/Frameworks.
Related
This question already has answers here:
New warnings in iOS 9: "all bitcode will be dropped"
(7 answers)
Closed 7 years ago.
I am trying to convert my code into Swift 2.0 but I am running into an issue.
Can someone please tell me what this means and how to fix it?
ld: warning: directory not found for option
'-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks'
ld: -bundle and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
cannot be used together clang: error: linker command failed with exit
code 1 (use -v to see invocation)
Thanks
Switch to project's Build Setting panel, search for BitCode, and set the value of Enable Bitcode to NO
Bitcode is the default but optional so you can disable it.
From Bitcode (iOS, watchOS):
Note: For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS apps, bitcode is required.
I'm building a Unity project for an iOS8 simulator. Moving this for Xcode 6 GM for the simulator has resulted in this linker error. Not sure if I'm missing something in the build or something is broken. Any suggestions? The full error is:
Undefined symbols for architecture i386:
"_clock$UNIX2003", referenced from:
_substanceHandleSwitchHard in libiPhone-lib.a(apihandle.o)
_mainRenderProcess in libiPhone-lib.a(mainrenderprocess.o)
ld: symbol(s) not found for architecture i386
Exit with code 1
Add the following at the end of main.mm.
#include <time.h>
extern "C"
{
clock_t
clock$UNIX2003(void)
{
return clock();
}
}
clock$UNIX2003 is a symbol that is provided by OS X and is not part of the iOS Simulator runtime. iOS is always conformant and thus does not have legacy (non $UNIX2003) variants of functions (which are provided for binary compatibility with code built against older versions of the OS X SDK).
The common cause of the issue you are seeing is that you have an object file or archive (libsomething.a) that was built against the OS X SDK and are trying to link it into your iOS Simulator executable. That is not supported as the two platforms are not binary compatible at that layer.
You need to rebuild your library (the libsomething.a) against the iOS Simulator SDK.
I am new to Xcode, New to Kinvey.. Fun start..
I followed Kinvey's installation guide for iOS and everything goes pretty well until I try to compile.The Presence of the Kinvey Framework in my project blocks it from compiling with the following error:
ld: file is universal (3 slices) but does not contain a(n) i386 slice: /Users/*path_to_my_project*/KinveyKit.framework/KinveyKit for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Looking around at other solutions, nothing seems to fit.. Note that the issue is on i386, not armv7s..
I tried on Xcode 4.6.1 and Xcode 4.6.3 with brand new projects with nothing in them..
Thank you very much for any help.
We ran into this issue awhile back in our project. I believe if you go into the build settings for your main app target and set the property ONLY_ACTIVE_ARCH (Build Active Architecture Only) to NO, that should fix your issue.
After contacting Kinvey, it was found that it was a Bug in the 1.19.1 SDK. It has been fixed in the 1.19.2. Kinvey has been pretty reactive on this.
This question can be closed now.
I try to build a simple Qt 5 program on Mac. But I failed.
The code is very simple:
#include <QtWidgets/QApplication>
int main(int argc, char *argv[])
{
QApplication app (argc, argv);
return app.exec();
}
I used:
clang++ -I ~/Qt5.0.0/5.0.0/clang_64/include -L/Users/crazylion/Qt5.0.0/5.0.0/clang_64/lib test.cpp
Then I got this error:
Undefined symbols for architecture x86_64:
"QApplication::exec()", referenced from:
_main in test-jPGORy.o
"QApplication::QApplication(int&, char**, int)", referenced from:
_main in test-jPGORy.o
"QApplication::~QApplication()", referenced from:
_main in test-jPGORy.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there anything i missing?
Firstly, don't compile and link Qt projects by hand; use qmake and project files.
Run qmake -project in your source directory to generate a basic project file.
Edit the project file and add the following line: QT += widgets
Now run qmake to generate a makefile.
Now run make to build your program.
Secondly, you can simply #include <QApplication>
If you want to use clang++ in favor of qmake, you need to specify libraries to link against to, along with the library directory (which you supplied).
clang++ -I ~/Qt5.0.0/5.0.0/clang_64/include -L/Users/crazylion/Qt5.0.0/5.0.0/clang_64/lib -lQtCore -lQtGui test.cpp
I had the same problems and it seems to me that there is some sort of bug in the release it gave me some errors because out of a fresh install (using qt creator) i didn't have some obscure qt library (not the normal qt5 modules but some sort of library in development) so I tend to think that it could be qt's problem
That said I have some questions to better understand:
-are you using a IDE?
-if you are using one which is it?
-are you including all the modules in the *.pro for quake?
-have you used 4.8 version, did you experienced these problems with that?
P.S. if you do not have any particular necessity I suggest you to stick to version 4.8 for some time (as I am doing without problem) since 5.0 is just been released
I am trying to compile a project with SDL in Xcode and get the error:
Undefined symbols for architecture x86_64:
"_main", referenced from:
-u command line option
I have the SDL.framework include along with Cocoa.framework in the Link Binary with Libraries. I also have SDLMain.h and SDLMain.m in the project.
This is all my code:
#include "SDLMain.h"
#include <SDL/SDL.h>
int main(int argc, const char * argv[])
{
return 0;
}
int main has to look like this:
int main(int argc, char * argv[])
{
return 0;
}
get rid of the const
It tool a quite long time until I got SDL and Xcode running. So, don't care. :-)
I uploaded here a simple SDL template for Xcode 4.5 and Mac OS X 10.7 and 10.8 (also using OpenGL 3.2 Core Profile possible). Step by Step instructions:
Download SDL (at the moment version 1.2.15)
Open the downloaded .dmg file
copy the SDL.framework into /Library/Frameworks/
Done. You can use the Xcode template (you should see a red area):
Further details and an image on my Blog (only german, sorry).