|
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
View previous topic :: View next topic |
Author |
Message |
KriS
Joined: 13 Nov 2009 Posts: 6
|
Posted: Thu Jan 14, 2010 10:30 am Post subject: XOpenDisplay fails |
|
|
Hi,
I'm trying to create a window for my spu software rasterizer (fb approach isn't very crash friendly). I'm using YDL 6.2 distro and GCC 4.3.2.
Code: |
int main()
{
if ( !XOpenDisplay( NULL ) )
{
printf( "Can't connect to x server" );
}
return 0;
}
|
Everything works fine when I compile this source with -m32 (32 bit executable), but when I try -m64 XOpenDisplay always returns NULL. I tried to update libX11 (from Fedora repos), reinstalled YDL 6.2, played with xhost, but nothing worked.
EDIT: XOpenDisplay( "NULL" ) -> XOpenDisplay( NULL )
Last edited by KriS on Thu Jan 14, 2010 7:16 pm; edited 1 time in total |
|
Back to top |
|
|
jbit Site Admin
Joined: 28 May 2005 Posts: 293 Location: København, Danmark
|
Posted: Thu Jan 14, 2010 6:31 pm Post subject: |
|
|
First hit on google for XOpenDisplay: http://tronche.com/gui/x/xlib/display/opening.html
display_name: Specifies the hardware display name, which determines the display and communications domain to be used. On a POSIX-conformant system, if the display_name is NULL, it defaults to the value of the DISPLAY environment variable.
This probably means it wants you to use: XOpenDisplay(NULL);... not passing NULL as a string....
There are plenty of xlib tutorials on the web you should probably read..... |
|
Back to top |
|
|
KriS
Joined: 13 Nov 2009 Posts: 6
|
Posted: Thu Jan 14, 2010 7:15 pm Post subject: |
|
|
jbit wrote: | This probably means it wants you to use: XOpenDisplay(NULL);... not passing NULL as a string.... |
Yes, I'm using XOpenDisplay( NULL ). I also tried ":0.0" (the value of my DISPLAY env variable).
I was googling for a 2 days, but couldn't find why XOpenDisplay doesn't work when linking with 64 bit X11 libs. |
|
Back to top |
|
|
cheriff Regular
Joined: 23 Jun 2004 Posts: 262 Location: Sydney.au
|
Posted: Thu Jan 14, 2010 10:12 pm Post subject: |
|
|
is there an 'errno' or similar in xlib you could check for clues on why the call failed?
Maybe an strace would be helpful - sometimes missing file opens or something can be an indicator as to why things failed?
You do have the 64bin xlib library installed right? Although i'd expect some other failure mode if this is the case, but one never knows ... _________________ Damn, I need a decent signature! |
|
Back to top |
|
|
KriS
Joined: 13 Nov 2009 Posts: 6
|
Posted: Sat Jan 16, 2010 8:13 am Post subject: |
|
|
cheriff wrote: | Maybe an strace would be helpful - sometimes missing file opens or something can be an indicator as to why things failed?
|
Thanks for the strace hint. This looks like a really useful tool.
Code: |
// 32 bit lib + XOpenDisplay( NULL )
socket(PF_FILE, SOCK_STREAM, 0) = 3
connect(3, {sa_family=AF_FILE, path="/tmp/.X11-unix/X0"...}, 19) = 0
// 32 bit lib + XOpenDisplay( 'localhost.localdomain:0.0" )
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(6000), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
// 64 bit lib + XOpenDisplay with any param
socket(PF_UNSPEC, 0 /* SOCK_??? */, 0) = 3
connect(0, NULL, 0) = -1 ECONNREFUSED (Connection refused)
|
Calls for the 64bit version look very strange too me. For example manuals don't mention that you can pass NULL as addr to connect.
Also it looks like that I may have some problems with network. I tried to disable firewall, but I can't force 32 bit version to connect to "localhost.localdomain".
cheriff wrote: |
You do have the 64bin xlib library installed right? Although i'd expect some other failure mode if this is the case, but one never knows ... |
I have reinstalled x11-devel rpms with dependencies and there are some files like libX11.so in lib64 folder. If I remove them I get missing lib errors, so I think I have this lib installed :). |
|
Back to top |
|
|
modrobert
Joined: 12 Apr 2005 Posts: 22 Location: Bangkok
|
Posted: Thu Apr 01, 2010 1:41 am Post subject: |
|
|
Try...
xhost+
...and run the program again. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|