Help with derelict and codeblocks
OoPs-Tk
Kross_t at hotmail.com
Wed Dec 20 23:25:41 PST 2006
I am just starting out in C++ one tut I have been using give me a
roll dice program pretty much I have followed his steps perfectly
but an dgetting this:
.objs\main.o:main.cpp:(.text+0x13f): undefined reference to
`rollDice()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
everytime I try and build. I am using codeblocks.
Below is a copy of the code I am using any help would be much
appreciated.
#include <iostream>
#include <ctime>
using namespace std;
void rollDice (void);
int main()
{
srand(time (0));
rollDice();
return 0;
}
void rolldice(void)
{
int die1;
int die2;
die1 = 1 + rand() % 6;
die2 = 1 + rand() % 6;
cout <<"the first dice is"<<die1 <<endl;
cout <<"the second dice is"<<die2 <<endl;
}
More information about the Digitalmars-d
mailing list