How can I programatically determine where my C++ runtime libraries are?

前端 未结 2 1412
[愿得一人]
[愿得一人] 2021-01-06 19:17

I\'m building C++11 with GCC 4.8 on CentOS 6 using \"hax\", then deploying on arbitrary CentOS 6 targets (on which anything C++-related out of the box will have been built a

2条回答
  •  無奈伤痛
    2021-01-06 19:59

    In my Makefile:

    GCC_INSTALL_DIR := $(shell $(CXX) -print-search-dirs | grep install | cut -d' ' -f2)
    

    …then my main build target will perform:

    ln -sf $(GCC_INSTALL_DIR)/libstdc++.so $(BIN_DIR)/deps/
    

    …and I can dump everything in $(BIN_DIR)/deps into the right place on install.

    I think.

提交回复
热议问题