XOpenDisplay can't connect to XServer

Discuss software development issues here.

XOpenDisplay can't connect to XServer

Postby KriS_cg » 16 Jan 2010, 01:09

Hi,

I'm trying to create a x window on PS3. I'm using YDL 6.2 and GCC 4.3.2.

Code: Select all
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) and call XOpenDisplay( NULL ). But when I try to compile it with -m64 (I need it for my SPU code) it doesn't work. I tried to update libX11 (from Fedora repos), reinstalled YDL 6.2, played with xhost, but nothing worked.

And here are some excerpts from strace output:

Code: Select all
// 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".

Does anyone have any idea how to fix it and why it doesn't work?
KriS_cg
ydl newbie
ydl newbie
 
Posts: 1
Joined: 16 Jan 2010, 01:02

Return to Software Development

Who is online

Users browsing this forum: No registered users and 2 guests