Code::Blocks Forums

User forums => Help => Topic started by: marccinn on May 09, 2010, 04:14:10 pm

Title: Code::Blocks - configuration (MS Windows)
Post by: marccinn on May 09, 2010, 04:14:10 pm
Hi. I'd like to use C::B as the IDE to Pascal... yes, I want compile my programs with FPC. I hope it is possible to configure codeblocks to make it easier.

I added pascal syntax to Editor with no problems. My problem appears when I want to compile an example program - the FPC syntax is a bit different than GCC and very simplier, something like that - I've got my program in 'hello.pas' file, now type in console just "fpc hello" or "fpc hello.pas" and if no errors, I'm able to launch 'hello.exe'. When typing "fpc hello.pas -o hello.exe", the '-o' is an incorrect option.

Ok, my questions are:
1. How to cause Code::Blocks to compile .pas files with FPC (and to compile it ever; now, although all paths are set correctly, when pressed F9 I see only "nothing to be done"; but if extension of the file is e.g. *.cpp, fpc is ran) ?
2. How to modify the compiler's command line in IDE? When compilinkg, I want "fpc hello.pas" against "fpc hello.pas -o hello.pas".

Thanks in advice for help.
Title: Re: Code::Blocks - configuration (MS Windows)
Post by: oBFusCATed on May 09, 2010, 06:09:37 pm
Here is a link that could help: http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system
Title: Re: Code::Blocks - configuration (MS Windows)
Post by: marccinn on May 09, 2010, 08:11:22 pm
Thanks a lot for this. Compilation is now OK, but the source file still must have a C or C++ extension - http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system#...and_how_things_have_evolved - I think it doesn't work... or I cannot set 'pas' extension as default. And I don't want to create a project, specially to may compile a single file...