Author Topic: Project has not been built yet error.  (Read 6827 times)

Offline stbradley

  • Single posting newcomer
  • *
  • Posts: 4
Project has not been built yet error.
« on: March 18, 2010, 05:29:24 pm »
Hello Everyone,

I was recently laid-off so I now have entirely too much time on my hands.  As a conseqence I have been trying to keep myself busy.  So, for no reason other then to see if I can do it, I have been installing additional compilers to Code::Blocks.

I have installed the GNU FORTRAN 77 compiler.  Since you have done most of the work (added syntax highlighting and an 'F' icon in the resource) I did not have any problems in getting Code:Blocks to compile FORTRAN source code.

I next installed the GNU Pascal compiler, (I realize that not very many people write code in Pascal anymore).  I am having a relatively minor problem getting Code::Blocks to compile Pascal which I didn't have with FORTRAN.  It has to do with a setting within Code::Blocks and has nothing to do with this being a Pascal program.

Just to let you know exactly what I've done, here is an outline.

1) I installed the GNU Pascal compiler and tested it from the command line.
2) I added it to Code::Blocks via the usual method:
   a) Settings > Compiler and debugger...
   b) Selected 'GNU GCC Compiler' > Copy > Renamed it 'GNU Pascal Compiler'.
   c) Selected 'GNU Pascal Compiler' > Toolchain executables > changed 'C compiler', 'C++ compiler' and 'Linker for dynamic libs' all to gpc.exe (the Pascal compiler).
3) Selected Project > Project Tree > Edit file types & catagories.
4) Clicked Add and added 'Pascal Sources' and added the Pascal extensions: *.p;*.pas;*.pp;*.dpr
5) To test it out I created a new C project and selected the Pascal compiler. Then I added a new Empty file to the project and saved it as hello.pas.  (I also removed from the project the default source code main.c generated by CodeBlocks.)
6) I added a hello world pascal source code and then attempted to compile and run it.
7) When I compile and run I get the message "It seems that this project has not been built yet.  Do you want to build it now?"  Clicking the 'Yes' button simply causes this message to reappear. 

The solution to this problem is to hilight hello.pas in the 'Open files list', right click, select 'Properties...', select the 'Build' tab, and put a checkmark next to 'Compile file' and 'Link file'. 

Alternatively, I could select Project > Properties..., Build targets tab, select the hello.pas in 'Build target files', click 'Selected file properties' button and again select the 'Build' tab and check Compile file and Link file. 

My question is: How can it get CodeBlocks to automatically check these two settings so I don't have to do it every time?

Thanks for your time.

S. Thomas Bradley