[Sussex] Compiler G++ problems

Rupert Swarbrick rupert.swarbrick at lineone.net
Sun Jun 19 10:24:44 UTC 2005


Andrew Guard wrote:
>>On Sat, Jun 18, 2005 at 10:07:34PM +0100, Andrew Guard wrote:
>>
>>>I am using ubuntu 5.04.  Gosh I thought it was Linux system, well
>>>installing g++ I thought that would be on by default but alas no. 8
>>>hours wasted find out that hay ho.
>>
>>Why _should_ it be on by default?  There's no requirement to say it
>>should.
> 
> 
> Err, it Open Source.  I thought the idea of having a compiler would
> installed by default to be useful.
> 
> 
> 
>>>Now I have another problem, each time I compile all get is this error
>>>message from my IDE.
>>>
>>>/usr/bin/ld: cannot find -1GL collect2: ld returned 1 exit status
>>>
>>>Any wise ideas out there?
>>
>>You're missing a library that the linker is trying to link against.
>>Which app are you trying to compile?  Only I can't tell from the error
>>the precise library -- it might be one of the openGL ones.
> 
> 
> Sadly I don't know as IDE system I use is cross platform 1 source code
> compiles for all systems Mac, Windows, Linux.  I don't want to get to
> dumped down in the in's and out's of each system.  Thats why I have gone
> down this route.
> 
> Of course there are disadvantages to do it this way but I think the time
> it saves me is well worth it in the long run.
> 
> I have tryed to install
> 
> gcc
> gobjc-3.3
> libsdl1.2-dev
> xxf86vm-dev

OK. What you need to do is tell the linker where libGL.a is. This is
usually put somewhere wierd for historical (xFree86) reasons (although
with Ubuntu, I have a link to it in /usr/lib, which should be
automatically found...?)

There are two possibilities:

1) libGL.a isn't installed. With ubuntu you need a package like
xlibmesa-gl-dev or libgl-dev, which gives the headers and development
library to link against.

2) It's in a wierd place. With a up to date locate database, just run
'locate libGL.a'. Say you get:
/usr/X11R6/lib/libGL.a
Then what you need to do is add the command line flag -L/usr/X11R6/lib
to the gcc invocation. If you're compiling with something with a
./configure; make; sort of thing, then 'LDFLAGS="-L/usr/X11R6/lib" make'
should probably work.

That said, I reckon you've just not installed the needed library -
ubuntu's very good at putting things in helpful places.

Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 374 bytes
Desc: OpenPGP digital signature
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20050619/fe41e1f5/attachment.pgp 


More information about the Sussex mailing list