This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Odd Linker error...just a bit of help needed.


Odd Linker error...just a bit of help needed.

Postby Codejoy » Sep 9, 2003 @ 5:25pm

Okay I think I am just not following something 100% but i added a class from my old C++ program I had... and put it into a embedded visual C++ project. The class used some mfc stuff like CPoint, CList, and CRect...so I added in the various .h files for the class to work those were:

"afxwin.h"
"afxtempl.h"

These two things then get the new class to compile with my other project (keep in mind it was compiling and linking just fine before) but now even though it compiles I get the following linker errors:

--------------------Configuration: Simple - Win32 (WCE ARM) Release--------------------
Compiling...
Gesture.cpp
Linking...
uafxwce.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in coredll.lib(COREDLL.dll)
uafxwce.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in coredll.lib(COREDLL.dll)
uafxwce.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in coredll.lib(COREDLL.dll); second definition ignored
uafxwce.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in coredll.lib(COREDLL.dll); second definition ignored
Creating library ..\Bin/3dTest.lib and object ..\Bin/3dTest.exp
..\Bin/3dTest.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

3dTest.exe - 3 error(s), 2 warning(s)

I assume I have the wrong.h or the wrong .dll in the project, but I cannot figure out exactly whats going on...yes i know it says in coredll.lib but I do believe i need that in there...plus it puzzles me that the linker errors are on standard syntax stuff like new and delete.

So what piece of this puzzle am I missing? Any help would be greatly appreciated...I really hate linker errors sometimes..
Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


Postby angedelamort » Sep 9, 2003 @ 6:15pm

User avatar
angedelamort
pm Member
 
Posts: 304
Joined: Mar 7, 2002 @ 11:16pm
Location: Montreal, Quebec


libs

Postby Codejoy » Sep 9, 2003 @ 6:21pm

Well the only thing I changed to the project was added a .cpp and .h file that require the use of some other MFC functions, so in these new .cpp and .h files I added i had them incldue:

afxwin.h
-and-
afxtempl.h

So that this new .cpp and .h file I added to the project may compile, it does but I now get a linker error, so including the above .h files result in a linker error. I didnt touch what the default libs were in the project settings but the list that is there now is:

commctrl.lib
coredll.lib and
aygshell.lib

So that is why its odd that including the above afx*.h files now result in a linker error.

Strange
Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


Postby Pejo Software - Per » Sep 9, 2003 @ 7:05pm

User avatar
Pejo Software - Per
pm Insider
 
Posts: 343
Joined: Apr 25, 2002 @ 1:00pm
Location: Mölndal, Sweden


I thank thee.

Postby Codejoy » Sep 9, 2003 @ 7:22pm

Thanks a lot, i read the article, messed around with it and finally got it to work (i hope the code still compiles and runs now).

I thank you, kudos to those that can actually navigate the mother of the site that is MSDN.
Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum