Message: Re: Error when compiling Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Error when compiling  

Forum: Installation and Configuration
Re: Question Error when compiling "G4OpenGLXViewer.cc" (Oscar Larsson)
Re: None Re: Error when compiling (John Allison)
Re: Question Re: Error when compiling (Oscar Larsson)
Date: 22 Sep, 2008
From: Paul Nicholas Colin Gloster <Paul Nicholas Colin Gloster>

I responded by email to the email list in response to the initial query last week but HyperNews does not seem to have done anything with that response. I also sent another email to the email list today which has also not penetrated HyperNews, so I send it again but this time with
HTTP://HyperNews.SLAC.Stanford.edu/HyperNews/geant4/SECURED/edit-response.pl/installconfig/1152/1/1.html
...
On Mon, 22 Sep 2008, Oscar Larsson wrote:

|-------------------------------------------------------------------------|
|"[..]                                                                    |
|                                                                         |
|After having installed this driver I got the following errors when       |
|compiling my G4 source code:                                             |
|                                                                         |
|Compiling testvolume.cc ...                                              |
|                                                                         |
|Using granular libraries ...                                             |
|                                                                         |
|Linking testvolume ...                                                   |
|                                                                         |
|/home/Nasa/cern/Mesa-7.1/lib/libGL.so: undefined reference to            |
|`drmCloseOnce'                                                           |
|                                                                         |
|/home/Nasa/cern/Mesa-7.1/lib/libGL.so: undefined reference to            |
|`XDamageAdd'                                                             |
|                                                                         |
|/home/Nasa/cern/Mesa-7.1/lib/libGL.so: undefined reference to            |
|`drmOpenOnce'                                                            |
|                                                                         |
|collect2: ld returned end status 1                                       |
|                                                                         |
|make: *** [/home/Nasa/g4work/bin/Linux-g++/testvolume] Error 1           |
|                                                                         |
|Any new helpful thoughts??                                               |
|                                                                         |
|And yes, I have an up to date version of libdrm installed (libdrm.2.3.1)"|
|-------------------------------------------------------------------------|

Hello,

You are experiencing a linking problem (but whether or not that is the
cause or simply a consequence of another problem, I do not know). A
linking problem is not a problem in the source code. Instead, a
linking problem happens when separate files had been successfully
compiled but the binary files miss something needed to link them
together into an executable file. An absurd but common example with
many (but not all) installations of a GNU C++ compiler is
/*Beginning of C++ file...*/
#include<cmath>
int main()
{
  sin(0.5);
  return -1;
}
/*...end of C++ file.*/
which if
gcc example.C
would not be sufficient to generate an executable file, would probably
fail with error messages similar to:
gcc example.C
/tmp//ccZ11862.o(.text+0x28): In function `main':
: undefined reference to `sin'
/tmp//ccZ11862.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
which could be eliminated by running
gcc -lm -lstdc++ example.C
instead (-lm to link in the library <cmath> so as to provide the
reference to sin, and -lstdc++ to obtain standard C++ items (and
hence, to eliminate the complaint re __gxx_personality_v0).

You could try to ensure that the -lGL switch is being used, but it
probably is.

A possible solution might be found from
HTTP://docs.FreeBSD.org/cgi/getmsg.cgi?fetch=96713+0+archive/2007/freebsd-ports/20070610.freebsd-ports
(though it is for a different operating system, the general idea to
try to recompile libdr;, libGL; libGLU; libglut; the drivers etc. or
use a different version of X Windows might work).

Error messages similar to what you mentioned were mentioned on
HTTP://docs.freeBSD.org/cgi/getmsg.cgi?fetch=62063+0+archive/2007/freebsd-ports/20070603.freebsd-ports
.

Good luck.

Regards,
Colin Paul Gloster

 Add Message Add Message
to: "Re: Error when compiling "

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]