locked
How to get rid of this junk ? RRS feed

  • Question

  • 2.1

    Which Option In Visual Studio Do i have to disable to to get rid of Following 2.1 Garbage ?

    And Produce only my Simple code ?  

    Saturday, April 2, 2016 11:22 PM

Answers

All replies

  • All you have done is shown us a list and told us this is garbage. What is this list? How did you produce it? What does it have to do with what code you have written?
    Sunday, April 3, 2016 12:12 AM
  • All you have done is shown us a list and told us this is garbage. What is this list? How did you produce it? What does it have to do with what code you have written?

    i have written a program and i found this extra codes inside my code using debugeer. 

    I want to reduce the size of my code so how can i get rid of this extra code ? 

    NOTE: the above image is extra functions i wanna get rid of ! 


    Sunday, April 3, 2016 12:29 AM
  • That looks like code in the runtime support that is incorporated into your program. You probably can't eliminate much of that code, and why would you want to anyway?

    How big is your executable now? What compiler switches are you using?

    More specifically, why do you want to reduce the size of your code?

    (I'd appreciate answer to all of my questions, since I know from previous  posts, you tend not to answer any of them)

    Sunday, April 3, 2016 12:40 AM
  • That looks like code in the runtime support that is incorporated into your program. You probably can't eliminate much of that code, and why would you want to anyway?

    How big is your executable now? What compiler switches are you using?

    More specifically, why do you want to reduce the size of your code?

    (I'd appreciate answer to all of my questions, since I know from previous  posts, you tend not to answer any of them)

    Can i get solution How to Fix this ? 
    Sunday, April 3, 2016 1:14 AM
  • But nothing is broken, there's nothing to fix. All this "junk" is normal.

    Sunday, April 3, 2016 1:34 AM
  • Can i get solution How to Fix this ? 
    Once again, you have answered none of my questions
    Sunday, April 3, 2016 2:15 AM
  • Use /NODEFAULTLIB linker option (Ignore All Default Libraries).

    Use /GS- (Disable Security Check)

    Assuming you are using the Windows Subsystem, use a simple entry point like this:

    #include <windows.h>
    
    void __stdcall WinMainCRTStartup() {
        // Your code here.
        ExitProcess(1);
    }
    

    Sunday, April 3, 2016 4:40 AM
  • Use /NODEFAULTLIB linker option (Ignore All Default Libraries).

    Use /GS- (Disable Security Check)

    Assuming you are using the Windows Subsystem, use a simple entry point like this:

    #include <windows.h>
    
    void __stdcall WinMainCRTStartup() {
        // Your code here.
        ExitProcess(1);
    }

    And after doing this don't forget that you can't use any functions in the Standard C/C++ Libraries.
    Sunday, April 3, 2016 2:53 PM
  • And after doing this don't forget that you can't use any functions in the Standard C/C++ Libraries.
    Well, he did call it garbage.  ;)
    Monday, April 4, 2016 3:14 AM
  • And after doing this don't forget that you can't use any functions in the Standard C/C++ Libraries.

    Well, he did call it garbage.  ;)
    Quite true.  I almost suggested the best way to take out the garbage would be to code everything in assembly! :)
    Monday, April 4, 2016 4:03 AM
  • All you have done is shown us a list and told us this is garbage. What is this list? How did you produce it? What does it have to do with what code you have written?

    i have written a program and i found this extra codes inside my code using debugeer. 

    I want to reduce the size of my code so how can i get rid of this extra code ? 

    NOTE: the above image is extra functions i wanna get rid of ! 


    Hi,

    If you want to optimize your code in the C/C++ language. You can use some methods below.

    Optimization Pragmas and Keywords

    A list of keywords and pragmas that you can use in your code to improve performance.

    Compiler Options Listed by Category

    A list of /O compiler options that specifically affect execution speed or code size.

    Rvalue Reference Declarator: &&

    Rvalue references support the implementation of move semantics. If move semantics are used to implement template libraries, the performance of applications that use those templates can significantly improve

    If you have time, for more information you can see https://msdn.microsoft.com/en-us/library/xz7ttk5s.aspx?f=255&MSPPError=-2147217396

    https://msdn.microsoft.com/en-us/library/aa290055(v=vs.71).aspx

    Best Regards,

    Hart


    • Proposed as answer by Hart Wang Tuesday, April 5, 2016 6:47 AM
    • Marked as answer by Hart Wang Monday, April 18, 2016 9:41 AM
    Monday, April 4, 2016 7:38 AM