It is always preferable to have a project file, however, there is a hack that should achieve what you are trying to do:
Open
Settings->Compiler and debugger...->Other settings (tab), click on
Advanced options..., and select "Link object files to console executable" from the
Command: drop-down menu. Change the text in the
Command line macro: box from:
$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs
to:
$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs -mwindows
(I am assuming you are working on a Windows computer.)
Please note again that this is
not the suggested method (and will lead to unexpected behavior in other matters); you should
add the files to a project. This will both provide access to the additional features of Code::Blocks (target-specific settings, debugging, etc.) and manage complicated multi-file builds (that you will have to use later in programming).