Compiling non-trivial programs

Posted on 2007-07-19
Medium Priority
Last Modified: 2013-11-13
Hi, I downloaded an some source code and I want to recompile it.  There's a subfolder called "SRC" with a bunch of header files and .cpp files.  There's also a makefile in there.

I tried to compile it with Visual Studio 2005 Express but there was no project solution file.  I also can't just open up the main.cpp file and go to "build" because the option is grayed out.

Then I gave up on VS2005 and I tried using the Makefile.  However, the last time I used a makefile was in UNIX at school so I had very little success using getting it to work in Windows or even Linux (Ubuntu distribution).

My questions are how can I compile this program and can a Makefile also work for other OS besides UNIX?  I know it's a stupid question but I haven't really programmed any non-trivial programs before.

Thanks for all your help in advance.

Question by:another_steve
  • 3
  • 2
LVL 11

Expert Comment

ID: 19528363
what program you are trying to build ?
if it is written for linux/unix etc and not meant for win machines , it may not be trivial to get it to compile on windows without some modifications.
for example some library functions are only available on linux machnes and vice versa.

if you give the application and from where you downloaded experts here can have a look.

Makefiles can work on other OSes but may not work out of the box.

btw you can also try to instal cygwin so that you can then directly compile linux apps using the normal make/make install  ( in most cases )


Author Comment

ID: 19528848
It's a game called Atomic Tanks: source code can be downloaded from http://sourceforge.net/project/showfiles.php?group_id=72358

if you can show me how to compile this, that would be great

LVL 11

Expert Comment

ID: 19528880
do you really need to compile it yourself cos for windows they have precompiled exe files which you can run


secondly i checked from the website that one of the requirements is Allegro game library i
hope you have installed that already
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 19528989
i want to make some modifications to the game, later then i'll have to recompile it

thanks for the heads up about the Allegro game library, i downloaded it and extracted the file to my VS2005 folder but i still can't compile it.  i opened up the files "atank.cpp" and tried compiling but the "start debugging"  option was grayed out

LVL 11

Accepted Solution

avizit earned 500 total points
ID: 19529027
you simply cannot take a file and build the application.;
you have to take care of the dependencies as in the files need to be compiled in particular order and then all the compiled object files can later be linked to create one application

I notice that there is a Makefile.windows file in the src directory
but since windows dont have a default make program maybe you can try to download and install nmake from

and then later try

make ( or nmake if thats the command ) -f Makefile.windows

note: it may not be the -f options to pass the name of the makefile you would need to look at the documentation

Expert Comment

ID: 20106013
Forced accept.

EE Admin

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Loops Section Overview

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question