msvc++ problem

This is a discussion on msvc++ problem within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I have a problem with msvc++. I need to be able to use the command line in order to compile ...

  1. #1
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744

    Question msvc++ problem

    I have a problem with msvc++. I need to be able to use the command line in order to compile allegro. I’ve written a simple hello world program and it compiles fine with djgpp. But it doesn’t work with msvc++(command line). when I type “cl hello.c” I get an error: "fatal error c1034: stdio.h: no include path set". I assume there is a difference for setting the include path in the GUI and the command line. how do I set the include path for msvc in the command line. Can it be done with environment variables?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    From MSDN:
    Set Environment Variables
    Home | Overview | Details

    CL.EXE, LINK.EXE, and other command-line tools require that certain environment variables be set properly. These include PATH, which must point to the \bin subdirectory of your Visual C++ installation, LIB, which must point to \lib, and INCLUDE, which must point to \include.

    When you install Visual C++, setup creates a batch file, VCVARS32.BAT, containing commands to modify the PATH, LIB, and INCLUDE environment variables. If these variables haven't been set properly, run VCVARS32.BAT before you compile at the command prompt. VCVARS32.BAT is located in the \bin subdirectory. Note that you do not need to run VCVARS32.BAT if you are compiling your program inside the development environment.

    To run VCVARS32.BAT

    At the command prompt, change to the \bin subdirectory of your Visual C++ installation.


    Run VCVARS32.BAT by typing VCVARS32.
    Note VCVARS32.BAT may vary from machine to machine. You should not copy a missing or damaged VCVARS32.BAT file from another installation.

  3. #3
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    Thanks Fordy.

    I added two variables. But my hello program still wouldn't compile. I got an other error. something about a linker.
    But I tried compileing allegro and it worked. I had an error during compilation but that is due to win2k(they said at allegro.cc) so it looks like it worked. still wandering why a complex program as allegro would compile and my very simple hello program not. oh well, life is full of strange things. But thanks again Fordy it really helped.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MSVC 2005 problem
    By l2u in forum Windows Programming
    Replies: 1
    Last Post: 05-13-2006, 05:30 PM
  2. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM
  3. Replies: 5
    Last Post: 11-07-2005, 10:34 PM
  4. MSVC Tutorial problem - Monochrome Palette
    By colinH in forum C++ Programming
    Replies: 4
    Last Post: 10-30-2002, 02:57 AM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21