Page 1 of 1

Problem with UNICODE, VC6 & PocketFrog's loadimage again

PostPosted: Jan 17, 2007 @ 1:25pm
by lapkos
i built VC6 project with UNICODE definition and
got a linker error coming from PocketFrog:

error LNK2001: unresolved external symbol "class Frog::Surface * __cdecl Frog::LoadImageW...

i added to image.h and image.cpp a function with
another name:

//image.h
Surface* LapLoadImage( const TCHAR* filename );

//image.cpp
Surface* LapLoadImage( const TCHAR* filename )
{

Internal::MemoryFile file( filename );
if (!file.IsOpen())
return 0;

return DecompressImage( file.begin(), file.end() );
}

and rebuilt PocketFrog_x86_Debug.lib.

i built my project again with Frog::LapLoadImage insted of Frog::LoadImage and
got a linker error:

error LNK2001: unresolved external symbol "class Frog::Surface * __cdecl Frog::LapLoadImage(unsigned short const *)...

Why??!!

Help please!!!

PostPosted: Jan 17, 2007 @ 7:31pm
by Presto
After adding the function in image.cpp and image.h, did you rebuild the PocketFrog .lib file, and also link the PocketFrog .lib to your own project?

If you go into Settings for your project, on the Link tab, does it have PocketFrog_x86.lib?

-John

PostPosted: Jan 17, 2007 @ 8:33pm
by lapkos

PostPosted: Jan 18, 2007 @ 12:54am
by Dan East
Something that includes image.h (but not image.cpp) may not have UNICODE defined. Thus TCHAR maps to char, and it is trying to link to Surface* LapLoadImage( const char* filename ).

Make sure you rebuild your entire project, and that UNICODE is defined for all source files (if you are doing that in the project settings).

Dan East

PostPosted: Jan 18, 2007 @ 6:30am
by lapkos
thanks Dan East.

i forgot to define UNICODE in VC6 PoketFrog project.

Many thanks to everyone for their assistance :D