Archived

This topic is now archived and is closed to further replies.

Help big big problem with C++ STILL! (at 5 posts)

This topic is 5151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Help whenever I try to make a program It comes up with somthing bad. for example when i start up Microsoft Visual C++ I go into file, click new, click on the projects tab, click on the win32 4console application, type in the name for it where its says "Project Name" as form1, then i click OK, it ask me what kind of console application i wanna make, i click empty project, then i click ok, THEN i click the "New Text File" button on the very very left, then i type up the code for lets say the Hello World thing, then i press "Go" button on right and then it say "C:\ Program Files\ Microsoft Visual Studio\Myprojects\form1\debug\form1.exe This File Does Not Exist, Would You Like To Build It?" so i click Yes, and then it say "C:\ Program Files\ Microsoft Visual Studio\Myprojects\form1\debug\form1.exe File Not Found" and it only gimme the OK button so I click OK. HEEELP! ------------------------------------------------ in a empty Forum, no one can hear you scream! ahhhhhhhhhhhhhhhhhhhhhh [edited by - hekki on November 8, 2003 8:24:22 PM] [edited by - hekki on November 8, 2003 8:36:05 PM] [edited by - hekki on November 8, 2003 9:11:37 PM] [edited by - hekki on November 8, 2003 9:35:44 PM] [edited by - hekki on November 8, 2003 9:36:27 PM]

Share this post


Link to post
Share on other sites
Your entering your code into a *.txt file, not into a .cpp file. Go to File > New, then go under the Files tab, and click C++ Source File. Then enter your code in your *.cpp file. Then it will compile.

Share this post


Link to post
Share on other sites
help... it didnt work... same error... i made a new file... it was a .cpp file... i typed in the code... was i suppose to save it?... i put in the basic tetris code... heeeeeeeeeeeeeeeeeelp... heeeeeeelp

Share this post


Link to post
Share on other sites
ok i saved it and pressed go and now this is what it says in the build thingy: " --------------------Configuration: Tetrees - Win32 Debug--------------------
Compiling...
Tetrees.cpp
c:\program files\tetrees.cpp(2) : fatal error C1083: Cannot open include file: ''allegro.h'': No such file or directory
Error executing cl.exe.

Tetrees.exe - 1 error(s), 0 warning(s)"

Heeeeeeeeeeeeeelp! btw Tetrees = Tetris :D


---------------------------------------
In a empty Forum, no one can hear you scream!
ahhhhhhhhhhhhhhhhhhhh

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You are trying to make tetris and you don''t even know how to work the IDE. How about a hardy RTFM followed by a heart felt LTFL (learn the friendly language).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What I am saying is, read the manual (msdn.com, google.com etc.) and learn the language (that is to say C++) before you start trying to make tetris or any other semi-complex program. Books are a good start. Effective C++ or Dietel & Dietel Learn C++ are good for learning the language. To learn the IDE, search MSDN, you should find walk thrus on how to setup a project. I wasn''t trying to flame you, it just sounds like you are putting the cart before the horse. You need to just get a "Hello World" app to compile and run and then move on to something a bit more complex.

Share this post


Link to post
Share on other sites
Yeah but its not only the tetris, even "Hello World" is messing up, thats why i started the tetris with the .txt instead of .cpp, i was following the directions to Learn C++ in 21 Days, not that its actualy possible, and some other tutorials and i cant program anything without that error popping up

Share this post


Link to post
Share on other sites
Like smart idiot has suggested, you probably didn''t setup allegro to work with your compiler.

Just do a simple console-based hello world program first before jumping into graphics. Judging by the error you''re getting you probably have that allegro.h file included at the top of your source somewhere. Just remove it so it doesn''t look for that file; you have no use for it at this point anyway -- you need to learn the basics first.

The line probably looks something like this -- not sure of the exact name as I don''t use allegro


#include "allegro.h"






--{You fight like a dairy farmer!}

Share this post


Link to post
Share on other sites
quote:
Original post by Hekki
Yeah but its not only the tetris, even "Hello World" is messing up, thats why i started the tetris with the .txt instead of .cpp, i was following the directions to Learn C++ in 21 Days, not that its actualy possible, and some other tutorials and i cant program anything without that error popping up



You shouldn''t need allegro for a "hello world" program. Are you sure it''s the same error for the hello world?

Share this post


Link to post
Share on other sites
YES! I got it to say "Hello World"!!!!!! IM A PRO PROGRAMMER! IM GONNA SELL MY "Hello World" PROGRAM AND MAKE MILLIONS!!! ...no im just kidding, but it did work, my very first C++ program is complete! Im so happy. Dude this "Teach Yourself C++ in 21 days" is awesome!

[edited by - hekki on November 8, 2003 10:50:52 PM]

Share this post


Link to post
Share on other sites