Click here to Skip to main content
16,020,182 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linker error Pin
leon de boer16-Sep-17 3:16
leon de boer16-Sep-17 3:16 
QuestionClarification of Debug/Release mode Pin
ForNow11-Sep-17 2:24
ForNow11-Sep-17 2:24 
AnswerRe: Clarification of Debug/Release mode Pin
Jochen Arndt11-Sep-17 3:21
professionalJochen Arndt11-Sep-17 3:21 
AnswerRe: Clarification of Debug/Release mode Pin
leon de boer11-Sep-17 15:51
leon de boer11-Sep-17 15:51 
GeneralRe: Clarification of Debug/Release mode Pin
ForNow11-Sep-17 15:58
ForNow11-Sep-17 15:58 
GeneralRe: Clarification of Debug/Release mode Pin
leon de boer12-Sep-17 8:33
leon de boer12-Sep-17 8:33 
GeneralRe: Clarification of Debug/Release mode Pin
ForNow12-Sep-17 8:46
ForNow12-Sep-17 8:46 
GeneralRe: Clarification of Debug/Release mode Pin
leon de boer13-Sep-17 18:25
leon de boer13-Sep-17 18:25 
This is one of those things with frameworks is trying to understand what settings and what dependencies are built in the .lib or .dll file you end up with. You can't answer it easily without going on a fishing expedition.

Again I don't use MFC enough to answer this definitively but I will give you want I expect to happen and these days you have the source code to MFC so you can rebuild it any way you want. So lets start the fishing.

If it works like everything else on VS the header file will redirect it to the lib directory for MFC, for VS 2017 that will be
C:\Program Files\Microsoft Visual Studio 14.0\VC\atlmfc\lib on the 32 bit Windows
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\lib on 64 bit Windows

So I go there and I find lots of lib files which I expected. Now if I go up one directory and down to the include directory (I will assume 32 bit windows)
C:\Program Files\Microsoft Visual Studio 14.0\VC\atlmfc\include
Then pull up the main MFC header file afx.h you will see this, which is how they control which library gets used.
#ifndef _AFXDLL
	#ifdef _AFX_NO_MFC_CONTROLS_IN_DIALOGS
		#ifdef _DEBUG
			#pragma comment(lib, "afxnmcdd.lib")
		#else
			#pragma comment(lib, "afxnmcd.lib")
		#endif
		#pragma comment(linker, "/include:__afxNoMFCControlSupportInDialogs")
		#pragma comment(linker, "/include:__afxNoMFCControlContainerInDialogs")
	#endif
	#ifndef _UNICODE
		#ifdef _DEBUG
			#pragma comment(lib, "nafxcwd.lib")
		#else
			#pragma comment(lib, "nafxcw.lib")
		#endif
	#else
		#ifdef _DEBUG
			#pragma comment(lib, "uafxcwd.lib")
		#else
			#pragma comment(lib, "uafxcw.lib")
		#endif
	#endif
#else
	#ifndef _UNICODE
		#ifdef _DEBUG
			#pragma comment(lib, "mfc" _MFC_FILENAME_VER "d.lib")
			#pragma comment(lib, "mfcs" _MFC_FILENAME_VER "d.lib")
		#else
			#pragma comment(lib, "mfc" _MFC_FILENAME_VER ".lib")
			#pragma comment(lib, "mfcs" _MFC_FILENAME_VER ".lib")
		#endif
	#else
		#ifdef _DEBUG
			#pragma comment(lib, "mfc" _MFC_FILENAME_VER "ud.lib")
			#pragma comment(lib, "mfcs" _MFC_FILENAME_VER "ud.lib")
		#else
			#pragma comment(lib, "mfc" _MFC_FILENAME_VER "u.lib")
			#pragma comment(lib, "mfcs" _MFC_FILENAME_VER "u.lib")
		#endif
	#endif
#endif

#ifdef _DLL
	#if defined(_DEBUG)
		#pragma comment(lib, "msvcrtd.lib")
	#else
		#pragma comment(lib, "msvcrt.lib")
	#endif
