|
Allegro5 in XCode4 w/ OS X 10.6.xx |
dtx_code_mode
Member #12,878
May 2011
|
kk before i tell you my problem let me make it clear that that I have tried all these links before i made this topic. BUT there is some wierd problem in my Allegro and I would appreciate it if the people here could help me fix it. Problem: My XCode doesnt know where the header file is! if i say: What have done so far?? -then i made a console project in XCode in c++. Added the frameworks (Link with Binary libraries) -then I CHANGED my header search path according to the wiki above to: -then i clicked compile and pulled my hair for 1 hour before coming here. Here is what my code looks like: 1//demo code to see if shit goes down o' not!
2#include <stdio.h>
3#include <allegro5/allegro.h>
4
5int main(int argc, char **argv)
6{
7 ALLEGRO_DISPLAY *display = NULL;
8
9 if(!al_init()) {
10 fprintf(stderr, "failed to initialize allegro!\n");
11 return -1;
12 }
13
14 display = al_create_display(640, 480);
15 if(!display) {
16 fprintf(stderr, "failed to create display!\n");
17 return -1;
18 }
19
20 al_clear_to_color(al_map_rgb(0,0,0));
21
22 al_flip_display();
23
24 al_rest(10.0);
25
26 al_destroy_display(display);
27
28 return 0;
29}
for ur referance and quick analyzation of my problem here is what my screen looks like when i click on compile I hope all the data helps, I just wanna get done with this and start some actual coding. |
Elias
Member #358
May 2000
|
Are you sure you used -DWANT_FRAMEWORKS=1 and "make" and "make install" both succeeded? Check if you have a folder /Library/Frameworks/Allegro-5.0.framework after running "make install" and that it actually has some headers and libraries inside. I just tried it here with XCode 4 and it all still works, it's basically the same as XCode 3, just the GetInfo menu is gone and you have those tabs instead. I noted down my steps here: http://wiki.allegro.cc/index.php?title=OSX,_Xcode_4,_Framework -- |
sec_goat
Member #12,838
May 2011
|
I know nothing about Xcode, but I had a similar problem when trying to get Allegro to work in Code::blocks on Ubuntu. Here is what some one suggested in this thread: http://www.allegro.cc/forums/thread/607359 You need to add a compiler search directory to your project. Use Menu->Project->BuildOptions, select your main project (not the specific build type) and go to Search Directories->Compiler and add in the directory where you have your allegro headers. |
dtx_code_mode
Member #12,878
May 2011
|
kk, i am gonna make a clean install again and gonna try it out. one thing i have realized is the install wont give me dynamic library (.dylib) files. my conclusion, i will get back to you guys as soon as i follow ur links and comments. peace. |
Elias
Member #358
May 2000
|
If you follow the wiki guide, then yes, you don't get any .dylib files. Instead you get .framework files (directories actually). They will all be contained within your .app bundle later. If you're trying the new wiki instruction, just post here as soon as you hit an error and I'll try and figure out what's different to my install. -- |
dtx_code_mode
Member #12,878
May 2011
|
Kk Elias i followed the wiki guide and i still have the same problem. I followed the wiki (well written) i had the clean install in 2 minutes and a project in 5 but thats wehre it stopped. I tried to to what sec_goat asked me to try and i almost finished it until his last point, XCode has so many paths we can feed it, i dont know which one, for now i have filled the directory list (framework addresses) from the wiki in both- Header Search and User Header Search. (I) (II) I am currently in the east corner of the world and its late, i will go zzz and check back in later. i need sleep to think clearly now (III) so basically if only i could ask the Allegro devs to stick a "Allegro-5.0" custom made for me b4 every call.. hehe, later. and thx. i appreciate it. |
Elias
Member #358
May 2000
|
"User Header Search Paths" need not be modified to find the Allegro headers. In your screenshot, you only changed the search path for the Release build - is that what you actually are using? Can you expand the command causing the error in the build log to check if it passes the right parameters to gcc/clang? -- |
dtx_code_mode
Member #12,878
May 2011
|
(sorry for the late reply, but i needed a break, i spent a whole day on this yesterday ) i guess this what you mean. and this is our error when I include the legit <allegro5/allegro.h> i hope this is what u needed. if i am reading this right, only the last part matters and i think it is getting the file path right. but hten i dont get why would it not find the headers and fine the headers when i append Allegro-5.0 to the paths. |
Elias
Member #358
May 2000
|
Ok, so the Header Search Paths is not set somehow (it should show all the -I Library/Frameworks... lines for the Allegro headers). As I said, make sure you have that Debug/Release thing right as it looks weird in your screenshot. Here is how it looks for me: {"name":"Screen%20shot%202011-05-21%20at%205.15.25%20PM.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/3\/139f72e0ead88872e5fbe7f73f247fce.png","w":1280,"h":978,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/3\/139f72e0ead88872e5fbe7f73f247fce"} And this is how the correct options are passed during the build, in your case there aren't any of the Header Search Paths. {"name":"Screen%20shot%202011-05-21%20at%205.15.00%20PM.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/e\/ee48c59025b0d4c63145648aa97a9977.png","w":1280,"h":978,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/e\/ee48c59025b0d4c63145648aa97a9977"} -- |
|