Click here to Skip to main content
15,903,856 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TCF Eclipse users please reply Pin
Richard MacCutchan21-Sep-17 21:00
mveRichard MacCutchan21-Sep-17 21:00 
QuestionDoubly Linked List Pin
kinderu16-Sep-17 23:17
kinderu16-Sep-17 23:17 
AnswerRe: Doubly Linked List Pin
Richard MacCutchan17-Sep-17 1:49
mveRichard MacCutchan17-Sep-17 1:49 
AnswerRe: Doubly Linked List Pin
leon de boer17-Sep-17 4:42
leon de boer17-Sep-17 4:42 
AnswerRe: Doubly Linked List Pin
Jochen Arndt17-Sep-17 21:45
professionalJochen Arndt17-Sep-17 21:45 
QuestionSolution access internet by proxy server c++ Pin
Con Cop Con13-Sep-17 19:22
Con Cop Con13-Sep-17 19:22 
AnswerRe: Solution access internet by proxy server c++ Pin
jschell18-Sep-17 12:32
jschell18-Sep-17 12:32 
QuestionLinker error Pin
Vaclav_12-Sep-17 15:53
Vaclav_12-Sep-17 15:53 
AnswerRe: Linker error Pin
Richard MacCutchan12-Sep-17 19:12
mveRichard MacCutchan12-Sep-17 19:12 
AnswerRe: Linker error Pin
CPallini13-Sep-17 1:25
mveCPallini13-Sep-17 1:25 
GeneralRe: Linker error Pin
Vaclav_13-Sep-17 3:14
Vaclav_13-Sep-17 3:14 
GeneralRe: Linker error Pin
leon de boer13-Sep-17 4:02
leon de boer13-Sep-17 4:02 
GeneralRe: Linker error Pin
jschell13-Sep-17 8:23
jschell13-Sep-17 8:23 
AnswerRe: Linker error Pin
Jochen Arndt13-Sep-17 4:14
professionalJochen Arndt13-Sep-17 4:14 
GeneralRe: Linker error Pin
Vaclav_13-Sep-17 9:05
Vaclav_13-Sep-17 9:05 
GeneralRe: Linker error Pin
Jochen Arndt14-Sep-17 3:38
professionalJochen Arndt14-Sep-17 3:38 
GeneralRe: Linker error Pin
leon de boer15-Sep-17 22:21
leon de boer15-Sep-17 22:21 
GeneralRe: Linker error Pin
Vaclav_16-Sep-17 3:02
Vaclav_16-Sep-17 3:02 
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 
No the VC and MFC runtime libraries. Pull up control panel and go to the installed apps and features and roll to to Microsoft Visual C++. You will have a pile of things labelled as Visual Studio VC++ xxxx redistributable. Those are the same junk you have to package up with you EXE file when you go to place it on a new machine. All they are doing is trying to reduce the footprint of the EXE file itself by sitting it on a runtime library. It's the same as what Visual Basic does with it's runtime libraries and if I wanted to use Visual Basic I would write in Visual Basic not C++. Those redistributable libraries quite often develop bugs with new versions of Windows you notice you have to install them for every windows version you have a program written for. On my machine I have so many versions ... 2005, 2 x 2008, 2010, 2 x 2012, 2013, 2015, 2017

Using the settings I gave you the you create statically linked executable it flattens the EXE to only use the physical standard windows API in static linking. It means the EXE does not need anything else you can install it on a new Windows machine that has never seen a VC++ xxxx redistributable. The cost is it can be slower to compile because what looks like a minor change may setup big changes to what it does on code to the windows API and the EXE size will be some percentage bigger. As a guide my largest CAD program I make which is close to a million lines makes an EXE just over 3MBytes so it really isn't that dramatic.

There used to be a problem with console apps where they would call out to the library but even that changed since Windows 7. The trick is you don't actually build a console app, you build a windows app and then call AllocConsole. The thing you end up with on screen looks and behaves like a console APP, but underneath they are very different. You will note the only attachment of the virtual console is kernel32.dll via kernel32.lib Smile | :)
AllocConsole function - Windows Console | Microsoft Docs[^]
To make life interesting on Windows 10 they also allow users to bring up the old legacy console with an executable.
Windows 10 Command Prompt: New Console vs. Legacy Console[^]
One of the jobs I always do on Windows 10 is throw a program error if some fiddler sets that thing as it makes things unstable.

There are two caveats
- All libraries the executable is linked to have to be compiled with the same setting. So if you are using 3rd party libraries you need to rebuild those entire libraries as well.
- Compiling shared libraries (DLL) with this static linking will sometimes throw up multiple definitions. It used to be a pain it isn't anymore because they introduced an number of linker and section controls which make it rather trivial now.
In vino veritas


modified 12-Sep-17 14:45pm.

GeneralRe: Clarification of Debug/Release mode Pin
ForNow12-Sep-17 8:46
ForNow12-Sep-17 8:46 

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.