Home > Back-end >  The consolidation of boost libraries with their own libraries
The consolidation of boost libraries with their own libraries

Time:10-13

Yourself using the boost library wrote a thread library, compile the threading library into static library (the boost threading library static link in), a waring: LNK4221 this object file undefined undefined before any public signs, so any cost this library link operation will not use this file, at the time of use to write your own library, compiler appear to find libboost_thread vc110 - mt - _55 SGD - 1. The lib (compile the runtime - link=/MTD), ask the great spirit

CodePudding user response:

And your library compiled into a DLL can be used, why?

CodePudding user response:

MSDN:
Error message linker tool warning LNK4221
Not found public symbols; Archive members will not visit
Added to the library do not have public symbols. The obj files, including object symbol behind the lib linker operation will be inaccessible,
To solve this warning, please don't will not have public symbols. Obj file link to the library,

(1) the compiler to compile the source file into the assembly code, and then translated into machine instruction by assembler (assembler)
And other related information () after the output to a target file (the object file, VC compiler out
The target file to the default suffix is. Obj); (2) the linker (would) will be one of the target file
(maybe there will be some libraries) linked together to generate a complete executable,
The compiler to compile the source files when the source file global symbol (global symbol) is divided into strong and weak (strong) (weak)
Two types to the compiler, and then the compiler will strength information coding and maintain in the symbol table of the target file,

CodePudding user response:

Wonder if the path of the boost library didn't get through, boost libraries in non-engineering to add the full path, or copy the entire library to the program source code directory, give it a try

CodePudding user response:

reference KFRGHT reply: 3/f
wonder if the path of the boost library didn't get through, boost libraries in non-engineering to add the full path, or copy the entire library to the program source code directory try


To all the library path is added, when compiling boost library to waring: LNK4221 this object file undefined undefined before any public signs, so any cost this library link operation will not use this file;
  • Related