I found a way to do exactly what you are talking about, I found the need myself, so I programmed some extentions that run from the Run menu, it only works if you have Bloodshed Dev C++ installed in your C:/ drive and you have to set an environmental variable for C:/Dev-Cpp/bin. It's all pretty basic though.
First thing I made was Compile.exe which takes the argument "$(CURRENT_DIRECTORY)/" when executed and creates compile.bat in the current file's directory and executes it, which executes make.exe in C:/Dev-Cpp/bin and compiles main.cpp using the rules specfied in makefile.win(See next paragraph...) in the current file's directory and executes Program_Name.exe whcih is the compiled result.
I also created MakeGen_v1_0.exe, which takes in the argument "$(CURRENT_DIRECTORY)" and allows you to easily generate a makefile.win in the current project's directory, which is the first step of use aside from creating main.cpp and loading it into Notepad++, I didn't put too much effort into this program though, there's an editable area that allows you to specify libraries to include in the linking process and one to manually edit the result of the makefile, it also has three radio buttons that allow you to specify what type of application you want to make (Windows app, Console app,or DLL).
I'd post the source codes but I used some libraries that I ended up making over time to assist me in string/file manipulation and such and would be a lot of code to post here so reply to this message if you're interested and I'll set up a way that you can download the files necessary and walk you through setting it up so that you can use Notepad++ as your IDE for C++.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Notepad++ is a code editor. It doesn't support projects. I don't think it's even possible to add support for compilers without project support.
Sure, you could compile a single file into it's binary representation (OBJ or O file - depending on the compiler), but it is completely impossible to link those binary files into an executable file.
Your best bet is to use make (or nmake or any other make-like tool).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there any compiler out there that is as simple as running a simple command in the command prompt like:
cppCompile.exe -myscript.cc
Ive been looking around for one but am not having much luck... i dont really care for having an interface and would much rather have a text-to-script compiler...
thanks...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All compilers are command-line executables. All interpreters are command-line executables. Even if the compiler or interpreter only has a GUI interface (not command-line) - it can still be run from the command-line.
The best compiler I can think of is Microsoft Visual C++ compiler. There's a free version of it that comes with Visual C++ 2005 Express Edition. There's also a nice free version of Turbo C++ from Borland. However, both of those only come packaged with the Integrated Development Environments, so I guess you don't want them.
A little off-topic, but I think it's important...
Why don't you learn to use google? Or wikipedia? The most important thing for a programmer is to be able to find information. Now, looks like you have failed with your very first task - finding a compiler to use.
And, as a last note, I would really recommend to get a full IDE with project management and debugging features. You don't sound like a professional programmer, so you'll only make it harder on yourself by using a text editor and doing it all The Hard Way...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is also a version of GCC, which includes the g++ compiler, from 'mingw.org' that will work with windows. GCC itself will work with mac and linux if that is your OS.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've used the free C++ compiler from Borland with other text editors before, is there no way to use Notepad++ to write the code then execute the compiler passing the details to it?
You did this by telling the text editor where the compiler was and then passed certain parameters to it, file name and path. It the executed the compiler as a console command. I've also used NSIS installer this way as well when writing scripts for it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a way to include a C++ compiler in Notepad++ so I don't have to use an external one?
I found a way to do exactly what you are talking about, I found the need myself, so I programmed some extentions that run from the Run menu, it only works if you have Bloodshed Dev C++ installed in your C:/ drive and you have to set an environmental variable for C:/Dev-Cpp/bin. It's all pretty basic though.
First thing I made was Compile.exe which takes the argument "$(CURRENT_DIRECTORY)/" when executed and creates compile.bat in the current file's directory and executes it, which executes make.exe in C:/Dev-Cpp/bin and compiles main.cpp using the rules specfied in makefile.win(See next paragraph...) in the current file's directory and executes Program_Name.exe whcih is the compiled result.
I also created MakeGen_v1_0.exe, which takes in the argument "$(CURRENT_DIRECTORY)" and allows you to easily generate a makefile.win in the current project's directory, which is the first step of use aside from creating main.cpp and loading it into Notepad++, I didn't put too much effort into this program though, there's an editable area that allows you to specify libraries to include in the linking process and one to manually edit the result of the makefile, it also has three radio buttons that allow you to specify what type of application you want to make (Windows app, Console app,or DLL).
I'd post the source codes but I used some libraries that I ended up making over time to assist me in string/file manipulation and such and would be a lot of code to post here so reply to this message if you're interested and I'll set up a way that you can download the files necessary and walk you through setting it up so that you can use Notepad++ as your IDE for C++.
Notepad++ is a code editor. It doesn't support projects. I don't think it's even possible to add support for compilers without project support.
Sure, you could compile a single file into it's binary representation (OBJ or O file - depending on the compiler), but it is completely impossible to link those binary files into an executable file.
Your best bet is to use make (or nmake or any other make-like tool).
Is there any compiler out there that is as simple as running a simple command in the command prompt like:
cppCompile.exe -myscript.cc
Ive been looking around for one but am not having much luck... i dont really care for having an interface and would much rather have a text-to-script compiler...
thanks...
You don't know much about compilers, do you? :)
All compilers are command-line executables. All interpreters are command-line executables. Even if the compiler or interpreter only has a GUI interface (not command-line) - it can still be run from the command-line.
The best compiler I can think of is Microsoft Visual C++ compiler. There's a free version of it that comes with Visual C++ 2005 Express Edition. There's also a nice free version of Turbo C++ from Borland. However, both of those only come packaged with the Integrated Development Environments, so I guess you don't want them.
You can see a nice list of C++ compilers on Wikipedia: http://en.wikipedia.org/wiki/List_of_C%2B%2B_compilers_and_integrated_development_environments#C.2FC.2B.2B_compilers
A little off-topic, but I think it's important...
Why don't you learn to use google? Or wikipedia? The most important thing for a programmer is to be able to find information. Now, looks like you have failed with your very first task - finding a compiler to use.
And, as a last note, I would really recommend to get a full IDE with project management and debugging features. You don't sound like a professional programmer, so you'll only make it harder on yourself by using a text editor and doing it all The Hard Way...
There is also a version of GCC, which includes the g++ compiler, from 'mingw.org' that will work with windows. GCC itself will work with mac and linux if that is your OS.
I've used the free C++ compiler from Borland with other text editors before, is there no way to use Notepad++ to write the code then execute the compiler passing the details to it?
You did this by telling the text editor where the compiler was and then passed certain parameters to it, file name and path. It the executed the compiler as a console command. I've also used NSIS installer this way as well when writing scripts for it.
I posted the above comment. Looks like NppExec is what I need.
http://sourceforge.net/forum/message.php?msg_id=4243323
- Tim