f19l
asked on
wxDev-C++ Error Message - Specified Files Not Found
Hello,
I have just set up wxDev-C++ on my desktop but when I try to run a simple program I get an error message stating that the system cannot find the file specified. I have posted the code below.
Thanks.
#include <iostream>
#include <iomanip>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{
int data[5];
for (int index=0;index<5;index++)
{
data[index]=(index+1);
cout<<"Element "<<index<<" contains "
<<data[index]<<endl;
}
getch();
return 0;
}
I have just set up wxDev-C++ on my desktop but when I try to run a simple program I get an error message stating that the system cannot find the file specified. I have posted the code below.
Thanks.
#include <iostream>
#include <iomanip>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{
int data[5];
for (int index=0;index<5;index++)
{
data[index]=(index+1);
cout<<"Element "<<index<<" contains "
<<data[index]<<endl;
}
getch();
return 0;
}
ASKER
The error message is exactly as I see it. I got it when I tried to compile the code.
you mean you only see 'Specified Files Not Found' but nothing else?
what ide you are using? how do you compile the code? can you make a screenshot?
note, there are 3 steps to go:
- compile one or more source files (.cpp) using a project file or a make file
- link the object modules to an executable
- start the executable
the first two steps might be done together by your ide. but in any case you should have some verbose outputs where you see what happened within each of the steps,
if you don't see any output beside of the error, it is most likely the project file or make file which are missing or were located not at the place where they were expected.
Sara
what ide you are using? how do you compile the code? can you make a screenshot?
note, there are 3 steps to go:
- compile one or more source files (.cpp) using a project file or a make file
- link the object modules to an executable
- start the executable
the first two steps might be done together by your ide. but in any case you should have some verbose outputs where you see what happened within each of the steps,
if you don't see any output beside of the error, it is most likely the project file or make file which are missing or were located not at the place where they were expected.
Sara
ASKER
As requested, I have attached a snap shot of the wxDev-C++ compiler.
Once I have typed the code, all I do is to hit the compile button of the left of the toolbar.
I have tried to run the code in the form of a project file and source file. In either case I get the same result.
wxDev-C---SnapShot.docx
Once I have typed the code, all I do is to hit the compile button of the left of the toolbar.
I have tried to run the code in the form of a project file and source file. In either case I get the same result.
wxDev-C---SnapShot.docx
the project tree is empty. that means there is no project opened.
I don't know the ide you used but it looks similar to visual studio ide and should allow you to create a new c++ console project (check the File menu'). create an empty project which then would be created and be shown in the file tree. by right-clicking on the project in that tree window you would get a context menu where you could add the cpp file you typed to the project (move the cpp file to the new project folder before). then start the 'build' which should compile the code and link it to an exe file.
Sara
I don't know the ide you used but it looks similar to visual studio ide and should allow you to create a new c++ console project (check the File menu'). create an empty project which then would be created and be shown in the file tree. by right-clicking on the project in that tree window you would get a context menu where you could add the cpp file you typed to the project (move the cpp file to the new project folder before). then start the 'build' which should compile the code and link it to an exe file.
Sara
ASKER
I have tried to do what you suggest but I still get the same results. I attach a snap shot. Perhaps the problem could be to do with the library files? Maybe they are not available?
wxDev-C---SnapShot.docx
wxDev-C---SnapShot.docx
ASKER
Could you confirm what compiler options I need to have in order to run it?
ASKER
Here are my compiler options.
wxDev-C---SnapShot2.docx
wxDev-C---SnapShot2.docx
in the image you posted the bottom message says 'compilation successful'.
can you check with the explorer whether there is a file named array1.obj or array1.o with a current timestamp?
Sara
can you check with the explorer whether there is a file named array1.obj or array1.o with a current timestamp?
Sara
ASKER
When I try to run the file I get a warning stating that the project is not compiled.
I have just checked in explorer and the only array1 files that I can find have .cpp extensions.
I have just checked in explorer and the only array1 files that I can find have .cpp extensions.
it is difficult for me to find out the reasons why the very basic things don't work. some shots from the hip:
when you right-click at the array1.cpp in the project tree, did you get a context menu where 'compile' is one of the menu items?
can you comment the two include statements for conio.h and math.h? those headers are c headers which are not needed in c++ sources at all and even less for your code.
but actually I don't think that the 'specified files not found' are header files. it looks more that some files of the ide or the project are missing.
did you move the installation folder or other folders somehow?
Sara
when you right-click at the array1.cpp in the project tree, did you get a context menu where 'compile' is one of the menu items?
can you comment the two include statements for conio.h and math.h? those headers are c headers which are not needed in c++ sources at all and even less for your code.
but actually I don't think that the 'specified files not found' are header files. it looks more that some files of the ide or the project are missing.
did you move the installation folder or other folders somehow?
Sara
ASKER
Answer to question 1 - No.
Answer to question 2 - No change, same message.
Answer to question 3 - Do not believe so but cannot be sure.
Answer to question 2 - No change, same message.
Answer to question 3 - Do not believe so but cannot be sure.
ASKER
Please see attached for the compile log results.
wxDev-C---SnapShot3.docx
wxDev-C---SnapShot3.docx
Answer to question 1 - No.ok. that could be the problem. it sound as your project tree has an entry but the file doesn't exist (any more).
you may try the following:
- close the array1.cpp in the ide.
- select the array1.cpp in the project tree and delete it (by DEL key or context menu).
(don't delete the file but only remove it from project tree).
- then select the project in the project tree and add the array1.cpp again from disk.
try if you can compile it by right-clicking on the array1.cpp in the project tree.
Sara
the last log you posted had a different result. the 'file not found' was gone and there is a successful build using a mingw makefile.
can you post the contents of the makefile in a code box?
Sara
can you post the contents of the makefile in a code box?
Sara
ASKER
I have loaded the Makefile.win in notepad form.
Makefile.txt
Makefile.txt
the makefile looks good.
check your disk below c:\users\u166946\c++\chap8 \ you should find array1.o and project1.exe.
Sara
$(CPP) -c Array1.cpp -o Objects/MingW/Array1.o $(CXXFLAGS)this statement would compile the array1.cpp and would create array1.o at Objects/MingW folder.
$(LINK) $(LINKOBJ) -o "$(BIN)" $(LIBS)this statement would link the object file. the output is in folder Output/MingW/Project1.exe
check your disk below c:\users\u166946\c++\chap8
Sara
ASKER
I think the easiest thing to do would be to try and load another compiler. I do not know why this is not working. Maybe there was a problem with the initial download. There are plenty of free ones available that I could use instead.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your work on this anyway.
can you post the error message and additional context information?
do you know which file is not found?
note the code you posted is pure c++ code and doesn't contain any wx elements. c++ cannot be "run" directly but you need to compile the code and build an executable. the result of a build is an executable file (file extension .exe) on your disk. if you have problems with the build process you may do a wx tutorial first.
Sara