Chris Molozian | 21 Jun 2011 19:33

Simple C++ Project

Hey all,

I've moved on from D to C++ with my Jam projects. I can't seem to make a simple build environment work, the project directory looks like:

C++Example
    |-- build/    <-- should be created and built by Jam
    |-- src/
          |-- Main.cpp
    |-- Jamfile

I'm using a simple Hello World C++ example (Main.cpp):

#include <iostream>

using namespace std;

int main(void) {
    cout << "Hello World!" << endl;
    return 0;
}

The Jamfile looks like this:

ALL_LOCATE_TARGET = build ;
SubDir TOP ;

C++FILES = [ GLOB src : *.cpp ] ;
Main hello : $(C++FILES) ;

The build fails with the following errors:

...found 12 target(s)...
...updating 2 target(s)...
C++ build/src/Main.o
Assembler messages:
Fatal error: can't create build/src/Main.o: No such file or directory

cc -c -o build/src/Main.o  -O  -I. src/Main.cpp

...failed C++ build/src/Main.o ...
...skipped hello for lack of src/Main.o...
...failed updating 1 target(s)...
...skipped 1 target(s)...

Any help is appreciated,

Chris

_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

Gmane