PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Problem with compiling sample for ARM&VS2005

Problem with compiling sample "Alpha" for ARM in VS2005
Error 1 error LNK2019: unresolved external symbol SHLoadImageFile referenced in function "class Frog::Surface * __cdecl Frog::LoadImageW(wchar_t const *)" (?LoadImageW@Frog@@YAPAVSurface@1@PB_W@Z) PocketFrog_ARM.lib
Error 2 error LNK2019: unresolved external symbol SHLoadImageResource referenced in function "class Frog::Surface * __cdecl Frog::LoadImageW(unsigned int,wchar_t const *,struct HINSTANCE__ *)" (?LoadImageW@Frog@@YAPAVSurface@1@IPB_WPAUHINSTANCE__@@@Z) PocketFrog_ARM.lib
Error 3 fatal error LNK1120: 2 unresolved externals Pocket PC 2003


if compiling for x86 all ok.
and if comment m_picture = LoadImage(display, IDB_BITMAP1);
all works fine.
The problem is with LoadImage(). The name "LoadImage" is also a Win32 macro defined to either LoadImageA or LoadImageW depending on whether you use ascii or unicode characters.

What I usually do to work around this is include windows headers first, then undefined LoadImage and then include PocketFrog headers:

Code:

#include <windows.h>
#undef LoadImage
#include <PocketFrog.h>


Note that if you get it wrong everywhere, it should still work. But if you get ir right in certain spots and not others, you will get that error.

Your linker is saying it can't find LoadImageW. So you must be using unicode. PocketFrog's function is named LoadImage (notice: no W). That's why it can't find it.
Thanks. To me have already advised to add
#pragma comment(lib, "Aygshell.lib")
and it has helped, your variant did not try, but I think it too will help.

Thanks.