When I try to compile anything in 4.9.9.2 on XP I get the following:
Circular Tic_Tac_Toe <- Tic_Tac_Toe.o dependency dropped.
C:\Dev-Cpp\MyCstuff\l2c++lol\Makefile.win [Build Error][L2C++LOL.exe] Error 1
This only occured after attempting to compile the following code: (New to C++)
The original message was a make message not a compiler error. You need to post the make file rather than the code.
Do not create projects in the Dev-C++ installation folder or sub-folders within it (i.e. C:\Dev-Cpp\MyCstuff). It can cause strange behaviour in Dev-C++.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I try to compile anything in 4.9.9.2 on XP I get the following:
Circular Tic_Tac_Toe <- Tic_Tac_Toe.o dependency dropped.
C:\Dev-Cpp\MyCstuff\l2c++lol\Makefile.win [Build Error] [L2C++LOL.exe] Error 1
This only occured after attempting to compile the following code: (New to C++)
include <stdio.h>
include <stdlib.h>
include <string.h>
int IsInUse[9]=0;
void blines(int n)
{
int i;
for(i=1;i<=n;i++)printf("\n");
}
void printscreen()
{
blines(25);
char s[9]="";
for(i=0;i<9;i++){
if(IsInUse[i]==1)printf("|X");
else if(IsInUse[i]==0)printf("| ");
else if(IsInUse[i]==2)printf("|O");
if(i==2)printf("|\n");
if(i==5)printf("|\n");
if(i==8)printf("|");
}
}
void grats()
{
printf("Congratulations, you won!\b");
GameOver=1;
}
void aww()
{
printf("Aww, you lost.\n");
GameOver=1;
}
void cpuai()
{
int a;
a=rand()%9+1;
while(IsInUse[a]!=0)a=rand()%9+1;
IsInUse[a]=1;
}
int main(int argc,char argv){int GameOver=0,turn=rand()%1+1,plAns;while(GameOver==0){
printf("Welcome to Tic-Tac-Toe C++ Version!\n");
if(turn==1){
printf("Enter the square you want.\n");
scanf("%d",&plAns);
if(plAns>8)plAns=8;
if(IsInUse[plAns]!=0)IsInUse[plAns]=2;
}
else if(turn==2)cpuai();
if(IsInUse[0]==2){if(IsInUse[1]==2){if(IsInUse[2]==2){grats();}}
else if(IsInUse[3]==2){if(IsInUse[6]==2){grats();}}
else if(IsInUse[4]==2){if(IsInUse[8]==2){grats();}}}
if(IsInUse[1]==2){if(IsInUse[4]==2){if(IsInUse[7]==2){grats();}}}
if(IsInUse[2]==2){if(IsInUse[5]==2){if(IsInUse[8]==2){grats();}}
else if(IsInUse[4]==2){if(IsInUse[6]==2){grats();}}}
if(IsInUse[6]==2){if(IsInUse[7]==2){if(IsInUse[8]==2){grats();}}}
if(IsInUse[3]==2){if(IsInUse[4]==2){if(IsInUse[5]==2){grats();}}}
/---/
if(IsInUse[0]==1){if(IsInUse[1]==1){if(IsInUse[2]==1){aww();}}
else if(IsInUse[3]==1){if(IsInUse[6]==1){aww();}}
else if(IsInUse[4]==1){if(IsInUse[8]==1){aww();}}}
if(IsInUse[1]==1){if(IsInUse[4]==1){if(IsInUse[7]==1){aww();}}}
if(IsInUse[2]==1){if(IsInUse[5]==1){if(IsInUse[8]==1){aww();}}
else if(IsInUse[4]==1){if(IsInUse[6]==1){aww();}}}
if(IsInUse[6]==1){if(IsInUse[7]==1){if(IsInUse[8]==1){aww();}}}
if(IsInUse[3]==1){if(IsInUse[4]==1){if(IsInUse[5]==1){aww();}}}
printscreen();}
system("PAUSE");
}
Compile Log:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\MyCstuff\l2c++lol\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\MyCstuff\l2c++lol\Makefile.win" all
make.exe: Circular Tic_Tac_Toe <- Tic_Tac_Toe.o dependency dropped.
g++.exe -c Tic_Tac_Toe -o Tic_Tac_Toe.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
g++.exe: Tic_Tac_Toe: linker input file unused because linking not done
g++.exe FuncTest.o Tic_Tac_Toe.o -o "L2C++LOL.exe" -L"C:/Dev-Cpp/lib"
g++.exe: Tic_Tac_Toe.o: No such file or directory
make.exe: *** [L2C++LOL.exe] Error 1
Execution terminated
Any help?
The original message was a make message not a compiler error. You need to post the make file rather than the code.
Do not create projects in the Dev-C++ installation folder or sub-folders within it (i.e. C:\Dev-Cpp\MyCstuff). It can cause strange behaviour in Dev-C++.
I changed it to a stand-alone source and it threw a few errors which I fixed, the code now reads:
include <stdio.h>
include <stdlib.h>
include <string.h>
int IsInUse[8]={0},GameOver=0;
void blines(int n)// Function taken from Dev-C++ help file
{
int i;
for(i=1;i<=n;i++)printf("\n");
}
void printscreen()
{
int i;
blines(25);
char s[9]="";
for(i=0;i<9;i++){
if(IsInUse[i]==1)printf("|X");
else if(IsInUse[i]==0)printf("| ");
else if(IsInUse[i]==2)printf("|O");
if(i==2)printf("|\n");
if(i==5)printf("|\n");
if(i==8)printf("|");
}
}
void grats()
{
printf("Congratulations, you won!\b");
GameOver=1;
}
void aww()
{
printf("Aww, you lost.\n");
GameOver=1;
}
void cpuai()
{
int a;
a=rand()%9+1;
while(IsInUse[a]!=0)a=rand()%9+1;
IsInUse[a]=1;
}
int main(int argc,char argv){int GameOver=0,turn=rand()%1+1,plAns;while(GameOver==0){
printf("Welcome to Tic-Tac-Toe C++ Version!\n");
if(turn==1){
printf("Enter the square you want.\n");
scanf("%d",&plAns);
if(plAns>8)plAns=8;
if(IsInUse[plAns]!=0)IsInUse[plAns]=2;
}
else if(turn==2)cpuai();
if(IsInUse[0]==2){if(IsInUse[1]==2){if(IsInUse[2]==2){grats();}}
else if(IsInUse[3]==2){if(IsInUse[6]==2){grats();}}
else if(IsInUse[4]==2){if(IsInUse[8]==2){grats();}}}
if(IsInUse[1]==2){if(IsInUse[4]==2){if(IsInUse[7]==2){grats();}}}
if(IsInUse[2]==2){if(IsInUse[5]==2){if(IsInUse[8]==2){grats();}}
else if(IsInUse[4]==2){if(IsInUse[6]==2){grats();}}}
if(IsInUse[6]==2){if(IsInUse[7]==2){if(IsInUse[8]==2){grats();}}}
if(IsInUse[3]==2){if(IsInUse[4]==2){if(IsInUse[5]==2){grats();}}}
/---/
if(IsInUse[0]==1){if(IsInUse[1]==1){if(IsInUse[2]==1){aww();}}
else if(IsInUse[3]==1){if(IsInUse[6]==1){aww();}}
else if(IsInUse[4]==1){if(IsInUse[8]==1){aww();}}}
if(IsInUse[1]==1){if(IsInUse[4]==1){if(IsInUse[7]==1){aww();}}}
if(IsInUse[2]==1){if(IsInUse[5]==1){if(IsInUse[8]==1){aww();}}
else if(IsInUse[4]==1){if(IsInUse[6]==1){aww();}}}
if(IsInUse[6]==1){if(IsInUse[7]==1){if(IsInUse[8]==1){aww();}}}
if(IsInUse[3]==1){if(IsInUse[4]==1){if(IsInUse[5]==1){aww();}}}
printscreen();}
system("PAUSE");
}
I now get this error: cannot find
ld' Compile Log: Compiler: Default compiler Executing g++.exe... g++.exe "C:\Dev-Cpp\MyCstuff\l2c++lol\Untitled1.cpp" -o "C:\Dev-Cpp\MyCstuff\l2c++lol\Untitled1.exe" -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" collect2: cannot find
ld'Execution terminated
????