Problems building JOGL: [cc] /usr/bin/ld: cannot find -lstdc++

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems building JOGL: [cc] /usr/bin/ld: cannot find -lstdc++

rmshelby
Hello,
I am brand new to JOGL.  I've been trying to build JOGL on Fedora 20, according to the instructions here:
http://jogamp.org/jogl/doc/HowToBuild.html 
No problems with gluegen.  jogl compiles but fails to link:
      [cc] Starting link
       [cc] /usr/bin/ld: cannot find -lstdc++
       [cc] collect2: error: ld returned 1 exit status

I can't understand how this is possible; libstdc++.so is of course present in /usr/lib64, and the 32bit version in /usr/lib.
I hope someone can give me an idea what the cause of this is and how to fix.

Thanks,
Bob Shelby
Reply | Threaded
Open this post in threaded view
|

Re: Problems building JOGL: [cc] /usr/bin/ld: cannot find -lstdc++

gouessej
Administrator
Hi

Please try this thing:
http://forums.fedoraforum.org/showpost.php?s=39d6d52f8fe2215171b16578d607da1e&p=1586776&postcount=6

N.B: Your problem probably doesn't come from JOGL itself. If you have a doubt, compile another C++ program.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Problems building JOGL: [cc] /usr/bin/ld: cannot find -lstdc++

rmshelby
Julien,
thanks for the reply.  So that forum post you link to suggests removing the 32 bit libs, which I'm loathe to do, since I have many packages that depend on the 32 bit library, and yum wants to remove them all.  However, I did temporarily move libstdc++.so.* out of /usr/lib and it did not fix my linking problem.
By the way, other C++ programs build with no problem linking to libstdc++.

Do you know JOGL and ant well enough to tell me where to add the correct -L(path to libstdc++)?

Thanks,
Bob Shelby


----------------------------------------------------
Robert M. Shelby
IBM Almaden Research Center, K13/D1
650 Harry Rd
San Jose, CA 95120-6099
(408) 927-2423
[hidden email]
**please note email address has changed**
----------------------------------------------------



From: "gouessej [via jogamp]" <[hidden email]>
To: Bob Shelby/Almaden/IBM@IBMUS
Date: 12/16/2014 02:59 PM
Subject: Re: Problems building JOGL:  [cc] /usr/bin/ld: cannot find -lstdc++





Hi

Please try this thing:

http://forums.fedoraforum.org/showpost.php?s=39d6d52f8fe2215171b16578d607da1e&p=1586776&postcount=6

N.B: Your problem probably doesn't come from JOGL itself. If you have a doubt, compile another C++ program.

Julien Gouesse | Personal blog | Website | Follow me on Identi.ca




If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/Problems-building-JOGL-cc-usr-bin-ld-cannot-find-lstdc-tp4033761p4033762.html
To unsubscribe from Problems building JOGL: [cc] /usr/bin/ld: cannot find -lstdc++, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Problems building JOGL: [cc] /usr/bin/ld: cannot find -lstdc++

gouessej
Administrator
I compiled JOGL 2 under Fedora in 2011. Please remove the 32 bit libs, you can still reinstall them later and it would allow us to be sure that the problems come from that. I know that it's annoying but we can still look for a smarter solution later.

I have to leave, it's almost 1 o'clock in my country. Good luck.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Problems building JOGL: [cc] /usr/bin/ld: cannot find -lstdc++

rmshelby
In reply to this post by rmshelby
OK, I removed the 32bit libstdc++:

[root@obsidian lib]# rpm -q libstdc++ libstdc++-devel
libstdc++-4.8.3-7.fc20.x86_64
libstdc++-4.8.3-7.fc20.i686
libstdc++-devel-4.8.3-7.fc20.x86_64
[root@obsidian lib]# rpm --nodeps -e libstdc++-4.8.3-7.fc20.i686
[root@obsidian lib]# rpm -q libstdc++ libstdc++-devel
libstdc++-4.8.3-7.fc20.x86_64
libstdc++-devel-4.8.3-7.fc20.x86_64

Subsequently running the build on JOGL produced the same result:

       [cc] Starting dependency analysis for 47 files.
       [cc] 47 files are up to date.
       [cc] 0 files to be recompiled from dependency analysis.
       [cc] 0 total files to be compiled.
       [cc] 0 total files to be compiled.
       [cc] Starting link
       [cc] /usr/bin/ld: cannot find -lstdc++
       [cc] collect2: error: ld returned 1 exit status

BUILD FAILED
/home/shelby/science/neuro/jworkspace/jogl/make/build.xml:83: The following error occurred while executing this line:
/home/shelby/science/neuro/jworkspace/jogl/make/build-oculusvr.xml:710: The following error occurred while executing this line:
/home/shelby/science/neuro/jworkspace/jogl/make/build-oculusvr.xml:613: The following error occurred while executing this line:
/home/shelby/science/neuro/jworkspace/jogl/make/build-oculusvr.xml:555: gcc failed with return code 1

Total time: 26 seconds


So it seems the presence of the 32bit libstdc++ is not the issue.  Something else is going on.

Bob Shelby
Reply | Threaded
Open this post in threaded view
|

Re: Problems building JOGL: [cc] /usr/bin/ld: cannot find -lstdc++

Sven Gothel
Administrator
In reply to this post by rmshelby
On 12/16/2014 11:19 PM, rmshelby [via jogamp] wrote:

> Hello,
> I am brand new to JOGL.  I've been trying to build JOGL on Fedora 20,
> according to the instructions here:
> http://jogamp.org/jogl/doc/HowToBuild.html 
> No problems with gluegen.  jogl compiles but fails to link:
>       [cc] Starting link
>        [cc] /usr/bin/ld: cannot find -lstdc++
>        [cc] collect2: error: ld returned 1 exit status
>
> I can't understand how this is possible; libstdc++.so is of course present in
> /usr/lib64, and the 32bit version in /usr/lib.
> I hope someone can give me an idea what the cause of this is and how to fix.
We only use stdc++ for oculusvr (OVR)
                <linkerarg location="end" value="-Wl,-Bstatic"                 if="isGCC"/>
                <linkerarg location="end" value="-lstdc++" />
                <linkerarg location="end" value="-Wl,-Bdynamic"                if="isGCC"/>

+++

[1] Check whether a plain libstdc++.so is installed/avail.

On Debian, if installed the dev packages, e.g.
  libstdc++-4.9-dev:amd64
  lib32stdc++-4.9-dev

you will have the following standard symlinks:

/usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.so -> ../../../x86_64-linux-gnu/libstdc++.so.6
/usr/lib/gcc/x86_64-linux-gnu/4.9/32/libstdc++.so -> ../../../../../lib32/libstdc++.so.6

which allows usage of '-lstdc++' at compilation!

+++

[2] Disable OVR:
  ant -Dc.build.oculusvr.skip=true ...

+++

Hope it helps.

~Sven



signature.asc (828 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problems building JOGL: [cc] /usr/bin/ld: cannot find -lstdc++

rmshelby
Thanks Sven, your second suggestion to disable OVR allowed the build to complete successfully.

However, I think I do have the libstdc++.so in the correct place:

$ ll -d /usr/lib/gcc/x86_64-redhat-linux/4.8.3/libstdc++.so
lrwxrwxrwx 1 root root 37 Sep 24 10:21 /usr/lib/gcc/x86_64-redhat-linux/4.8.3/libstdc++.so -> ../../../../lib64/libstdc++.so.6.0.19

So it still seems a puzzle.

Thanks,
Bob Shelby