Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 DEvc++ problem
Index -> Programming, C++ -> C++ Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
blackcat




PostPosted: Tue May 17, 2005 6:52 pm   Post subject: DEvc++ problem

Might sound stupid, but i've used DevC++ before and it works, now it gives me a problem, and i've tried to reinstall it adn everything


---------------------------
Confirm
---------------------------
There doesn't seem to be GNU Make file in PATH or in Dev-C++'s Bin path. Please make sure that you have GNU Make and adjust Bin setting or system PATH environment variable and that make setting in Compiler Option contains correct filename, otherwise you will not be able to compile anything.
---------------------------
OK
---------------------------



thats before the splash comes up when i start the program

also
if i go to compiler options.. it gives me the same error
and because of that i cant even compile hello world programs, etc.


second question

i downloaded and installed MinGW but how do ieven run it/ its just directories and files, etc? i thought it was graphical Rolling Eyes
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Tue May 17, 2005 6:59 pm   Post subject: (No subject)

Dev-C++ simply wraps a GUI around the various options you can provide to GCC's g++ compiler.

For simple academic purposes, I highly recommend becoming familiar with how to use the command-line. Go to Start, Run, then type "cmd" and hit enter. Welcome to the (horribly limited) Windows console shell. "cd" to the directory ("folder") where you stored your C++ source file and execute the following command:

code:
C:\some\path\blah\blah\blah\> g++ source_file.cpp -o my_program.exe


Then run the program like so:

code:
C:\some\path\blah\blah\blah\> my_program


Using an IDE makes everything too frickin' complicated for those new to programming. G++ is so simple to use for students, and what do they do? They put 80 million menus and buttons on top of it.
blackcat




PostPosted: Tue May 17, 2005 7:04 pm   Post subject: (No subject)

'g++' is not recognized as an internal or external command,
operable program or batch file.
wtd




PostPosted: Tue May 17, 2005 7:30 pm   Post subject: (No subject)

blackcat wrote:
'g++' is not recognized as an internal or external command,
operable program or batch file.


Not yet anyway. Smile

Do a search for "g++.exe" or "gcc.exe". When you find that report back. Wrte down the directory it's located in.
blackcat




PostPosted: Tue May 17, 2005 8:43 pm   Post subject: (No subject)

gcc.exe d:\mingw\bin\
g++.exe d:\mingw\bin\

windows installed on c:\
blackcat




PostPosted: Tue May 17, 2005 8:47 pm   Post subject: (No subject)

also


i put my .cpp in the bin folder and tried g++ filename.cpp -o prog.exe

i got

D:\MinGW\bin>g++ main.cpp -o prog.exe
main.cpp:2:21: iosteam.h: No such file or directory
main.cpp: In function `int main()':
main.cpp:8: error: `cout' undeclared (first use this function)
main.cpp:8: error: (Each undeclared identifier is reported only once for each fu
nction it appears in.)
main.cpp:8: error: `endl' undeclared (first use this function)

D:\MinGW\bin>


EDIT: that code was wrong so i got a new hello world from the net and i did it again and it works, but i get a error...

D:\MinGW\bin>g++ x.cpp -o test.exe
In file included from ../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bac
kward/iostream.h:31,
from x.cpp:1:
../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/backward/backward_warning
.h:32:2: warning: #warning This file includes at least one deprecated or antiqua
ted header. Please consider using one of the 32 headers found in section 17.4.1.
2 of the C++ standard. Examples include substituting the <X> header for the <X.h
> header for C++ includes, or <iostream> instead of the deprecated header <iostr
eam.h>. To disable this warning use -Wno-deprecated.

D:\MinGW\bin>test
Hello World!
D:\MinGW\bin>
wtd




PostPosted: Tue May 17, 2005 8:49 pm   Post subject: (No subject)

blackcat wrote:
gcc.exe d:\mingw\bin\
g++.exe d:\mingw\bin\

windows installed on c:\


Is this Windows XP?
wtd




PostPosted: Tue May 17, 2005 8:51 pm   Post subject: (No subject)

blackcat wrote:
also


i put my .cpp in the bin folder and tried g++ filename.cpp -o prog.exe

i got

D:\MinGW\bin>g++ main.cpp -o prog.exe
main.cpp:2:21: iosteam.h: No such file or directory
main.cpp: In function `int main()':
main.cpp:8: error: `cout' undeclared (first use this function)
main.cpp:8: error: (Each undeclared identifier is reported only once for each fu
nction it appears in.)
main.cpp:8: error: `endl' undeclared (first use this function)

D:\MinGW\bin>


Your problem is that the C++ source code you're using is old, and deprecated (no longer guaranteed to work).

The "iostream.h" header is deprecated. Use "iostream". Also, with this, the "std" (standard) namespace is not used by default, so you have to prepend "cout" and "endl" with "std::" to clearly indicate they live in the standard namespace.
Sponsor
Sponsor
Sponsor
sponsor
blackcat




PostPosted: Tue May 17, 2005 8:56 pm   Post subject: (No subject)

also ok if i start using commandline, what program should i use to just 'edit' and make prog? like a prog that can tell me the line # and etc/ [editor]
wtd




PostPosted: Tue May 17, 2005 9:08 pm   Post subject: (No subject)

blackcat wrote:
also ok if i start using commandline, what program should i use to just 'edit' and make prog? like a prog that can tell me the line # and etc/ [editor]


I like Textpad for an editor on Windows. You can download a C++ syntax highlighting plug-in from their site.

http://www.textpad.com

What you need to do is add the path "d:\mingw\bin" to your PATH environment variable. Not quite sure how to do this with Windows XP, though. Googling should turn up a good guide.

If you do this youll be able to use g++ from any directory.
blackcat




PostPosted: Tue May 17, 2005 9:33 pm   Post subject: (No subject)

http://csjava.occ.cccd.edu/~gilberts/mingw/

it tells u in pics how to set the variable

but my pic is different:


Posted Image, might have been reduced in size. Click Image to view fullscreen.
wtd




PostPosted: Tue May 17, 2005 9:42 pm   Post subject: (No subject)

In the lower of the two lists, make sure you select the "Path" variable and click "Edit". Then add "d:\mingw\bin\;" to the beginning of that field.
blackcat




PostPosted: Wed May 18, 2005 12:10 pm   Post subject: (No subject)

hey i did it, i added the thing, now i can use it anywhere, this is a good trick in winxp...also. ddevc++ automatically detected it, and now uses it, so it compiles fine now... i juts wanted to know

if my files (.dev's .cpp's) are named lets say hi.dev

the output file is hi.exe

what code do i add in the program (console app)
that...the output filename can be what i wnat it to be?
blackcat




PostPosted: Wed May 18, 2005 9:52 pm   Post subject: (No subject)

bump
wtd




PostPosted: Wed May 18, 2005 9:56 pm   Post subject: (No subject)

I don't know. I don't use Dev-C++.

With the command-line front-end to the compiler, use the "-o" option.

code:
C:\> g++ my_source.cpp -o xyz.exe
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 19 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: