Click here to Skip to main content
13,147,344 members (26,371 online)

C / C++ / MFC

 
PinnedHOW TO ANSWER A QUESTION Pin
Chris Maunder12-Jul-09 22:37
adminChris Maunder12-Jul-09 22:37 
PinnedHOW TO ASK A QUESTION Pin
Chris Maunder12-Feb-09 17:19
adminChris Maunder12-Feb-09 17:19 
QuestionHelp with no default constructor message Pin
ForNow6hrs 36mins ago
memberForNow6hrs 36mins ago 
AnswerRe: Help with no default constructor message Pin
Richard MacCutchan4hrs 33mins ago
protectorRichard MacCutchan4hrs 33mins ago 
QuestionProblem in loading c run time library in Visual C++ Pin
Member 1192324422-Sep-17 3:28
memberMember 1192324422-Sep-17 3:28 
AnswerRe: Problem in loading c run time library in Visual C++ Pin
Jochen Arndt22-Sep-17 3:45
mvpJochen Arndt22-Sep-17 3:45 
GeneralRe: Problem in loading c run time library in Visual C++ Pin
Member 1192324422-Sep-17 4:02
memberMember 1192324422-Sep-17 4:02 
GeneralRe: Problem in loading c run time library in Visual C++ Pin
enhzflep22-Sep-17 7:42
memberenhzflep22-Sep-17 7:42 
QuestionSyntax error Pin
Vaclav_Sal21-Sep-17 15:28
memberVaclav_Sal21-Sep-17 15:28 
AnswerRe: Syntax error Pin
leon de boer21-Sep-17 16:28
memberleon de boer21-Sep-17 16:28 
GeneralRe: Syntax error Pin
Vaclav_Sal21-Sep-17 17:02
memberVaclav_Sal21-Sep-17 17:02 
AnswerRe: Syntax error Pin
Richard MacCutchan21-Sep-17 21:08
protectorRichard MacCutchan21-Sep-17 21:08 
GeneralRe: Syntax error Pin
Vaclav_Sal22-Sep-17 7:00
memberVaclav_Sal22-Sep-17 7:00 
AnswerRe: Syntax error Pin
Richard MacCutchan22-Sep-17 7:04
protectorRichard MacCutchan22-Sep-17 7:04 
AnswerRe: Syntax error Pin
jschell22-Sep-17 8:44
memberjschell22-Sep-17 8:44 
GeneralRe: Syntax error Pin
Richard MacCutchan22-Sep-17 21:33
protectorRichard MacCutchan22-Sep-17 21:33 
Questionuser name in system service Pin
john563220-Sep-17 19:31
memberjohn563220-Sep-17 19:31 
AnswerRe: user name in system service Pin
Jochen Arndt20-Sep-17 21:25
mvpJochen Arndt20-Sep-17 21:25 
QuestionTCF Eclipse users please reply Pin
Vaclav_Sal20-Sep-17 13:39
memberVaclav_Sal20-Sep-17 13:39 
AnswerRe: TCF Eclipse users please reply Pin
Richard MacCutchan20-Sep-17 21:31
protectorRichard MacCutchan20-Sep-17 21:31 
GeneralRe: TCF Eclipse users please reply Pin
Vaclav_Sal21-Sep-17 13:06
memberVaclav_Sal21-Sep-17 13:06 
GeneralRe: TCF Eclipse users please reply Pin
Richard MacCutchan21-Sep-17 21:00
protectorRichard MacCutchan21-Sep-17 21:00 
QuestionDoubly Linked List Pin
kinderu16-Sep-17 23:17
memberkinderu16-Sep-17 23:17 
AnswerRe: Doubly Linked List Pin
Richard MacCutchan17-Sep-17 1:49
protectorRichard MacCutchan17-Sep-17 1:49 
AnswerRe: Doubly Linked List Pin
leon de boer17-Sep-17 4:42
memberleon de boer17-Sep-17 4:42 
AnswerRe: Doubly Linked List Pin
Jochen Arndt17-Sep-17 21:45
mvpJochen Arndt17-Sep-17 21:45 
QuestionMessage Closed Pin
16-Sep-17 0:55
memberlindanwhite16-Sep-17 0:55 
QuestionSolution access internet by proxy server c++ Pin
Member 1241714613-Sep-17 19:22
memberMember 1241714613-Sep-17 19:22 
AnswerRe: Solution access internet by proxy server c++ Pin
jschell18-Sep-17 12:32
memberjschell18-Sep-17 12:32 
QuestionLinker error Pin
Vaclav_Sal12-Sep-17 15:53
memberVaclav_Sal12-Sep-17 15:53 
AnswerRe: Linker error Pin
Richard MacCutchan12-Sep-17 19:12
protectorRichard MacCutchan12-Sep-17 19:12 
AnswerRe: Linker error Pin
CPallini13-Sep-17 1:25
mvpCPallini13-Sep-17 1:25 
GeneralRe: Linker error Pin
Vaclav_Sal13-Sep-17 3:14
memberVaclav_Sal13-Sep-17 3:14 
GeneralRe: Linker error Pin
leon de boer13-Sep-17 4:02
memberleon de boer13-Sep-17 4:02 
GeneralRe: Linker error Pin
jschell13-Sep-17 8:23
memberjschell13-Sep-17 8:23 
AnswerRe: Linker error Pin
Jochen Arndt13-Sep-17 4:14
mvpJochen Arndt13-Sep-17 4:14 
GeneralRe: Linker error Pin
Vaclav_Sal13-Sep-17 9:05
memberVaclav_Sal13-Sep-17 9:05 
GeneralRe: Linker error Pin
Jochen Arndt14-Sep-17 3:38
mvpJochen Arndt14-Sep-17 3:38 
GeneralRe: Linker error Pin
leon de boer15-Sep-17 22:21
memberleon de boer15-Sep-17 22:21 
GeneralRe: Linker error Pin
Vaclav_Sal16-Sep-17 3:02
memberVaclav_Sal16-Sep-17 3:02 
GeneralRe: Linker error Pin
leon de boer16-Sep-17 3:16
memberleon de boer16-Sep-17 3:16 
QuestionClarification of Debug/Release mode Pin
ForNow11-Sep-17 2:24
memberForNow11-Sep-17 2:24 
AnswerRe: Clarification of Debug/Release mode Pin
Jochen Arndt11-Sep-17 3:21
mvpJochen Arndt11-Sep-17 3:21 
AnswerRe: Clarification of Debug/Release mode Pin
leon de boer11-Sep-17 15:51
memberleon de boer11-Sep-17 15:51 
GeneralRe: Clarification of Debug/Release mode Pin
ForNow11-Sep-17 15:58
memberForNow11-Sep-17 15:58 
GeneralRe: Clarification of Debug/Release mode Pin
leon de boer12-Sep-17 8:33
memberleon 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
memberForNow12-Sep-17 8:46 
GeneralRe: Clarification of Debug/Release mode Pin
leon de boer13-Sep-17 18:25
memberleon de boer13-Sep-17 18:25 
Questionbatch file quicksort algorithm Pin
wayne wu10-Sep-17 16:10
memberwayne wu10-Sep-17 16:10 
AnswerRe: batch file quicksort algorithm Pin
Richard MacCutchan10-Sep-17 19:24
protectorRichard MacCutchan10-Sep-17 19:24 

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.


Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 24 Sep 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid