STL and release/debug library mess

前端 未结 4 1794
梦毁少年i
梦毁少年i 2021-02-05 23:23

I\'m using some 3rd party. I\'m using it\'s shared library version, since the library is big (~60MB) and is used by several applications.

Is there a way at application s

4条回答
  •  囚心锁ツ
    2021-02-06 00:08

    This is the sort of check you should be doing in your build system. In your build script,

    • if you're building for release then link against the release library.
    • if you're building for debug then link against the debug library.

    For instance, if you're using make:

    release: $(OBJ)
        $(CC) $(CXXFLAGS_RELEASE) $(foreach LIB,$(LIBS_RELEASE),-l$(LIB))
    debug: $(OBJ)
        $(CC) $(CXXFLAGS_DEBUG) $(foreach LIB,$(LIBS_DEBUG),-l$(LIB))
    

提交回复
热议问题