Link libraries with dependencies in Visual C++ without getting LNK4006

后端 未结 9 1945
难免孤独
难免孤独 2020-12-16 10:56

I have a set of statically-compiled libraries, with fairly deep-running dependencies between the libraries. For example, the executable X uses libraries A and B, A uses libr

9条回答
  •  春和景丽
    2020-12-16 11:35

    This may not fix your link error, but it might help with your dependency tree issue.

    What I do, is just use a #pragma to include a lib in the .cpp file that needs it. For example:

    #pragma comment(lib:"wsock32") 
    

    Like I said, I'm not sure it would keep the symbols in that object file, I'd have to whip up an example to try it out.

提交回复
热议问题