Sponsored Content
Top Forums Programming XWindows programming + gcc linker options Post 302208424 by JamesGoh on Monday 23rd of June 2008 11:21:00 PM
Old 06-24-2008
XWindows programming + gcc linker options

Im trying to compile some code that involves using X-Windows based functions (XDisplayName() and XOpenDisplay() ), however each time I run the compiler, Im getting a problem with the linker.

The linker says that both XDisplayName() and XOpenDisplay() are unresolved text symbols. Is there a specific option I should be specifying in the compile command for the X-Windows functions to be legitimately recognised ?

Warm Regards
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

programming options

I am working on a community college certification in programming and have a choice of specialization in Java ,Visual Basic ,or Visual C++. I am curious to know what specialization would be best for the current job market and increase my earning potential? Any feedback would be greatly... (5 Replies)
Discussion started by: bilal_aa
5 Replies

2. Solaris

gcc & linker question (Solaris 10)

Hi, I'm confused about the GCC & Linking process could somebody please briefly explain? I have GCC 3.4.6 installed from SunFreeware. Reading the narrative alongside the package states "It was compiled to use the SUN assembler and loader usually in /usr/ccs/bin if the SUNW developer packages... (1 Reply)
Discussion started by: Celtic_Monkey
1 Replies

3. Programming

GCC: Choose my own linker

Hi, I do not use the default linker, and instead us another one and pass this argument -Wl,--dynamic-linker=<path to linker> to gcc when compiling. However, what happens if the linker is not under /lib and /lib64 and I am not able to create a symlink to the linker in /lib or /lib64 due to no... (2 Replies)
Discussion started by: Shompis
2 Replies

4. AIX

xlc compiler options versus gcc

Hi all, I would like to compile a program and get current errors and warnings report to me as « gcc -Wall ». Does someone can give me these options to get an equivalent ? Or the ommon option used to put them in a CFLAGS in a Makefile. Something like : xlc -O2 -Wall my_prog.c -o... (5 Replies)
Discussion started by: domiq44
5 Replies

5. Programming

gcc linker address

Hai, I have two (Pgm1.c and Pgm2.c) simple programs, which is compiled using gcc. Now we have two exe's (Pgm1 and Pgm2). When i executed the nm Pgm1 and nm Pgm2, in the listed symbols the address of main is same for both programs (08048344 T main) at run time also. Doubt: 1) What is this... (3 Replies)
Discussion started by: rajamohan
3 Replies

6. Programming

Gcc linker search path order

I have a build where I wish to link against and load a specific version of a library and a different version of the same library is installed on the system. I'm using a -L option to point to the version that I wish to link against but gcc still seems to choose the installed version. Is there a way... (4 Replies)
Discussion started by: Richard Johnson
4 Replies

7. Programming

Gcc openmp programming problem

Dear Linux users, I'm a noob at openmp, gcc and c programming. I can run my own openmp code in terminal with no problem, eg. gcc -fopenmp program.c -o program. But now I'm trying to compile and run another person's code, it contains a makefile and multiple .c and .h files. I don't know how to... (2 Replies)
Discussion started by: pigeon151
2 Replies

8. Programming

Help with gcc programming

I need a lot of help with c programming. I have the source code. Running configure, I got one error message about a missing library. I downloaded and successfully compiled it in another dir. Do I throw all the new files into my source dir and run configure again ? Thanks. (3 Replies)
Discussion started by: drew77
3 Replies
XSetErrorHandler(3)						  XLIB FUNCTIONS					       XSetErrorHandler(3)

NAME
XSetErrorHandler, XGetErrorText, XDisplayName, XSetIOErrorHandler, XGetErrorDatabaseText - default error handlers SYNTAX
int (*XSetErrorHandler(int (*handler)(Display *, XErrorEvent *)))(); int XGetErrorText(Display *display, int code, char *buffer_return, int length); char *XDisplayName(char *string); int (*XSetIOErrorHandler(int (*handler)(Display *)))(); int XGetErrorDatabaseText(Display *display, char *name, char *message, char *default_string, char *buffer_return, int length); ARGUMENTS
buffer_return Returns the error description. code Specifies the error code for which you want to obtain a description. default_string Specifies the default error message if none is found in the database. display Specifies the connection to the X server. handler Specifies the program's supplied error handler. length Specifies the size of the buffer. message Specifies the type of the error message. name Specifies the name of the application. string Specifies the character string. DESCRIPTION
Xlib generally calls the program's supplied error handler whenever an error is received. It is not called on BadName errors from OpenFont, LookupColor, or AllocNamedColor protocol requests or on BadFont errors from a QueryFont protocol request. These errors generally are reflected back to the program through the procedural interface. Because this condition is not assumed to be fatal, it is acceptable for your error handler to return; the returned value is ignored. However, the error handler should not call any functions (directly or indi- rectly) on the display that will generate protocol requests or that will look for input events. The previous error handler is returned. The XGetErrorText function copies a null-terminated string describing the specified error code into the specified buffer. The returned text is in the encoding of the current locale. It is recommended that you use this function to obtain an error description because exten- sions to Xlib may define their own error codes and error strings. The XDisplayName function returns the name of the display that XOpenDisplay would attempt to use. If a NULL string is specified, XDisplay- Name looks in the environment for the display and returns the display name that XOpenDisplay would attempt to use. This makes it easier to report to the user precisely which display the program attempted to open when the initial connection attempt failed. The XSetIOErrorHandler sets the fatal I/O error handler. Xlib calls the program's supplied error handler if any sort of system call error occurs (for example, the connection to the server was lost). This is assumed to be a fatal condition, and the called routine should not return. If the I/O error handler does return, the client process exits. Note that the previous error handler is returned. The XGetErrorDatabaseText function returns a null-terminated message (or the default message) from the error message database. Xlib uses this function internally to look up its error messages. The text in the default_string argument is assumed to be in the encoding of the current locale, and the text stored in the buffer_return argument is in the encoding of the current locale. The name argument should generally be the name of your application. The message argument should indicate which type of error message you want. If the name and message are not in the Host Portable Character Encoding, the result is implementation-dependent. Xlib uses three predefined ``application names'' to report errors. In these names, uppercase and lowercase matter. XProtoError The protocol error number is used as a string for the message argument. XlibMessage These are the message strings that are used internally by the library. XRequest For a core protocol request, the major request protocol number is used for the message argument. For an extension request, the extension name (as given by InitExtension) followed by a period (.) and the minor request protocol number is used for the message argument. If no string is found in the error database, the default_string is returned to the buffer argument. SEE ALSO
XOpenDisplay(3), XSynchronize(3) Xlib - C Language X Interface X Version 11 libX11 1.6.0 XSetErrorHandler(3)
All times are GMT -4. The time now is 01:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy