Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Can C::B Compile one by one?

(1/1)

mdyty,:
Hello i am new at Code Blocks, i have a problem.

If you ever try dev c++, you can have some tab (look at the picture) and compile the tab what you open.



the open tab is jcmes.cpp so jcmes is compiled
because if i am make 2 c++ file, and i want to compile the second one it says " multiple definition of main"

please help me.
Iam sorry if my english is bad hehe :D

CJS:
This is for Code::Blocks 16.01 with the GNU GCC compiler (although I think it's been available for earlier versions): If you have a source code file open in Code::Blocks, you can compile it by first selecting the open file / tab, then go to the menu and select Build / Compile current file, which has the keyboard shortcut: Ctrl + Shift + F9.

(It would be nice if this was available in Code::Blocks as a right click menu option on the open file tab itself.)

Results will be shown on the "Build messages" log, make sure you have it selected.  If the file has already been compiled, nothing much will happen apart from the display of "||=== Build file: Debug in <project name> (compiler: GNU GCC Compiler) ===|".

BlueHazzard:
NOTE: This is not the intended way to use codeblocks...
If you want to build multiple different programs (multiple main functions) you should create multiple projects, or at least create multiple targets (for every executable one target)

NOTE2: You can also build a single file on the project tree if you right click on the file..

Navigation

[0] Message Index

Go to full version