简体   繁体   中英

X11/xlib.h giving me XClearWindow errors

I have this program written in C code. it is a fork of hsetroot. I took it then add a lot more options to it so one can manipulate the image and colors that is set to ones desktop. the user has more control over it. it compiled and installed with no errors whatsoever.

I did this on a 32 bit Debian Linux OS. then I went out and got me a dual core 64 bit laptop ($50) Install Linux 64 bit. took my program out to dust it off and maybe clean it up a bit more, just for GP (general purpose).

when i tried to compile it on the command line I now am getting errors and it will no longer compile. the code has not been changed whatsoever. therefore no error should be seen.

nevertheless I am getting this error than it fails to completely compile. the funnier thing about it if I use the -m32 arg i will get a different fail to compile error then if I use or DO NOT use the -m46 arg.

I compile using this command with or without the -m64 arg then get the following error.

 gcc `imlib2-config --cflags` `imlib2-config --libs` mhsetroot-v1.6.2.c -o myapp

then get this error

/usr/bin/ld: /tmp/cclrRrBO.o: undefined reference to symbol 'XClearWindow'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO 
missing from command line collect2: error: ld returned 1 exit status

it tells me that the XClearWindow is NOT defined in the header file when it is. /usr/include/X11/xlib.h

extern int XClearWindow(
Display*        /* display */,
Window      /* w */

when I compile it using the -m32 arg I get this error instead

/development/c/mhsetroot$ gcc -m32  `imlib2-config --cflags` `imlib2- config --libs` mhsetroot-v1.6.2.c -o myapp

I get this error

In file included from mhsetroot-v1.6.2.c:29:0:
/usr/include/X11/Xlib.h:38:23: fatal error: sys/types.h: No such file or    directory #include <sys/types.h>

telling something is now wrong with the sys/types.h --

what gives -- the code has never been changed from when I had no problems doing this on a 32 bit Linux OS. but now on this 64 BIT Linux OS i am having problems. what is the real problem? because it is not my code.

需要添加的命令行arg是-lX11以告诉它也链接X11 ...(当我运行32位Linux时不需要,但是现在在64位Linux NIW中需要(不知道为什么))这摆脱了“命令行中缺少DSO”链接错误。现在,编译时没有任何错误-

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM