C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 19th, 2005, 01:32 PM
mishna_toreh mishna_toreh is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: United States
Posts: 5 mishna_toreh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 33 sec
Reputation Power: 0
Exclamation Console Application Trouble

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!

Reply With Quote
  #2  
Old May 19th, 2005, 05:17 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 4
Send a message via AIM to ubergeek
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

Reply With Quote
  #3  
Old May 19th, 2005, 09:35 PM
mishna_toreh mishna_toreh is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: United States
Posts: 5 mishna_toreh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 33 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old May 19th, 2005, 09:45 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 4
Send a message via AIM to ubergeek
I have replied to your PM to that effect.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Console Application Trouble


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT