简体   繁体   中英

How to “guess” which libraries are missing?

The problem is purely academic, so the following is just an example; if I add two slashes in front of this line

#pragma comment(lib, "../node-src/Release/node")

I'll get the dozen linker errors. Well not really dozen, but at least 2-3 lines looking like this

1>test.obj : error LNK2001: unresolved external symbol "public: static class 
v8::Local<class v8::String> __cdecl v8::String::New(char const *,int)" 
(?New@String@v8@@SA?

Now I know most requirements are in the specs, but is there a way to know what files is really the linker missing? I mean if I were to replace that #pragma directive with regular includes, what steps should I take?

Quite simply, the answer is that there's no easy way to tell what files the linker is missing. All it knows is what symbols it's searching for not what library file you need to include. Afterall, you could define those symbols in any library you like in any location you want to as long as you tell the linker where to search for it.

If you have a bunch of potential libraries, you could use something like Lib.exe as per this post on SO to search for matching symbols and then try pointing the linker at those files but again, there's no way to get the linker to find this information for you..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM