Andrew7Webb

I have an application that uses gdiplus that I'm building on Vista with Orcas beta 1.

I link and get an error LNK2019: unresolved external symbol

Gdiplus::Image::Image(wchar_t const *,int)

Yes, I put gdiplus.lib in the lInker | Input section of the project.

There is more trace below, but I am confused about a number of things:

1) Why did the linker find some of the gdiplus symbols, like _GdiplusStartup, but not others

2) What are the differences between the GdiPlus.lib files in

c:\program files\Microsoft SDKs\Windows\v6.0 (218K) and in

c:\program files\Microsoft Visual Studio 9.0\VC\PlatformSDK (202K)

Any help will be appreciated.

1>------ Build started: Project: Canvas, Configuration: Debug Win32 ------

1>Compiling...

1>canvas_all.cpp

1>Linking...

1>Starting pass 1

1>Processed /DEFAULTLIB:uuid.lib

1>Processed /DEFAULTLIB:Comdlg32.lib

1>Processed /DEFAULTLIB:comctl32.lib

1>Processed /DEFAULTLIBTongue TiedmartWinD.lib

1>Processed /DEFAULTLIB:libcpmtd

1>Processed /DEFAULTLIB:gdiplus.lib

1>Processed /DEFAULTLIB:LIBCMTD

1>Processed /DEFAULTLIBSurpriseLDNAMES

1>Searching libraries

1> Searching C:\Program Files\Microsoft SDKs\Windows\v6.0\\lib\gdiplus.lib:

1> Found _GdiplusStartup@12

1> Referenced in canvas_all.obj

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found _GdipCreatePen1@16

1> Referenced in canvas_all.obj

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found _GdipDeletePen@4

1> Referenced in canvas_all.obj

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found _GdipCreateFromHDC@8

1> Referenced in canvas_all.obj

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found _GdipDeleteGraphics@4

1> Referenced in canvas_all.obj

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found _GdipDrawLineI@24

1> Referenced in canvas_all.obj

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found _GdipDrawImageI@16

1> Referenced in canvas_all.obj

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found _GdiplusShutdown@4

1> Referenced in canvas_all.obj

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found __IMPORT_DESCRIPTOR_gdiplus

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found __NULL_IMPORT_DESCRIPTOR

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Loaded gdiplus.lib(gdiplus.dll)

1> Found gdiplus_NULL_THUNK_DATA

1> Referenced in gdiplus.lib(gdiplus.dll)

1> Loaded gdiplus.lib(gdiplus.dll)

....

1> Searching C:\Program Files\Microsoft SDKs\Windows\v6.0\\lib\gdiplus.lib:

1> Searching C:\Program Files\Microsoft SDKs\Windows\v6.0\\lib\kernel32.lib:

1> Searching C:\Program Files\Microsoft SDKs\Windows\v6.0\\lib\user32.lib:

1>Finished searching libraries

1>Finished pass 1

1>Generating non-SAFESEH image.

1>Invoking CVTRES.EXE:

1> /machine:x86

1> /verbose

1> /out:"C:\Users\awebb\AppData\Local\Temp\lnk20D1.tmp"

1> /readonly

1> ".\Debug\Canvas.exe.embed.manifest.res"

1>Microsoft (R) Windows Resource To Object Converter Version 9.00.20404

1>Copyright (C) Microsoft Corporation. All rights reserved.

1>adding resource. type:MANIFEST, name:1, language:0x0409, flags:0x30, size:406

1>canvas_all.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Gdiplus::Image::~Image(void)" ( 1Image@Gdiplus@@UAE@XZ) referenced in function "private: void __thiscall CanvasWidget::GdiPlus(struct HDC__ *,int,int,int,int)" ( GdiPlus@CanvasWidget@@AAEXPAUHDC__@@HHHH@Z)

1>canvas_all.obj : error LNK2019: unresolved external symbol "public: unsigned int __thiscall Gdiplus::Image::GetWidth(void)" ( GetWidth@Image@Gdiplus@@QAEIXZ) referenced in function "private: void __thiscall CanvasWidget::GdiPlus(struct HDC__ *,int,int,int,int)" ( GdiPlus@CanvasWidget@@AAEXPAUHDC__@@HHHH@Z)

1>canvas_all.obj : error LNK2019: unresolved external symbol "public: enum Gdiplus:Tongue Tiedtatus __thiscall Gdiplus::Bitmap:Tongue TiedetPixel(int,int,class Gdiplus::Color const &)" ( SetPixel@Bitmap@Gdiplus@@QAE AW4Status@2@HHABVColor@2@@Z) referenced in function "private: void __thiscall CanvasWidget::GdiPlus(struct HDC__ *,int,int,int,int)" ( GdiPlus@CanvasWidget@@AAEXPAUHDC__@@HHHH@Z)

1>canvas_all.obj : error LNK2019: unresolved external symbol "public: __thiscall Gdiplus::Bitmap::Bitmap(int,int,class Gdiplus::Graphics *)" ( 0Bitmap@Gdiplus@@QAE@HHPAVGraphics@1@@Z) referenced in function "private: void __thiscall CanvasWidget::GdiPlus(struct HDC__ *,int,int,int,int)" ( GdiPlus@CanvasWidget@@AAEXPAUHDC__@@HHHH@Z)

1>canvas_all.obj : error LNK2019: unresolved external symbol "public: __thiscall Gdiplus::Image::Image(wchar_t const *,int)" ( 0Image@Gdiplus@@QAE@PB_WH@Z) referenced in function "private: void __thiscall CanvasWidget::GdiPlus(struct HDC__ *,int,int,int,int)" ( GdiPlus@CanvasWidget@@AAEXPAUHDC__@@HHHH@Z)

1>Debug/Canvas.exe : fatal error LNK1120: 5 unresolved externals

1>Build log was saved at "file://c:\src2007\c++\win32\gui\SmartWin\tests\Canvas\Debug\BuildLog.htm"

1>Canvas - 6 error(s), 0 warning(s)

========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========



Re: Visual C++ 2008 (Pre-release) Perplexed why gdiplus classes are unresolved external symbol in Orcas on Vista

Marian Luparu

Hi Andrew,

I've seen this error before on other functions when using mismatched versions of headers and libs. Can you check that you are:

- including the headers from the Vista SDK

- have the right WINVER (set it to 0x0600 if not sure)

- libs are also referenced from the Vista SDK

Hope this fixes your problem.

Marian Luparu
Visual C++ IDE





Re: Visual C++ 2008 (Pre-release) Perplexed why gdiplus classes are unresolved external symbol in Orcas on Vista

Andrew7Webb

I think you are on the right track.

Microsoft Visual Studio 9.0 is Orcas, whereas Microsoft Visual Studio 8.0 is VS 2005 I believe.

How I have references to "Microsoft Visual Studio 8.0" is a mystery to me since

I only downloaded Orcas on to this Vista PC.

Is this normal for a Orcas download, or am I messed up

07/02/2007 11:54 AM <DIR> Microsoft SDKs

07/02/2007 11:49 AM <DIR> Microsoft Visual Studio 8
07/02/2007 11:52 AM <DIR> Microsoft Visual Studio 9.0

Using the Visual Studio Codename Orcas Command Prompt:

c:\Program Files\Microsoft Visual Studio 9.0\VC>set

DevEnvDir=c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

FrameworkSDKDir=C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\

FrameworkVersion=v2.0.50727

INCLUDE=c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;c:\Progra

m Files\Microsoft Visual Studio 9.0\VC\INCLUDE;C:\Program Files\Microsoft Visual

Studio 8\SDK\v2.0\include;C:\Program Files\Microsoft SDKs\Windows\v6.0\include;

LIB=c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;c:\Program Files\

Microsoft Visual Studio 9.0\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SD

K\v2.0\lib;C:\Program Files\Microsoft SDKs\Windows\v6.0\lib;

LIBPATH=c:\Windows\Microsoft.NET\Framework\v3.5.20404;c:\Windows\Microsoft.NET\F

ramework\v2.0.50727;c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;c

:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;

Path=c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;c:\Program Files\M

icrosoft Visual Studio 9.0\VC\BIN;c:\Program Files\Microsoft Visual Studio 9.0\C

ommon7\Tools;c:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\bin;c:\W

indows\Microsoft.NET\Framework\v3.5.20404;c:\Windows\Microsoft.NET\Framework\v2.

0.50727;c:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages;C:\Program Fi

les\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\Program Files\Microsoft SDKs\Windo

ws\v6.0\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program F

iles\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Sh

ared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;c:\Pro

gram Files\Microsoft SQL Server\90\Tools\binn\

VCINSTALLDIR=c:\Program Files\Microsoft Visual Studio 9.0\VC

VSINSTALLDIR=c:\Program Files\Microsoft Visual Studio 9.0

WinSDKFolder=C:\Program Files\Microsoft SDKs\Windows\v6.0\

c:\Program Files\Microsoft Visual Studio 9.0\VC>

Options | Projects and Solutions | VC++ Directories

INCLUDES LIB

$(VCInstallDir)include $(VCInstallDir)lib

$(VCInstallDir)atlmfc\include $(VCInstallDir)atlmfc\lib

$(VCInstallDir)atlmfc\lib\i386

$(WindowsSdkDir)include $(WindowsSdkDir)\lib

$(FrameworkSDKDir)include $(FrameworkSDKDir)lib

$(VCInstallDir)

$(VCInstallDir)lib





Re: Visual C++ 2008 (Pre-release) Perplexed why gdiplus classes are unresolved external symbol in Orcas on Vista

Jerry Goodwin

There are a small number of components that are shared between VS 2005 and Orcas. They have to be installed in the same folders that were used for VS 2005, so you will see some '8.0' or '80' files or folders in a clean Orcas install. These are mostly minor dlls or headers that were not changing between the two releases.

You might be running into an inconsistency in the versioning for some file, but simply seeing some files that look like they're from VS 2005 is not unexpected. If a header or lib is referring to an 80 component that's being shipped as a 90 component or vice-versa, then please let us know since we'll need to make sure that gets fixed.






Re: Visual C++ 2008 (Pre-release) Perplexed why gdiplus classes are unresolved external symbol in Orcas on Vista

Andrew7Webb

I finally fixed this problem by reinstalling the factory shipped Vista image and installing Orcas Beta 2. (I could not install Beta 2 once Beta 1 was loaded)