Bug#617751: ocaml-soundtouch: Shouldn't link against stdc++
Hi, Stéphane Glondu glo...@debian.org (11/03/2011): So you mean that by using some specific library, one should change linker? no, I mean that by using the C++ programming language, you're supposed to link using g++. Doesn't sound right to me... Do you have any reference that explains why linking to -lstdc++ without g++ is bad practice? I've already heard of that, but couldn't find any decent explanation. Because it's not guaranteed to work. Example: | $ cat foo.cpp | #include iostream | | using namespace std; | | int main(void) { | cout Hello world! endl; | return 0; | } | $ g++ -c foo.cpp -o foo.o | $ ld -lstdc++ foo.o -o foo | ld: cannot find -lstdc++ Both work, with the intermediate target: | g++ foo.o -o foo or directly: | $ g++ foo.cpp -o foo http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html also suggests you should be using g++ to link (see -static-*). KiBi. signature.asc Description: Digital signature
Bug#617751: ocaml-soundtouch: Shouldn't link against stdc++
2011/3/11 Cyril Brulebois k...@debian.org: Hi, Stéphane Glondu glo...@debian.org (11/03/2011): So you mean that by using some specific library, one should change linker? no, I mean that by using the C++ programming language, you're supposed to link using g++. Doesn't sound right to me... Do you have any reference that explains why linking to -lstdc++ without g++ is bad practice? I've already heard of that, but couldn't find any decent explanation. Because it's not guaranteed to work. Example: | $ cat foo.cpp | #include iostream | | using namespace std; | | int main(void) { | cout Hello world! endl; | return 0; | } | $ g++ -c foo.cpp -o foo.o | $ ld -lstdc++ foo.o -o foo | ld: cannot find -lstdc++ Both work, with the intermediate target: | g++ foo.o -o foo or directly: | $ g++ foo.cpp -o foo http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html also suggests you should be using g++ to link (see -static-*). That sounds like a big headache for OCaml: native code generated by OCaml are bundled together at link-time. For instance, in Liquidsoap, where ocaml-soundtouch is used, we use C and C++ code for the bindings. Therefore, there is no reason to use g++ to link the final binary... Do you have any idea concerning this situation? Romain KiBi. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk16AuEACgkQeGfVPHR5Nd2+2gCfbk6o8rBjt44n3BaEQQaWQ6zw uCAAn2DsLIjQcefTKT2QQItk+80N7dqZ =mdL1 -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#617751: ocaml-soundtouch: Shouldn't link against stdc++
Source: ocaml-soundtouch Version: 0.1.6-1 Severity: normal Hi, noticed “thanks” to a buildd glitch (g++ missing): | /usr/bin/ocamlc -c soundtouch.mli | /usr/bin/ocamlc -c soundtouch.ml | ocamlmklib -L/usr/lib \ | -o soundtouch_stubs soundtouch_stubs.o -lSoundTouch -lstdc++ \ | | /usr/bin/ld: cannot find -lstdc++ Last I checked, one links C++ code through g++, not through ld … -lstdc++. You may want to investigate that. KiBi. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#617751: ocaml-soundtouch: Shouldn't link against stdc++
Le 11/03/2011 05:43, Cyril Brulebois a écrit : noticed “thanks” to a buildd glitch (g++ missing): | /usr/bin/ocamlc -c soundtouch.mli | /usr/bin/ocamlc -c soundtouch.ml | ocamlmklib -L/usr/lib \ | -o soundtouch_stubs soundtouch_stubs.o -lSoundTouch -lstdc++ \ | | /usr/bin/ld: cannot find -lstdc++ Last I checked, one links C++ code through g++, not through ld … -lstdc++. You may want to investigate that. So you mean that by using some specific library, one should change linker? Doesn't sound right to me... Do you have any reference that explains why linking to -lstdc++ without g++ is bad practice? I've already heard of that, but couldn't find any decent explanation. Cheers, -- Stéphane -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org