User forums > Using Code::Blocks

Compile a single file

(1/2) > >>

gib:
Is it possible in CB to compile a single file in the list of target files?  This can be done in Visual Studio.

oBFusCATed:
I'm not sure I understand the question. Can you try to describe it with more details?

gib:
Say I have a project composed of several files.  Instead of building the target completely I want to test compilation only of a single file.  You might question why anyone would want to do this.  I have occasionally had reason to do this using VS, and I'm just wondering if it's possible in CB. 

stahta01:
Select the file you wish to compile in the Project Tab in the Management Window.

Right Click and choose "Build File"; you might need to do "Clean File" first.

Tim S.
 

gib:
Thanks!  I feel pretty stupid not to have seen that.  I guess I was looking for 'compile', not 'build'.

There seems to be an issue with MinGW Fortran, though, in my CB version at any rate (13.12):

mingw32-gfortran.exe -J   -c D:\trophocell3D-abm\src\fmotion.f90 -o \src\fmotion.o
D:\trophocell3D-abm\src\fmotion.f90:4.4:
use global
    1
Fatal Error: File 'global.mod' opened at (1) is not a GFORTRAN module file

The file I am compiling uses module global, which does exist (obviously) - the target DLL builds OK.  Interestingly it finds global.mod but doesn't recognise it.  This not a problem, in any case.

Navigation

[0] Message Index

[#] Next page

Go to full version