Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!mintaka!spdcc!tauxersvilli!alphalpha!nazgul From: nazgul@alphalpha.com (Kee Hinckley) Newsgroups: comp.windows.x Subject: Re: URGENT!!: Problems with build of X11R4!! Message-ID: <1991Jun17.172651.8424@alphalpha.com> Date: 17 Jun 91 17:26:51 GMT References: Organization: asi Lines: 44 In article dickerson@vf.jsc.nasa.gov writes: >We are trying to build the MIT source for X11R4. Everything seems >to build fine but when we try to build some X applications using >the libraries, we get: > >ld warning: Symbol _qfree will link to shared library >ld warning: Symbol _XHeadOfDisplay will link to shared library >ld warning: Symbol _Xdebug will link to shared library >ld warning: Symbol _XIOErrorFunction will link to shared library >ld warning: Symbol _XErrorFunction will link to shared library >ld warning: Symbol XrmQString will link to shared library > >We don't have any shared libraries!! I looked into the source in Yes you do. Look in /lib. You've got two choices here. If you dig up the declarations of the _ variables you will discovered that they are all declared in macros that can go one of two ways. The default is just to define the variable. E.g. "int foo;". The problem is a cute little C quirk. If you, in a normal C program, said "int errno;" the linker would be smart when it linked with the c libraries and would realize this was the same as the global variable of the same name. You currently have a situation where you have two variables of the same name, one in a global library which you don't want to reference, and one in the static library which you do. The linker is being too smart and assuming you want the global one (it has no way of knowing you want to override the global library). You have two choices. Change the variable names, or (I haven't tried this, but it should work) change the definitions to say int foo = NULL; The explicit assignment should tell the compiler that this is a definition, not a reference. As I noted earlier, there are macros to do this for the _ variables, but someone forgot to do it for XrmQString. Someone should probably submit a formal bug report on this. -- Alfalfa Software, Inc. | Poste: The EMail for Unix nazgul@alfalfa.com | Send Anything... Anywhere 617/646-7703 (voice/fax) | info@alfalfa.com I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's.