There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer audio black screen boot bsod computer connection crash css dell display driver drivers email error ethernet excel explorer firefox firefox 3 game hard drive internet internet explorer itunes laptop lcd linux malware network networking nvidia outlook outlook 2003 outlook express partition printer problem router slow software sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Solved: cannot compile


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
Neumie's Avatar
Senior Member with 104 posts.
 
Join Date: Nov 2004
Experience: Intermediate
13-Dec-2004, 06:46 AM #1
Question Solved: cannot compile
im using a program called Dev C++ from bloodshed. Every time i try to compile a file is says some thing like "cannot find file". If you need the exact error just ask.
I get the exact same error if i try to use Visual C++ 6.0. I'm Using Windows Xp Home Edition. And it's happening on a simple hello program that the compiler automatically generates. Do i need extra packages or anything?
Any ideas are most welcome
Thank you
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
13-Dec-2004, 07:52 AM #2
Try it with a proper hello world program.

Code:
#include <iostream>

using namespace std;

int main() {
    cout << endl << "Hello World!" << endl;
}
haplo210's Avatar
Senior Member with 1,005 posts.
 
Join Date: Nov 2004
Location: Near where Irn Bru's made
Experience: Intermediate
13-Dec-2004, 02:37 PM #3
Are you remebering to save the program before running, C++ is very pernicity about things like that, unless it can find the file on the hard disk it wont work, been the cause of a few progreamming errors with me.
Neumie's Avatar
Senior Member with 104 posts.
 
Join Date: Nov 2004
Experience: Intermediate
15-Dec-2004, 07:43 AM #4
when you hit the compile button it automatically saves the file. Ill send you the exact error as soon as i can. It's saying it's having a problem finding the make file or something. Its the same problems with a few compliers including visual C++ 6.0 so it's not the progs im using. Do you need anything else besides the likes of visual or should it work like normal?
Thanks in advance
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
15-Dec-2004, 08:16 AM #5
try this

create folder c:\test

type the hello world program in a text editor (make sure there's a newline at the end of the file).

save it as hello.cpp in c:\test

use explorer to goto c:\test.

right-click on hello.cpp
open with
DevC++

After it loads in DevC++, click execute>compile and see what happens.

If it still has a problem, check in DevC++ under

tools
compiler options

check the directories and programs tab, and make sure all the paths are correct.

If they are correct and still have a problem, you might need to add the mingw bin directory to the windows PATH.

right-click on MyComputer
Left-click on properties
advanced tab
environmental variables button
edit the system PATH variable and add ;path to mingw bin directory

If none of that helps, then we'll try on the command line. (make sure you have the mingw bin directory set in the PATH.

start
run
cmd.exe
cd c:\test
g++ -Wall -Wextra hello.cpp -o hello

That should do it.

(replace -Wextra with just -W if you don't have a new version of mingw).

You should be able to compile one way or another.
__________________
10 ? "a line as the unending horizon"
20 ? "a curve as the rolling hillside"
30 ? "a point as a distant bird"
40 ? "a ray as the rising sun"
run
haplo210's Avatar
Senior Member with 1,005 posts.
 
Join Date: Nov 2004
Location: Near where Irn Bru's made
Experience: Intermediate
16-Dec-2004, 04:28 AM #6
sorry didnt realise it auto-saves. My version of C++ builder 6 doesnt i dont think. It doesnt like to run my programs unless i choose to save it all first. hmm. Soryy i cantr be more help.
Neumie's Avatar
Senior Member with 104 posts.
 
Join Date: Nov 2004
Experience: Intermediate
17-Dec-2004, 04:43 AM #7
all help is most appreciated :-). I'm doing exams now so ill try all your suggestions as soon as i can.
Thanks again
Neumie's Avatar
Senior Member with 104 posts.
 
Join Date: Nov 2004
Experience: Intermediate
10-Jan-2005, 08:37 AM #8
well some good news. it looks like i could be in business now. The compiler had no bin files to play with so it now has some. im getting the error "No new line at end of file". no idea what that is but at least its a proper error. Thanks for the help and sorry about te delay in getting back to you. College has just started again :-).
Thanks again
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
10-Jan-2005, 02:47 PM #9
Make sure the last line in the cpp file is blank. (press enter to create a newline at the of the file. You do this in the editor you are using).
Neumie's Avatar
Senior Member with 104 posts.
 
Join Date: Nov 2004
Experience: Intermediate
12-Jan-2005, 10:11 AM #10
well it works like a charm. on another note does the following not work?. this is what i learned a few years ago but it has been a while

#include <iostream.h>

int main()
{
cout<<"Wickky etc"<<endl; //Arrows may be the wrong way its been a while
}

Thats how i did it back in the day. Anyway it compiled and ran the program no problem. Thanks everyone for all your help. I can finally start on those directX 9 tutorials :-D
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
12-Jan-2005, 04:20 PM #11
That may work on some modern compilers,. If it does, it should display a warning about using deprecated headers.

see post #2 above for the correct way.

BTW, if you use DevC++ (which uses MinGW), you'll have to convert the DirectX libraries before you can use them with MinGW.

Here are directions for doing that. (after the process is all done, the .o files are not needed and you can delete them. Just keep the .a and .def files).
__________________
10 ? "a line as the unending horizon"
20 ? "a curve as the rolling hillside"
30 ? "a point as a distant bird"
40 ? "a ray as the rising sun"
run

Last edited by Shadow2531 : 12-Jan-2005 04:34 PM.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:42 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.