I whanted to use a text editor (I use crimson editor) to write my code and compile the code whithout getting out of the editor. Crimson has that option, but I don't know what files of Dev-C++ I should use. Can someone help me? (I code only in C, but you can post the solution to C++ too).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Crimson editor rules, i use it for pretty much everything, including opening source files. However, when i compiling i always use devcpp to do the "bookkeeping" and generate the makefile.
In your case you do not need the ide itself, you only need the compiler. That means that you have to create the makefile yourself and call make from crimson. I used to do it like this with the borland5.5 comandline tools. I learned the syntax of the makefile and called make to build the application.
That's all the ide does for you, it only keeps thing neatly together and generates the makefile. If you want to do it by hand you do not need an ide.
So check the syntax of the file Makefile.win and filll in the source files. Just play arround with devcpp to see how things are added. Then you can completly remove devcpp and only use mingw. Call make -f Makefile.win to build you application.
stephan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've configured the Dev-C++ compiler in Crimson editor putting the Dev-C++\bin\gcc.exe in command field and $(FileName) -o $(FileName).exe in arguments. I don't know if it's a good solution and there is a problem the file is compiled like filename.c.exe :(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your solution only works if you only have one source file. When you do some more serious coding the number of files increase and you do not want to call gcc for each seperate file individually. Also if you are going to use some external libraries you have to add some linker options. That's where you start needing the makefile.
What you can do is use devcpp to generate that makefile. Just include all your c files in a project and set the linker stuff in the project otions. Then you hit compile. You get lot's of errors because you probably didn't code anything in the c files, but that doesn't matter. Devcpp created the Makefile.win.
Now you should call Dev-C++\bin\make -f $(Filepath)Makefile.win in crimson. As long as you don't touch the Makefile.win it will always use the correct c files. Make will look if the c file is newer then the exe. If so it will compile it. So every time you save a c file and call make it will be compiled and the c files you didn't touch will not be compiled but they are linked into the exe file.
The advantage of this method is that it scales better with the size of your coding projects and it also solves your problem with the .c.exe filename. This happens because you use $(Filename), but using the makefile you don't need to specify the filename because it is already in the makefile itself....
stephan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2002-09-13
I used to operate gcc (the compiler Dev-C++ uses) from the command line, so I've put together a couple of tools to make that task simpler. These are called the "cltools" and you can find them on: www.gisan.cjb.net.
Later, on Windows, I've started using an editor named "ConTEXT" and have the cltools as external programs. I guess that is similar to what you are asking (sorry I do not know the "crimson" editor).
If you need help with the cltools, post your message on the Dev mailing list, its a lot easier for me to work offline than to monitor the forum.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I whanted to use a text editor (I use crimson editor) to write my code and compile the code whithout getting out of the editor. Crimson has that option, but I don't know what files of Dev-C++ I should use. Can someone help me? (I code only in C, but you can post the solution to C++ too).
Crimson editor rules, i use it for pretty much everything, including opening source files. However, when i compiling i always use devcpp to do the "bookkeeping" and generate the makefile.
In your case you do not need the ide itself, you only need the compiler. That means that you have to create the makefile yourself and call make from crimson. I used to do it like this with the borland5.5 comandline tools. I learned the syntax of the makefile and called make to build the application.
That's all the ide does for you, it only keeps thing neatly together and generates the makefile. If you want to do it by hand you do not need an ide.
So check the syntax of the file Makefile.win and filll in the source files. Just play arround with devcpp to see how things are added. Then you can completly remove devcpp and only use mingw. Call make -f Makefile.win to build you application.
stephan
I've configured the Dev-C++ compiler in Crimson editor putting the Dev-C++\bin\gcc.exe in command field and $(FileName) -o $(FileName).exe in arguments. I don't know if it's a good solution and there is a problem the file is compiled like filename.c.exe :(
Your solution only works if you only have one source file. When you do some more serious coding the number of files increase and you do not want to call gcc for each seperate file individually. Also if you are going to use some external libraries you have to add some linker options. That's where you start needing the makefile.
What you can do is use devcpp to generate that makefile. Just include all your c files in a project and set the linker stuff in the project otions. Then you hit compile. You get lot's of errors because you probably didn't code anything in the c files, but that doesn't matter. Devcpp created the Makefile.win.
Now you should call Dev-C++\bin\make -f $(Filepath)Makefile.win in crimson. As long as you don't touch the Makefile.win it will always use the correct c files. Make will look if the c file is newer then the exe. If so it will compile it. So every time you save a c file and call make it will be compiled and the c files you didn't touch will not be compiled but they are linked into the exe file.
The advantage of this method is that it scales better with the size of your coding projects and it also solves your problem with the .c.exe filename. This happens because you use $(Filename), but using the makefile you don't need to specify the filename because it is already in the makefile itself....
stephan
I used to operate gcc (the compiler Dev-C++ uses) from the command line, so I've put together a couple of tools to make that task simpler. These are called the "cltools" and you can find them on: www.gisan.cjb.net.
Later, on Windows, I've started using an editor named "ConTEXT" and have the cltools as external programs. I guess that is similar to what you are asking (sorry I do not know the "crimson" editor).
If you need help with the cltools, post your message on the Dev mailing list, its a lot easier for me to work offline than to monitor the forum.