From 0d5d1f5ff29dea27668acc9a76dfb6a2cb7cad36 Mon Sep 17 00:00:00 2001 From: Saran Tunyasuvunakool Date: Mon, 4 Apr 2022 19:43:58 +0100 Subject: [PATCH] Add `-Wl,-no-as-needed` to Linux Makefile. GCC's linker drops dependency on libGL because neither MuJoCo, GLFW, nor the sample applications themselves explicitly depend on OpenGL symbols. PiperOrigin-RevId: 439372170 Change-Id: I122d1d9658484e901f422d35395ad5929c7a9021 --- sample/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample/Makefile b/sample/Makefile index 900f48d1df..719d739ea3 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -2,7 +2,7 @@ # which is commonly available through your distro's package manager. # On Debian and Ubuntu, GLFW can be installed via `apt install libglfw3-dev`. -COMMON=-O2 -I../include -L../lib -std=c++11 -pthread -Wl,-rpath,'$$ORIGIN'/../lib +COMMON=-O2 -I../include -L../lib -std=c++11 -pthread -Wl,-no-as-needed -Wl,-rpath,'$$ORIGIN'/../lib all: $(CXX) $(COMMON) testxml.cc -lmujoco -o ../bin/testxml