ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i know im pretty new to linux so if anything i say is wrong someone please correct me, but i think you have to change the file permission on CharFil so that you have execute permission. If you dont have permission i think that is the error message you will get.
I checked the permissions and the binary was already execuatble. So unfortunatly that doesn't seem to be the problem, but thank you for your advice stamour547.
Here's another attempt I made at statically linking:
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../libgtk-x11-2.0.a(gtkplug.o)(.text+0x10c2): In function `send_xembed_message':
: undefined reference to `XSendEvent'
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../libgtk-x11-2.0.a(gtkplug.o)(.text+0x121e): In function `xembed_set_info':
: undefined reference to `XChangeProperty'
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../libgtk-x11-2.0.a(gtksocket.o)(.text+0x4ff): In function `gtk_socket_realize':
: undefined reference to `XGetWindowAttributes'
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../libgtk-x11-2.0.a(gtksocket.o)(.text+0x52a): In function `gtk_socket_realize':
: undefined reference to `XSelectInput'
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../libgdk-x11-2.0.a(gdkinput-xfree.o)(.text+0x1a5): In function `gdk_input_check_proximity':
: undefined reference to `XFreeDeviceState'
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../libgdk-x11-2.0.a(gdkinput-xfree.o)(.text+0x539): In function `_gdk_input_grab_pointer':
: undefined reference to `XGrabDevice'
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../libgdk-x11-2.0.a(gdkinput-xfree.o)(.text+0x585): In function `_gdk_input_grab_pointer':
: undefined reference to `XUngrabDevice'
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../libgdk-x11-2.0.a(gdkinput-xfree.o)(.text+0x613): In function `_gdk_input_ungrab_pointer':
: undefined reference to `XUngrabDevice'
collect2: ld returned 1 exit status
If I link the following libraries dynamically, everything works fine: -lgdk_pixbuf-2.0 and -lgdk-x11-2.0. But this is not a static binary:
CharFil: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped
Yes, I was hoping the -static flag used in the first example would link the shared libraries and their dependancies statically (if that can be done). What confused me was that I recieved no errors while compiling or linking. The binary executable was created, but when I attempted to run it the binary executable was not found.
In the second example the -static flag is used again, and the required libraries are included without the explicit instructions on whether to use their shared or static elements. I think in this case the -static flag instructs the linker to use all of the corresponding .a library files. However when I do this I recieve a large number of undefined reference errors. It's almost as if the .a library files do not include everything their .so equivalents do.
That's my problem. When I try to link gdk_pixbuf-2.0 and gdk-x11-2.0 statically I receive all of those errors. I'm beginning to wonder if it's even possible, but I am hopeful it is and someone out there has done it and can help me.
The library included in ur stitic compilation program may be interdependent so try to change there position and then try ..... u can find out .la file of the same library on which libs this lib depends .... hope this will solve ur problem..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.