New submission from Liu Cailiang: Following is the executed command line (g++ version 5): g++ -pthread -shared -L/conda/lib -Wl,-rpath=/conda/lib,--no-as-needed /tmp/tmp0lfzn4v9/home/ubuntu/pybind11_opencv_numpy/ndarray_converter.o /tmp/tmp0lfzn4v9/home/ubuntu/pybind11_opencv_numpy/.rendered.cpy.o -L/conda/lib -lopencv_core -lopencv_imgproc -lopencv_imgcodecs -lopencv_video -lopencv_videoio -lopencv_objdetect -lm -lz -lpython3.6m -o /tmp/tmp0lfzn4v9/cpy.cpython-36m-x86_64-linux-gnu.so -Wl,--as-needed -O3 -Wall
If -Wl,--as-needed -O3 -Wall is before the .o files, the extra_args work. ---------- components: Installation messages: 298024 nosy: Liu Cailiang priority: normal severity: normal status: open title: distutils extra_link_args not working because it is added to cmd last. should before -llibs type: behavior versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30889> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com