<div dir="ltr">Hi!<br><br>My program is working fine in my own machine. I want to test it in a different machine now (both using Debian 10), so I want to compile it statically. For dynamic compiling, I use:<br><br>g++ terreno1.cpp -losg -losgDB -losgGA -losgSim -losgText -losgUtil -losgViewer -o terreno1<br><br>For static, I learned <a href="https://stackoverflow.com/a/52000944/1086511">here</a> that I need to use -Wl,-Bstatic at the beginning of the library list, and -Wl,-Bdynamic at the end. Before that (with only the beginning part), I was getting:<br><br>/usr/bin/ld: cannot find -lgcc_s<br>/usr/bin/ld: cannot find -lgcc_s<br>collect2: error: ld returned 1 exit status<br><br>Now I get that long list of "undefined reference" through many of OSG source files (can paste it here, if you need). I've read somewhere that the order of libraries are important, so I've tried them in the order given by "make":<br><br>g++ terreno1.cpp -Wl,-Bstatic -lOpenThreads -losg -losgUtil -losgDB -losgGA -losgText -losgViewer -losgSim -Wl,-Bdynamic -o terreno1<br><br>and also in the reversed order:<br><br>g++ terreno1.cpp -Wl,-Bstatic -losgSim -losgViewer -losgText -losgGA -losgDB -losgUtil -losg -lOpenThreads -Wl,-Bdynamic -o terreno1<br><br>both with and without -lOpenThreads (which is not required for dynamic compiling). Nothing worked so far.<br><br>Can anyone please tell me what am I doing wrong? My source code can be seen <a href="https://github.com/eco-info/osgCookbook/tree/master/outros/terreno1">here</a>.<br><br>Thanks,<br><br>Rodrigo.<br><br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/eddf2bc1-6a25-4b10-8d1b-3f0e801166ca%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/eddf2bc1-6a25-4b10-8d1b-3f0e801166ca%40googlegroups.com</a>.<br />