#else
	#if defined(_DEBUG)
		#pragma comment(lib, "libcmtd.lib")
	#else
		#pragma comment(lib, "libcmt.lib")
	#endif
#endif

Does that answer your question? I am slightly confused about your use of the word SDK, you could mean a number of things.

I just did tried a rebuild on the MFC source and no real problems takes about 30minutes you get lots of this deprecated warning junk .. like these
1>viewhtml.cpp
1>c:\program files\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\atlmfc\include\afxhtml.h(573): warning C4838: conversion from 'long' to 'ULONG' requires a narrowing conversion
1>c:\program files\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\atlmfc\include\afxhtml.h(564): note: while compiling class template member function 'long CHtmlEditCtrlBase<CHtmlEditView>::QueryStatus(long) const'
1>c:\program files\microsoft visual studio 14.0\vc\atlmfc\src\mfc\viewhtml.cpp(1745): note: see reference to function template instantiation 'long CHtmlEditCtrlBase<CHtmlEditView>::QueryStatus(long) const' being compiled
1>c:\program files\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\atlmfc\include\afxhtml.h(1669): note: see reference to class template instantiation 'CHtmlEditCtrlBase<CHtmlEditView>' being compiled
1>viewform.cpp
1>viewedit.cpp
1>viewcore.cpp

So you can build your own MFC .lib but you would need to change the afx.h for it to use a different name. You can also mess around and replace the provided ones with your own .. danger danger Smile | :)
In vino veritas


modified 14-Sep-17 0:48am.

Questionbatch file quicksort algorithm Pin
wayne wu10-Sep-17 16:10
wayne wu10-Sep-17 16:10 
AnswerRe: batch file quicksort algorithm Pin
Richard MacCutchan10-Sep-17 19:24
mveRichard MacCutchan10-Sep-17 19:24 
AnswerRe: batch file quicksort algorithm Pin
CPallini11-Sep-17 2:22
mveCPallini11-Sep-17 2:22 
Questionelaborate the build instructions Pin
Member 125524089-Sep-17 13:05
Member 125524089-Sep-17 13:05 
AnswerRe: elaborate the build instructions Pin
Richard MacCutchan10-Sep-17 4:18
mveRichard MacCutchan10-Sep-17 4:18 
AnswerRe: elaborate the build instructions Pin
CPallini10-Sep-17 5:14
mveCPallini10-Sep-17 5:14 
QuestionHow to #include <string> in C code Pin
Vaclav_9-Sep-17 6:18
Vaclav_9-Sep-17 6:18 
AnswerRe: How to #include <string> in C code Pin
Richard MacCutchan9-Sep-17 6:39
mveRichard MacCutchan9-Sep-17 6:39 
AnswerRe: How to #include <string> in C code Pin
CPallini10-Sep-17 3:03
mveCPallini10-Sep-17 3:03 
Questiondirectx 9 ? Pin
bluatigro6-Sep-17 22:03
bluatigro6-Sep-17 22:03 
SuggestionRe: directx 9 ? Pin
Richard MacCutchan7-Sep-17 4:41
mveRichard MacCutchan7-Sep-17 4:41 
QuestionRe: directx 9 ? Pin
David Crow7-Sep-17 5:12
David Crow7-Sep-17 5:12 
AnswerRe: directx 9 ? Pin
leon de boer7-Sep-17 6:57
leon de boer7-Sep-17 6:57 
QuestionOnce Again Assert in Release and I am lost Pin
ForNow4-Sep-17 13:39
ForNow4-Sep-17 13:39 
QuestionRe: Once Again Assert in Release and I am lost Pin
David Crow4-Sep-17 15:45
David Crow4-Sep-17 15:45 
AnswerRe: Once Again Assert in Release and I am lost Pin
ForNow4-Sep-17 16:01
ForNow4-Sep-17 16:01 
GeneralRe: Once Again Assert in Release and I am lost Pin
leon de boer6-Sep-17 19:09
leon de boer6-Sep-17 19:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.