Fixing one final compiler error

Posted by Worstje on Wed 15 Sep 2010 07:39 AM — 5 posts, 28,928 views.

Netherlands #0
Heya,

I'm trying to get the stuff to compile under VS2010, and so far stuff seems awesome compared to the last failed attempt on my part, which was basically pre-Twisol. :)

The error I'm trying to figure out is...

nafxcwd.lib(afxglobals.obj) : error LNK2005: "public: virtual __thiscall CMemDC::~CMemDC(void)" (??1CMemDC@@UAE@XZ) already defined in TreePropertySheet.obj


I saw this error at one or two other spots on the internet, but saw no clear solution there either.

Anyone here have a clue?
Amended on Wed 15 Sep 2010 08:38 AM by Worstje
USA #1
It looks like a CMemDC class is defined in VS2008's MFC Feature Pack. [1] I imagine that's causing conflicts. Try removing the CMemDC class from TreePropertySheet.h and see if that fixes it for you?

[1] http://msdn.microsoft.com/en-us/library/cc308997(v=VS.90).aspx
Netherlands #2
Ayup, that explains it.

I moved the CMemDC defined in the TreePropertySheet.h to be an innerclass of the only class it is ever used in, and the error went away.

Once I figure out how git works a bit better, I'll see about sending stuff up the stream.

Btw, what happened to the warnings cleanup project? I know Twisol cleaned tons of those in the past, but a simple compile is madness to look at, quite likely impeding productivity when working through the code.
Amended on Wed 15 Sep 2010 08:34 AM by Worstje
#3
this may help
http://codeguru.earthweb.com/forum/showthread.php?p=1995583
Australia Forum Administrator #4
Thanks for the link. Although I have to say I don't get any errors or warnings.

Quote:

Btw, what happened to the warnings cleanup project?


Well it is hard for me to do because I don't get them. If you submit pragmas that you would like placed in the source to get rid of warnings you get but I don't, I don't see a big problem with that.