Thread: visual c++ compiler

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    35

    Question visual c++ compiler

    heyas,
    just a quicky, i have previously been programming c in borland's c++ turbo compiler or something..

    i recently formatted, however, and was wondering if i can just use microsoft's visual c++ to compile basic c programs. (due to the fact that i have the visual studio installers) if so, is it inefficient using a windows based compiler which may be used to generate api and actual windows based applications to create simple c programs which are normally executable through dos?

    any suggestions are much appreciated, thanks for your time..
    twans

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Yes, you can use M$ VC compiler to compile normal C code. Just make sure you use the .c extension and it will use the C compiler vice the C++ one. I don't think you will see any speed difference. If anything, it maybe be able to optimize better than older compilers.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  3. #3
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    And, if you're making DOS apps, make sure that when you create a new project you create a "Win32 console application".

    So basically:
    a) call your file "filename.c"
    b) make your project a Win32 console application
    c) have fun
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  4. #4
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by Hunter2
    And, if you're making DOS apps, make sure that when you create a new project you create a "Win32 console application".
    A win32 console application is not a DOS application.

  5. #5
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    True, but it works better than a Win32 Application or a DLL

    By the way, what are you supposed to use if not Win32 Application? Or are you just supposed to create a .cpp file and let it create a workspace on its own or something?
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  6. #6
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    You quite simply can't. The last version that was capable of making a DOS application was version 1.52C

    If you really need to make a DOS application, then use a different compiler.

  7. #7
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Originally posted by Hunter2
    True, but it works better than a Win32 Application or a DLL

    By the way, what are you supposed to use if not Win32 Application? Or are you just supposed to create a .cpp file and let it create a workspace on its own or something?
    What do you mean? Like a program for a different OS? When you create a Win32 Application it'll link to standard Win32 lib's kernel32.lib, gdi32.lib etc

    Just take all these out and link to whatever libraries you want.

    If you just add in a cpp and let VS make a workspace for you , it will usually default to the Win32 Console Application.

  8. #8
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Oh, ok.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  9. #9
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by MrWizard
    Just take all these out and link to whatever libraries you want.
    Though that wouldn't necissarily allow you to compile for other OS's. An executable that is compiled with absolutely no libraries linked does not make it portable to other operating systems. It only makes it easier to port. If you want to make a program for many operating systems, the common approach is to use an interpretted langauge with a virtual machine, hence Java.

  10. #10
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    That's not what I meant. I just meant, that if you knew the libraries you needed you could replace the stock ones with those and you could compile it. I know it won't be portable to every OS.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  11. #11
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    True, but my point was that the formatting for executables is different between operating systems, not just what libraries you link. Just the same -- static link libraries aren't formatted the same way between OS's, so even if you had libraries that you'd use to compile code for OS "a" that would work on a compiler for OS "b," would in most cases not link with code from a compiler which is meant to compile for for OS "a" without any other adjustments.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C compiler for Visual studio?
    By xtrmi in forum C Programming
    Replies: 6
    Last Post: 09-01-2008, 04:41 PM
  2. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM
  3. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 05:27 AM
  4. <list>
    By Unregistered in forum C++ Programming
    Replies: 9
    Last Post: 02-24-2002, 04:07 PM
  5. Free Visual C Compiler?
    By unanimous in forum C Programming
    Replies: 3
    Last Post: 12-05-2001, 03:15 PM