User Name
Password
AppleNova Forums » Programmer's Nook »

X11, libs and getting an Xcode project to work!


Register Members List Calendar Search FAQ Posting Guidelines
X11, libs and getting an Xcode project to work!
Thread Tools
scratt
Veteran Member
 
Join Date: Jul 2004
Location: M-F: Thailand Weekends : F1 2010 - Various Tracks!
Send a message via Skype™ to scratt 
2006-12-10, 13:52

Wonder if anyone can help with this..

I am porting a project which relies on X11 into a native OS X app.

I have all of the source for the project, and have created an Xcode project which compiles and links and produces an executable without errors..

The only dependencies it has (apart from X11) are the OpenGL.framework and the GLUT.framework. It is a console app. So no app bundle.

Whenever I try to run it it drops out with an error when it trys to connect to the 'X server' and open a window context...

I have a full tarball set of source with make files which works on my machine, and produces a console app which will fire up X11 and run perfectly.
So I know this works on my machine in it's current setup.. However, I have missed / borked something in the build process in the Xcode project....

I am pretty sure it is that it simply is not connecting properly to the lib files it depends on for X11 and GL.
Can anyone verify if adding libraries to an Xcode project is as simple as adding them like frameworks, and making them available to the final app? That's all I thought I had to do.... ?

'Remember, measure life by the moments that take your breath away, not by how many breaths you take'
Extreme Sports Cafe | ESC's blog | scratt's blog | @thescratt
  quote
Enki
Senior Member
 
Join Date: Nov 2004
 
2006-12-12, 15:17

I dealt with something like this several years ago, unfortunately I don't remember exactly what I did to fix it. And I haven't used X11 since. But I do remember it had to do with properly setting the environment variables when X11 launches. Take a look at the two startup scripts and look for differences there.

Good luck!
  quote
colivigan
Veteran Member
 
Join Date: Nov 2005
 
2006-12-12, 15:59

It does sound like more of a runtime environment issue than a library/linking problem.

Does anything here help? In particular, have you tried this?

Quote:
Originally Posted by Apple
Q: How do I run X applications from a Terminal window?
A: You can use the /usr/bin/open-x11 script to launch X applications from Terminal.
  quote
scratt
Veteran Member
 
Join Date: Jul 2004
Location: M-F: Thailand Weekends : F1 2010 - Various Tracks!
Send a message via Skype™ to scratt 
2006-12-12, 20:21

Thanks for that guys.. I actually had an epiphany and took the whole app native over the last 24 hours!

However, having gone native with it (even though it is all OpenGL) I have found that the native version runs at about 30 fps and the X11 version was getting 50 fps. Some of this may be because it's in debug mode, but still 20 fps is a lot to lose..

So I am going back to the X11 version to rip it apart. I will give the environment variable stuff a try. Someone else also suggested that it may be as simple as setting the DISPLAY environment variable appropriately in the Executable within my Xcode project that corresponds to my X11 application. So I might give that a try also..

'Remember, measure life by the moments that take your breath away, not by how many breaths you take'
Extreme Sports Cafe | ESC's blog | scratt's blog | @thescratt
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools

« Previous Thread | Next Thread »

All times are GMT -5. The time now is 04:20.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova