Building a project using a Makefile

This is a discussion on Building a project using a Makefile within the Windows Programming forums, part of the Platform Specific Boards category; Hi everyone! I wasn't quite sure where to ask a question about building a project, but here goes... I recently ...

  1. #1
    Registered User starcatcher's Avatar
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    45

    Question Building a project using a Makefile

    Hi everyone!

    I wasn't quite sure where to ask a question about building a project, but here goes...

    I recently downloaded the demo version of Webots 5.10.0. What this program is or does is irrelevant to my question. What is relevant though is that Webots comes with the source code of an example 'controller' program, which includes a makefile. I need to compile this code in order to see the sample 'controller' in action. How can I compile this source file using Microsoft Visual Studio 2003?

    I believe I need to create a Makefile Project, but then what do I do?
    In the Property Pages Dialog Box I tried setting the 'Build Command Line' field, but I got error messages when I tried to build the project (I have no idea about makefiles so I'm very sure I did things totally wrong!)...

    There is one C code file and one Makefile, and that's it. I attached both files to this post. (I changed the extension of the Makefile to .txt so I could attach it) Note that I have all the headers etc... that are needed as they were automatically installed with Webots, so that is not the issue here.

    Here is the contents of 'Makefile' in case the attached .txt version of it opens weirdly (it opens as a single line of text when you use notepad):
    Code:
    #
    # Standard Makefile for a Webots controller
    #
    # Author: Olivier.Michel@cyberbotics.com
    # Date:   August 29th, 2006.
    #
    
    ifndef WEBOTS_HOME_PATH
    ifeq ($(OS),Windows_NT)
    nullstring :=
    space := $(nullstring) # a string containing a single space
    WEBOTS_HOME_PATH=$(subst $(space),\ ,$(strip $(subst \,/,$(WEBOTS_HOME))))
    else
    WEBOTS_HOME_PATH=$(WEBOTS_HOME)
    endif
    endif
    
    include $(WEBOTS_HOME_PATH)/projects/default/controllers/Makefile.include
    Thanks,

    Philipp
    Attached Files Attached Files
    I program solely as a hobby so this is definitely not homework.
    Best thing that's been said to me:
    I was so pleasantly surprised to see another post in this thread, and yours was brilliant; a fitting end to a subject (matrix manipulations of all kinds) that is quite intriguing.
    Read this thread to find out why...
    Cannibalism

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,649
    Page 151 of the User Guide has instructions for Visual C++.

  3. #3
    Registered User starcatcher's Avatar
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    45

    Exclamation

    Thanks for the quick reply.

    I was aware of the instructions on page 150 of the Guide. These however advise to make a 'Win32 Console Application', which is not exactly what I require (but would be a lot more comfortable for me). I am hoping to take part in a contest using Webots (Robotstadium), for which I have to submit my source files along with a makefile, to be recompiled by 'them' and run on their server. Thus I need to set up a project using MSVS 2003 so that I can run the source files using a makefile. That means that I can then just submit the makefile and the source code for the competition.

    Philipp
    I program solely as a hobby so this is definitely not homework.
    Best thing that's been said to me:
    I was so pleasantly surprised to see another post in this thread, and yours was brilliant; a fitting end to a subject (matrix manipulations of all kinds) that is quite intriguing.
    Read this thread to find out why...
    Cannibalism

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Undertaking Website Building Project and Application Software Development
    By Programmer168 in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 03-21-2009, 04:44 AM
  2. Problem Displaying a Struct
    By rockstarpirate in forum C++ Programming
    Replies: 16
    Last Post: 05-05-2008, 09:05 AM
  3. Dynamic Binding
    By gpr1me in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2006, 08:01 AM
  4. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM

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