• Create Account

### #ActualArt n Peace

Posted 18 February 2012 - 12:20 PM

I'm using an old book that teaches programming and I keep getting an error that I don't understand. The book is:

Beginning C++ Game Programming by Michael Dawson

I've tried running the code in Dev-C++ and Netbeans IDE. No luck. I'm wondering if the lesson code within is dated (the book is old, 2004)? Here's the program I'm trying to run:

#include <iostream>
using namespace std;
/*
*
*/
int main()
{
cout << "Game Over!" << endl;
return 0;
}

Here's the error I'm getting:

build/Debug/Cygwin-Windows/main.o: In function main':
/cygdrive/c/Users/User2/Documents/NetBeansProjects/cppLessons/main.cpp:15: multiple definition of _main'
build/Debug/Cygwin-Windows/gameover2.o:/cygdrive/c/Users/User2/Documents/NetBeansProjects/cppLessons/gameover2.cpp:16: first defined here
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/Cygwin-Windows/cpplessons.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 3s)

What does this mean and how do I fix it? Thank you for your help.

### #1Art n Peace

Posted 18 February 2012 - 12:19 PM

I'm using an old book that teaches programming and I keep getting an error that I don't understand. The book is:

Beginning C++ Game Programming by Michael Dawson

I've tried running the code in Dev-C++ and Netbeans IDE. No luck. I'm wondering if the lesson code within is dated (the book is old, 2004)? Here's the program I'm trying to run:

#include <iostream>
using namespace std;
/*
*
*/
int main()
{
cout << "Game Over!" << endl;
return 0;
}

Here's the error I'm getting:

build/Debug/Cygwin-Windows/main.o: In function main':
/cygdrive/c/Users/Rainy2/Documents/NetBeansProjects/cppLessons/main.cpp:15: multiple definition of _main'
build/Debug/Cygwin-Windows/gameover2.o:/cygdrive/c/Users/User2/Documents/NetBeansProjects/cppLessons/gameover2.cpp:16: first defined here
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/Cygwin-Windows/cpplessons.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 3s)

What does this mean and how do I fix it? Thank you for your help.

PARTNERS