PocketMatrix forums

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

LNK2005 while using standard include files?

When i'm trying to include Afx.h to use I/O im getting these errors:

uafxwced.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in coredll.lib(COREDLL.dll)
uafxwced.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in coredll.lib(COREDLL.dll)

It seems strange for me that there can be a conflict between 2 standard include/lib files.
eVC++ sometimes gets the linking order screwed up for the various import libs. Go into the project settings, Link tab. Go to the Input category. Add both the libs that are clashing into the "Ignore Libraries" edit box. Then add them to the "Object/library modules" edit box in the correct order. So you could enter "uafxwced.lib coredll.lib" in both boxes and it should work. This problem has been around since 1997. I wasted several days trying to correct that freaking problem way back when.

Dan East
Daywalker · 18 Feb 2002, 21:46 UTC — Thanx
Thank you very much, its working now. :P
But I've yet another question: I'm testing my game on the emulator, but what will happen if I'm e.g. trying to load an picture? Will the emulator search in my project folder on the the virtual device? 8O
The emulator's filesystem behaves just like a real Pocket PC's. All filenames have to specify full, absolute, paths. The path on my laptop to the emulator's filesystem is:
D:\Windows CE Tools\wce300\MS Pocket PC\emulation\palm300

Thus that directory is the root \ of the Pocket PC emulator, and everything else is relative to it.

Dan East
I just re-read your post. The project folder in which your sources and builds reside have nothing to do with the emulator. After each sucessfull build of an EXE it is copied into the \windows\start menu directory of the emulator by default. You must manually copy any external files (besides DLLs) over to the emulator.

Dan East
Again thanks for the fast response. Now only 1 last (propably very dumb) question:
How to copy an char to WCHAR? This here had crashed:
wcscpy (wcharfilename, TEXT("%s",charfilename));