| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello, everyone. I ran into a problem trying to compile and run the default programs (having pre-written source code) provided by the compiler I use.
I'm using Dev-C++ 4.9.9.2 on the WinXP platform by the way... If you start Dev-C++ and click the "start new project" icon, a window comes up allowing you to choose between a Windows application, console application, static library, .dll, or empty project (all of which are under the Basic tab). If you select a new console application, click "OK," and save your project in whatever path you like (naming it whatever you like as well), the IDE editor usually shows pre-written source code that will allow you to compile and run the console application without making any changes to the default code -- thus, you'll be able to see what a console application looks like before attempting to write one yourself. I've compiled and ran the pre-written code (without changing any of it) for this simple console application before. However, when I tried to run the same default console application, I saved it to my desktop (which Dev-C++ prompts you to do before the editor appears), and when the default, pre-written code appeared in the IDE editor, instead of the normal default code: Code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char*argv[]) {
system("PAUSE");
return 0;
}
This is what appeared instead: Code:
consoleapp_c.txt What does "consoleapp_c.txt" mean, and why is this appearing rather than the aforementioned pre-written above? I don't necessarily remember changing anything in the compiler, and cannot understand why this is appearing. How can I prevent this from happening again, and how do I retrieve the normal, pre-written source code so that I can simply open it, compile, and run (as I always have in the past)? I should also mention that a similar line of text appears when trying to open a new Windows application or OpenGL application (the latter which is located under the Multimedia tab at the "choose application" screen), compile, and run the default programs. However, instead of the pre-written source code for the default Windows application, this appears: Code:
winapp_c.txt And this appears for the default OpenGL application rather than the usual pre-written source code: Code:
OpenGL.txt If anyone can help me, it would be greatly appreciated! Thanks! |
|
#2
|
|||
|
|||
|
Well I don't know why that happened, but I can try and help you fix it.
First, open up Windows Explorer and navigate to the folder where you installed Dev-C++. (maybe C:\Dev-Cpp or C:\Program Files\DevC++ or whatever). Then, go into the folder called Templates. (If there is no Templates folder, that is your problem.) Assuming you haven't changed anything in this folder, you should see some .template files and some .txt files. You will see 1-WinApp.template, 2-ConsoleApp.template, etc. Also here are some .txt files, the names of which are what you saw instead of the code inside them. If these files do not exist, this is the problem. If they exist, open them and check what is inside. There should be code. If not, that's your problem. If the files exist and the correct code is inside them, now open the .template files (do right-click->Open With... and select Notepad). You should see some settings. For example, my 1-ConsoleApp.template file looks like this: Code:
[Template] ver=1 Name=Console Application IconIndex=1 Description=A console application (MSDOS window) Catagory=Basic [Unit0] CName=main.c CppName=main.cpp C=consoleapp_c.txt Cpp=consoleapp_cpp.txt [Project] UnitCount=1 Type=1 Name=Console App SINCE Dev-C++ is freeware and under the GNU GPL, if youa re missing some of these files or if they are corrupted, I'm pretty sure I could email you the files or attach them here. (I can't see anything wrong with that since I can just download Dev-C++ and have the files, free.) HTH, The UberGeek |
|
#3
|
|||
|
|||
|
I looked in the Templates folder and much to my surprise (!) the template files were there, but I had no text (.txt) files. This is curious, because I haven't touched this folder since I've downloaded and installed Dev-C++ 4.9.9.2. How do I put those text files back in the Templates folder? Or would I have to do something like uninstall my current installation of Dev-C++ and reinstall the same version to retrieve the "lost" text files? Any help would be appreciated; Thanks.
|
|
#4
|
|||
|
|||
|
I have replied to your PM to that effect.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Console Application Trouble |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|