Thread: Good dos compiler

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    22

    Good dos compiler

    Hi, I am looking for a compiler that creates a dos executable and can make it real small. I have a bit of code I wrote that is about 5kb and when I compile it in Visual C++ I get an exe file size of about 440kb and doesn't work in dos. Any suggestions? Thanks.

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    djgpp

    >>I get an exe file size of about 440kb<<

    Take a look at your compiler settings (don't compile with debug info).
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    Jan 2004
    Posts
    22
    Thanks for the reply. I get 2 errors though, trying to compile with this. They are both similar so I'll only list one:

    recorder.cpp:107: error: `mkdir' undeclared (first use this function)

    It is saying function mkdir() is not defined?

  4. #4
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    Did you include stat.h?
    Code:
    #include <sys/stat.h>

  5. #5
    Registered User
    Join Date
    Jan 2004
    Posts
    22
    No, but I did now and it fixed it. But, not the other error:

    error: `chdir' undeclared (first use this function)

  6. #6
    Registered User
    Join Date
    Oct 2002
    Posts
    291
    Try adding
    Code:
    #include <unistd.h>

  7. #7
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Try running the Ultimate eXecutable Packer on it. It's available at: http://upx.sourceforge.net/

    About it not working in DOS... it's most likely being compiled for Win32 console which requires has to be run from a Windows DOS prompt.

  8. #8
    Registered User
    Join Date
    Jan 2004
    Posts
    22
    Wow, thanks, it brought my file down to 43kb! Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Good C Compiler to use for learning???
    By TR15220 in forum C Programming
    Replies: 2
    Last Post: 12-10-2003, 11:54 AM
  2. winver, winminor, winmajor can it be found from dos?
    By ronin in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-02-2002, 10:32 AM
  3. what is good for gaphics in dos
    By datainjector in forum Game Programming
    Replies: 2
    Last Post: 07-15-2002, 03:48 PM
  4. Good compiler for OpenGL (besides MS Visuial c++)
    By Crossbow in forum Game Programming
    Replies: 1
    Last Post: 12-20-2001, 04:44 PM
  5. Shut off DOS screen automatically to Windows
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-08-2001, 07:14 PM