Author |
Message |
Windsurfer
![](http://photo-origin.tickle.com/image/118/9/8/O/118982819O270687078.jpg)
|
Posted: Sun Dec 10, 2006 2:01 pm Post subject: Help with compiling |
|
|
Hi
Maybe this should belong in general... but...
In my programming class, we use Dev C++. All we've been taught about this API is to use F9 to compile and run.
However, I would like to use Notepad++http://notepad-plus.sourceforge.net/ to write code. Now, i know how to use the command prompt, sort of, and how to compile and run a program. Something like code: |
g++ myprog.cpp -Wall -o myprog.exe |
and then to run it, use something like
(PS i'm running WinXP)
Now, it works, sure, but it is tedious compared to just pressing F9. I was hoping someone knew how i could, in windows, compile and run in one line.
The reason I want it in one line is so that I can integrate the g++ compiler with Notepad++.
Anyone know? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
wtd
|
Posted: Sun Dec 10, 2006 2:20 pm Post subject: (No subject) |
|
|
First off, you only need to type "myprog" to execute the resulting executable.
Secondly, you can create makefiles to make this whole process potentially simpler.
Your makefile would look something like:
code: | CC = g++
LN = g++
CXX_FLAGS = -Wall
EXE_NAME = myprog.exe
DELETE = del
all : myprog
myprog : myprog.o
${LN} myprog.o -o ${EXE_NAME}
myprog.o : myprog.cpp
${CC} ${CXX_FLAGS} myprog.cpp -o myprog.o
clean :
touch myprog.o
touch ${EXE_NAME}
${DELETE} myprog.o ${EXE_NAME} |
Then you can build your app with a simple:
And when you want to get back to a clean base to build it again:
|
|
|
|
|
![](images/spacer.gif) |
Windsurfer
![](http://photo-origin.tickle.com/image/118/9/8/O/118982819O270687078.jpg)
|
Posted: Sun Dec 10, 2006 3:03 pm Post subject: (No subject) |
|
|
Uhm, okay... and I need to get "GNU make" for this? and how do I apply this to a program like Notepad++ as a shell command? |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Sun Dec 10, 2006 4:28 pm Post subject: (No subject) |
|
|
Keep a cmd.exe window open. Keep a Notepad window open. Edit in Notepad++, compile in the command prompt window. |
|
|
|
|
![](images/spacer.gif) |
Windsurfer
![](http://photo-origin.tickle.com/image/118/9/8/O/118982819O270687078.jpg)
|
Posted: Sun Dec 10, 2006 7:29 pm Post subject: (No subject) |
|
|
Well that's annoying. I'm sure there is a way to do it within Notepad++. I'm switching to perl instead... ![Razz Razz](http://compsci.ca/v3/images/smiles/icon_razz.gif) |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Sun Dec 10, 2006 7:43 pm Post subject: (No subject) |
|
|
Perl's a fine language too.
But not having a fancy IDE isn't a huge issue. Plus, it doesn't get much more simple than a text editor and a command-line. |
|
|
|
|
![](images/spacer.gif) |
md
![](http://compsci.ca/v3/uploads/user_avatars/1849317514ed6c4399768d.png)
|
Posted: Sun Dec 10, 2006 11:32 pm Post subject: (No subject) |
|
|
text editor + command line is great. The only problem I have is that terminal windows are too small at 8- characters wide, errors are much easier to read when they are not spread over 6 lines. |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Sun Dec 10, 2006 11:33 pm Post subject: (No subject) |
|
|
Windows command windows can be made wider. Right-click the titlebar and select properties. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
md
![](http://compsci.ca/v3/uploads/user_avatars/1849317514ed6c4399768d.png)
|
Posted: Mon Dec 11, 2006 2:23 pm Post subject: (No subject) |
|
|
Or you can do like me and use linux Variable sized terminals are wonderful! |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Mon Dec 11, 2006 2:36 pm Post subject: (No subject) |
|
|
Yes, but one has to give Windows credit where it's due. Doing that just makes it look even less impressive, in my opinion. ![Smile Smile](http://compsci.ca/v3/images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
|