My First Program?

I have to assume that some of several things are true...

  • You have a C or C++ compiler.
  • Visual Studio
  • Open Watcom
  • GCC
  • NASM, may be needed to compile some assembly portions.
  • GNU Make, if not visual studio

    All makefiles are raw GNU make, and require several features specific to this version, others such as wmake or nmake will not work. BSD make is also a slightly different flavor requiring manual editing to build.

    Makefile make system also uses several binutil type commands, cp, rm, ls, mkdir... these are not easily found. [consider providing a link here to useful native windows ports of fore mentioned tools]

  • Some sort of more useful shell than CMD.EXE (or COMMAND.COM with doskey enabled)
  • A text editor for editing source files.
  • Environment variables, these should be set on the development system, since under windows, there is no well defined place for things like includes and libraries...
  • Actively development is being done under Linux with GCC 4.1.1, Windows with OpenWatcom 1.5, and Visual Studio 7.0, 7.1 and 8.0 (may find problems with project files from time to time :) ).

    Okay, so now you have some stuff setup, all the above tools (unless Visual Studio is your choice) should be available in your PATH (the directories searched for programs to run by the name entered...)


    With Makefiles... (vs projects later)

    Create a makefile named Makefile

    Makefile
    
    PROGNAME=my_program_name
    SRCS=my_program_source
    
    include $(SACK_BASE)/makefiles/makefile.single
    

    Create the source file

    my_program_source.c
    
    #include <sack_types.h>
    
    int main( int args, char **argv )
    {
    	SimpleMessageBox( NULL, "Yeah, Hello", "Message Title" );
    	return 1;
    }
    
    

    run make.

    Okay then where did the program go? how do I get there?