Static Library path nightmare from hell

前端 未结 5 1604
天命终不由人
天命终不由人 2021-02-07 12:22

This is the point. I have a subproject (static library) created. The library compiles well. No errors. When I include this library inside a project and imports a header from tha

5条回答
  •  广开言路
    2021-02-07 12:56

    Regarding script to show you env variables, here's how I do it (open images at the new tab for better scaling):

    • Added dummy shell script

    enter image description here

    • Observed its output at Log Navigator

    enter image description here

    enter image description here

    enter image description here


    As you can see, BUILT_PRODUCTS_DIR doesn't have any headers copied from the library. Either put headers there manually (strongly not recommended) or add search path to the location that you know the headers must be at:

    enter image description here enter image description here

    Now as there were two headers cocos2d.h and MyStaticLibrary.h, cocos2d.h was successfully imported although it will have additional dependency.

    The path ../MyStaticLibrary/build/$(BUILD_STYLE)-$(PLATFORM_NAME) will also (recursively) have public headers of the library.

提交回复
热议问题