recipe for target 'GameStart.o' failed???

So when i run the ccode below that error pops up i have no idea what it means.

here's the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  #include <windows.h>

#include <iostream>
using namespace std;


int main()
{
	char name[50];
	
	cout << "Before continuing tell me your name:";
	cin >> name;
	cout << "Hello " << name << endl;
	
}
int world_Builder() 
{
	char spawn[50];
	char answerOne[50];
	
	cout << "This is the world builder here you can \n"
		 << "design where you want to spawn and the \n"
		 << "vegetation and mineral occypancy of your world!\n"
		 <<endl;
		  
	cout << "Choose in what biome do you want to spawn in: \n"
		 << "Forest\n"
		 << "Plains\n"
		 << "Desert (hardest one)"
		 <<endl;
		 
		 cout << "What biome do you start in?";
		 cin >> spawn;
		 cout << "Are you sure you want to spawn in? " << spawn << endl;
		 cin >> answerOne;
		 
		 if (answerOne = "yes");
		 {
		 	cout << "Your spawn biome will be " << spawn << endl;
		 }
}


Ps. i'm using Dev-C++ 5.7.0 as a coding interface if that helps.
"that error"?

Is the error really:
recipe for target 'GameStart.o' failed


Anyway, your code does not depend on windows.h, so you should not include it.

Having changed that, an online compiler says:
In function 'int world_Builder()':
37:20: error: incompatible types in assignment of 'const char [4]' to 'char [50]'
41:1: warning: no return statement in function returning non-void [-Wreturn-type] 

Line 37 has syntax error, because you probably made a typo: assignment (=) instead of equality comparison (==). However, equality of pointers is not what you need there. C-string comparison requires a string comparison function from header <cstring>.

Overall, your main() does not call function world_Builder (and it could not if it tried, because it doesn't even know about that function, see function declarations). As such, all the code of your program is now on lines 7-15.
Yes the error IS "recipe for target 'Gamestart.o' failed"
so is there a way to fix that and how should the code be for functions to work do i just need to change the places of "main()" and "world_Builder()"?

Also i fixed the if statement.
Last edited on
Yes the error IS "recipe for target 'Gamestart.o' failed"

This means that the compiler was unable to create the 'Gamestart.o' file (which is a target in the generated make file.) Was this message preceded by other error messages?
Was this message preceded by other error messages?


Sorry i'm a Finn so i have no idea what that means.
Were there other errors before this one? "Recipe failed" is a result, not a reason.

If the "recipe failed" is the only thing that the IDE shows, then it probably has the actual errors listed somewhere semi-hidden.
well for some reason nothing shows up when i compile and run i mean nothing not even errors
Topic archived. No new replies allowed.