wxMSW2.7.0 and unresolved external symbol "int __cdecl wxVsnprintf_

Volker Bartheld dr_versaeg at freenet.de
Wed Sep 27 06:51:31 PDT 2006


Hi!

I recently installed wxMSW2.7.0 (that is, extracting the archive to a
fresh %ProgramFiles%\wxWidgets\, setting the environment variables
%WXDIR% and %WXWIN% accordingly, then opening
%ProgramFiles%\wxWidgets\build\msw\wx.dsw with MSVS.net2005 and batch
building the ANSI and UNICODE Debug and Release static libraries), ended
up with a bunch of *27[ud]*.lib files in
%ProgramFiles%\wxWidgets\lib\vc_lib.

Even building/running some demo applications worked fine. So I started
to do real work and ended up with the following linker error

 log.obj : error LNK2019: unresolved external symbol "int __cdecl wxVsnprintf_(wchar_t *,unsigned int,wchar_t const *,char *)" (?wxVsnprintf_@@YAHPA_WIPB_WPAD at Z) referenced in function "void __cdecl log_err(wchar_t const *,...)" (?log_err@@YAXPB_WZZ)
 C:\test\gui.exe : fatal error LNK1120: 1 unresolved externals

, obviously generated by this function (trimmed a bit):

 void log_err(const wxChar *msg, ...) {
   wxChar buffer[512];
   va_list ap;
   va_start(ap, msg);
   len = wxVsnprintf(buffer, sizeof(buffer)/sizeof(wxChar)-1, msg, ap);
   va_end(ap);
 }

which leaves me a bit helpless. The signature of wxVsnprintf seems
correct and I don't know why wxVsnprintf() request a char* in an
UNCICODE build.

For what it's worth - this is the compiler's command line:

/Od /I "C:\Program Files\wxWidgets\include" /I "C:\Program
Files\wxWidgets\lib/vc_lib/msw" /D "_CRT_SECURE_NO_DEPRECATE" /D
"_CRT_NONSTDC_NO_DEPRECATE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D
"wxUSE_UNICODE=1" /D "_VC80_UPGRADE=0x0710" /D "_UNICODE" /D "UNICODE"
/Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c
/Wp64 /ZI /TP /errorReport:prompt

and here the same for the linker:

/OUT:"C:\test/gui.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST
/MANIFESTFILE:"Debug\gui.exe.intermediate.manifest" /DEBUG
/PDB:"Debug/wxGui.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86
/ERRORREPORT:PROMPT shfolder.lib ws2_32.lib BINMODE.OBJ comctl32.lib
Rpcrt4.lib "C:\Program Files\wxWidgets\lib\vc_lib\wxbase27ud.lib"
"C:\Program Files\wxWidgets\lib\vc_lib\wxbase27ud_net.lib" "C:\Program
Files\wxWidgets\lib\vc_lib\wxbase27ud_xml.lib" "C:\Program
Files\wxWidgets\lib\vc_lib\wxmsw27ud_core.lib" "C:\Program
Files\wxWidgets\lib\vc_lib\wxmsw27ud_html.lib" "C:\Program
Files\wxWidgets\lib\vc_lib\wxmsw27ud_adv.lib" "C:\Program
Files\wxWidgets\lib\vc_lib\wxpngd.lib" "C:\Program
Files\wxWidgets\lib\vc_lib\wxzlibd.lib"  kernel32.lib user32.lib
gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib


Thanks for any input.

Volker
__
Mail replies to/an V B A R T H E L D at G M X dot D E






More information about the wx-users mailing list