michelle1971 / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

Linker Error on Windows #91

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am writing a custom wrapper for this library. I am getting following linker 
any Idea how to fix this ?

logger_api.obj : error LNK2001: unresolved external symbol "int FLAG__n
amespace_do_not_use_directly_use_DECLARE_int32_instead::FLAGS_v" (?FLAGS_v@FLAG_
_namespace_do_not_use_directly_use_DECLARE_int32_instead@@3HA)
libLogger.dll : fatal error LNK1120: 1 unresolved externals

my code is 

extern "C" DLLEXPORT void VerboseLog(const char* app, int opt, const char* 
message) {
    InitLogger(app);
    std::string strMsg = message;
    VLOG(opt) << strMsg;
}

If I comment VLOG line then its working fine. LOG and DLOG working very well 
problem is only with the VLOG.

ANy Idea ???

Original issue reported on code.google.com by jangi...@gmail.com on 8 Jul 2011 at 1:21

GoogleCodeExporter commented 9 years ago
I get this problem too.

I compiled a static glog library, with a static gflags library, and I use these 
two libraries in my project on Windows. VLOG works well when i don't use and 
link the gflags library. However, when i use and link the static gflags 
library, error LNK2001 happens, and FLAGS_v is unresolved.

This problem seems to be accompanied with the gflags library, and I can't 
figure out where should this problem belong to. So I'm looking for some help 
here.

Any help will be appreciated!

Original comment by Aeolus...@gmail.com on 10 Oct 2011 at 3:42

GoogleCodeExporter commented 9 years ago
use definition GOOGLE_GLOG_DLL_DECL=

Original comment by CTapMex@gmail.com on 9 Nov 2011 at 10:40