unresolved external symbol _GdipGetDC@8

Money Manager Ex Development related posts for both Android and Desktop

Moderator: Renato

Post Reply
mbluett
New MMEX User
Posts: 3
Joined: Tue Nov 24, 2009 12:33 am
Are you a spam bot?: No

unresolved external symbol _GdipGetDC@8

Post by mbluett »

I am using VS2008 C++ Express Edition with .NET 3.5 installed.

I downloaded wxPack from Sourceforge and placed it in "C:\Programming\wxWidgets2.8" (This is v 2.8.9).

I configured VS2008 as follows:

* Changed "Configuration" to "Unicode Debug Multilib WX_PYTHON_0"
* Right-clicked on "mmex" (in the Solution Explorer) and chose Properties
* Expanded "Configuration Properties"
* Expanded "Linker"
* Clicked on "Input"
* Add "libcmtd, msvcrt, msvcprtd" to "Ignore Specific Library"
* Expanded "Configuration Properties"
* Expanded "C/C++"
* Clicked on "General"
* Changed all occurances of ${WXWIN} to the path where wxWidgets is installed (Didn't want to create an environment variable)
* Did the same with "Linker" and "Resources"
* Clicked on "Code Generation"
* Changed "Runtime Library" to "Multi-threaded Debug" (from ""Multi-threaded Debug DLL")

The C++ commandline:

/O2 /I "C:\Programming\wxWidgets2.8\lib\vc_lib\mswu" /I "C:\Programming\wxWidgets2.8\include" /I "..\..\include" /I "..\..\sqlite" /D "WIN32" /D "_UNICODE" /D "__WXMSW__" /D "NDEBUG" /D "NOPCH" /D "WXSQLITE3_HAVE_CODEC" /D "WXSQLITE3_HAVE_METADATA" /D "TIXML_USE_STL" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0710" /D "UNICODE" /FD /EHsc /MTd /Fo"vc-static-u\mmex\\" /Fd"vc-static-u\mmex.pdb" /W4 /nologo /c /TP /errorReport:prompt

The Linker commandline:

/OUT:"vc-static-u\mmex.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Programming\wxWidgets2.8\lib\vc_lib" /MANIFEST /MANIFESTFILE:"vc-static-u\mmex\mmex.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"libcmt" /NODEFAULTLIB:"msvcrt" /NODEFAULTLIB:"msvcprtd" /PDB:"vc-static-u\mmex.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /MACHINE:X86 /ERRORREPORT:PROMPT wxmsw28u_core.lib wxmsw28u_qa.lib wxbase28u_net.lib wxmsw28u_html.lib wxbase28u_xml.lib wxmsw28u_aui.lib wxmsw28u_adv.lib wxbase28u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib vc-static-u\sqlite3.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

After doing a Rebuild All, I get the following errors:

wxmsw28u_core.lib(corelib_renderer.obj) : error LNK2019: unresolved external symbol _GdipGetDC@8 referenced in function "public: struct HDC__ * __thiscall Gdiplus::Graphics::GetHDC(void)" (?GetHDC@Graphics@Gdiplus@@QAEPAUHDC__@@XZ)
wxmsw28u_core.lib(corelib_renderer.obj) : error LNK2019: unresolved external symbol _GdipReleaseDC@8 referenced in function "public: void __thiscall Gdiplus::Graphics::ReleaseHDC(struct HDC__ *)" (?ReleaseHDC@Graphics@Gdiplus@@QAEXPAUHDC__@@@Z)
wxmsw28u_core.lib(corelib_graphics.obj) : error LNK2019: unresolved external symbol _GdipFree@4 referenced in function "public: static void __cdecl Gdiplus::GdiplusBase::operator delete(void *)" (??3GdiplusBase@Gdiplus@@SAXPAX@Z)
wxmsw28u_core.lib(corelib_graphics.obj) : error LNK2019: unresolved external symbol _GdipAlloc@4 referenced in function "public: static void * __cdecl Gdiplus::GdiplusBase::operator new(unsigned int)" (??2GdiplusBase@Gdiplus@@SAPAXI@Z)

There is error list includes a number of others that I deleted for brevity. If I can find a solution for these 4 the others will be fixed as well.

The "wxmsw28u_core.lib" file does contain a reference to _GdipGetDC@8 (for example).

Any ideas why these errors are occurring?
Vadim
Super MMEX User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: unresolved external symbol _GdipGetDC@8

Post by Vadim »

The simplest way to compile mmex is download latest wxWidgets sources (2.8.10) and compile them using your C++ compiler. Just open build\msw\wx.sln in IDE, select right build target and build the library. You do not need to do any modifications in mmex's project, this is mistake, don't do that.
mbluett
New MMEX User
Posts: 3
Joined: Tue Nov 24, 2009 12:33 am
Are you a spam bot?: No

Re: unresolved external symbol _GdipGetDC@8

Post by mbluett »

Why bother compiling the wxWidgets source when all I have to do is download the pre-compiled wxWidgets (called wxPack from Sourceforge) which is what I did. wxPack comes with all the library types already compiled (.dlls, .libs in unicode and ansi versions).

I don't see how compiling wxWidgets myself is going to resolve a problem like this.
mbluett
New MMEX User
Posts: 3
Joined: Tue Nov 24, 2009 12:33 am
Are you a spam bot?: No

Re: unresolved external symbol _GdipGetDC@8

Post by mbluett »

Vadim, I decided to take your suggestion and compile it myself and it worked. I don't understand why, but anyway thanks for getting me on the right track.

However, I wish I did understand these things as compilations are such a shooting match!!! Is there ever going to come a time when you don't have to be a "Rocket Scientist" to compile a program?
Vadim
Super MMEX User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: unresolved external symbol _GdipGetDC@8

Post by Vadim »

This program is VERY simple, so no problems to compile one from sources. I didn't use wxPack and do not want to do that because there are no problems to compile wxWidgets yourself :-)
Post Reply