Thread: Simple ./configure question

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    5

    Simple ./configure question

    I use, for my sins, Visual C++.NET 2003 as my compiler and IDE - and I must say I do like it very much. However, I'm trying to compile someone elses code and it tells me that all I have to do is type:

    ./configure
    make

    Now I don't know where I want to be typing that in a graphical interface - I've looked at the cl.exe command-line compiler for VC++.NET but I don't understand where I'd tell it to do such a thing.

    Many thanks to anyone who takes pity on me!

    Cheers, Tom

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Type it in a command-line (DOS) window

    Whenever I've used a make file, it hasn't been with the IDE.

    There is a program called nmake.exe that invokes the compiler following a script in a .mak file. There are a lot of command-line options for nmake.exe, so sometimes these are put into a batch file (i.e. make.bat) to reduce typing (and to prevent typos).

    I assume that when you type "make" it's going to run a file called make.bat. Make.bat will probably invoke nmake.exe with the appropriate options. There should also me a MyProg.mak file. The .mak file should contain all the source and destination file names.

    All of the files have to be in the "correct" directories and you have to be in the correct directory when you type "make".

    If you have copied the directory structure in it's original form, and if you get into the directory where you find make.bat before typing "make", it should work... maybe...

    [EDIT
    The ./ probably means that you'll find a file called configure.bat or configure.exe that's up one level in the directory structure from make.bat.
    Last edited by DougDbug; 11-17-2003 at 12:27 PM.

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    5
    I don't think there is a make.bat or a configure.bat/exe. The instructions for the code simply say the following:

    Change directory to E3D/.
    Type the commands:
    • ./configure
    • make
    In the E3D folder there is an extensionless file called configure - I assume that this somehow tells the compiler what to do when make is typed.

    This code is clearly intended to be compiled on a UNIX-type system, but I have Visual C++ 2003, and I assume that I should be able to compile using it.

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Red face DOH! Bad News:

    That forward-slash should have been a BIG clue. ./ Doesn't do anything in DOS... I don't know what it does in unix. (..\ is up-one-level in DOS.)

    That Configure file is NOT going to run an a Windows machine. It really doesn't matter if it's a batch file, some script, or an execuitable... If that's the only file, my next guess is that it's a self-extracting execuitable.

    On top of that, make files are not part of the C++ standard, so as far as I know, you can't mix-and-match make files and make programs. If that make file (which I assume is compressed into the continue file) wasn't written for Microsoft's nmake, I wouldn't expect it to run.

    You might have to find a Unix of Linux machine... maybe running that configure program will extract the source code, and you could try re-compiling. Unless this is a very simple program, there will probably be some non-standard (non-portable) system-specific code that will not re-compile for Windows.

    To use the cl command, you have to be in it's directory, or have it in the search-path. Then (I think) you type "CLl C:\MyC++Folder\MyProg.cpp". ...That's if you're not using a make file.

    This command-line shtuff doesn't seem to be very well documented. I have on old Quick-C book (copyright 1990) here at work that has a chapter on make files.

    Just for fun, here's a sample .mak and a make.bat file:
    Last edited by DougDbug; 11-18-2003 at 01:58 PM.

  5. #5
    Registered User
    Join Date
    May 2003
    Posts
    161
    @ tompagenet:
    The configure scripts are usually run to test and see what versions of certain libraries you have installed and if they are appropriate for the compilation of whatever source you've downloaded. They then configure the Makefile appropriately to compile the source on your particular configuration.

    If you open the configure file, you'll most likely see that it is just a script-- usually written in Bash or Perl. Either way, it will probably not run on your Windows machine-- unless you have some sort of Posix emulator running-- and even then, it probably won't work correctly.

    Your best bet is to simply create a new Visual Studio project (or are they called Solutions in .Net?) and add the source files to it and try to compile.

    @ DougDbug:
    > I don't know what it does in unix.

    The ./ means to look in the current working directory. When you try to execute a program in Unix, the shell doesn't typically look in the current directory unless it's explicitly included in your path.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple class question
    By 99atlantic in forum C++ Programming
    Replies: 6
    Last Post: 04-20-2005, 11:41 PM
  2. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 09:46 AM
  3. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 12:15 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. simple fgets question
    By theweirdo in forum C Programming
    Replies: 7
    Last Post: 01-27-2002, 06:58 PM