Hi,
I have been looking at Tntnet at tntnet.org (website down at the moment of writing). It has a way of creating web applications using C++, which I find interesting. Even more interesting is that you can create "stand alone" web applications that contain their own web server, it is simply a special form of C++ console application. That means it is possible to use Code::Blocks for such web development. Tntnet has a special file type *.ecpp which compiles into *.cpp using the ecpp compiler:
ecppc <filename>.ecpp -o <filename>.cpp
Obviously, the output *.cpp file is further compiled using the C++ compiler in the normal way. One may do this using makefiles, however, I would much prefer to use the Code::Blocks build system instead.
My question is therefore: What do I need to do in Code::Blocks to make it recognize *.ecpp files. compile them using the ecppc compiler and immediately compile/link the resulting *.cpp file using g++?
Have you read this: http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system
Well go to settings->environment and then file extension handling and add *.ecpp
Then for the project itself, use the Pre-build section on Pre/Post build step tab to run the command to convert the .ecpp files to .cpp. This is in "project build settings".
From there whatever compiler your using should work fine as long as you remember to add any new cpp files that you create to the project.
Or you can use the advanced options in the compiler settings to add proper seamless support like oBFusCATed suggested.
Quote from: oBFusCATed on December 30, 2013, 09:59:14 PM
Have you read this: http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system
Thanks a lot! I searched around quite a bit, but obviously didn't choose the right search words!
I ended up doing this, which seems to work perfectly
(http://arnholm.org/screenshots/ecpp.png)
Notice that the dialog has a confusing description of macros, for example
$file_dir is presented as
$filedir, that had me fooled for a while. The Windows version of the same dialog is even more deceptive, as no underscores are shown at all. I would not have figured that out without the examples in the link you provided.
The correct path to this configuration dialog now appears to be
Settings->Compiler->Other settings. Look for "Advanced options" in lower right, it's easy to miss.
I did a couple of test runs with ecpp files and it really works beautifully in Code::Blocks.
Quote from: cacb on December 30, 2013, 11:16:04 PM
Quote from: oBFusCATed on December 30, 2013, 09:59:14 PM
Have you read this: http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system
Thanks a lot! I searched around quite a bit, but obviously didn't choose the right search words!
I ended up doing this, which seems to work perfectly
Notice that the dialog has a confusing description of macros, for example $file_dir is presented as $filedir, that had me fooled for a while. The Windows version of the same dialog is even more deceptive, as no underscores are shown at all. I would not have figured that out without the examples in the link you provided.
The correct path to this configuration dialog now appears to be
Settings->Compiler->Other settings. Look for "Advanced options" in lower right, it's easy to miss.
I did a couple of test runs with ecpp files and it really works beautifully in Code::Blocks.
Please report the CB version and OS info and maybe a CB Dev will look into the display issue.
Note: I confirm the lack of Underscores in Windows 7 using CB 13.12.
Edit: I am guessing that advanced_compiler_options.xrc is the cause of the issue.
Tim S.
The description in the dialog should be fixed in SVN HEAD. Thanks for the report.
Quote from: cacb on December 30, 2013, 11:16:04 PM
The correct path to this configuration dialog now appears to be
Settings->Compiler->Other settings. Look for "Advanced options" in lower right, it's easy to miss.
Are you talking about the wiki? If you're then you can fix this yourself. To log in the wiki you can use your forum username/password.
Quote from: oBFusCATed on December 30, 2013, 11:52:52 PM
Are you talking about the wiki? If you're then you can fix this yourself. To log in the wiki you can use your forum username/password.
Thanks, done. First time ever I edited a Wiki ;D
Quote from: stahta01 on December 30, 2013, 11:35:50 PM
Please report the CB version and OS info and maybe a CB Dev will look into the display issue.
Note: I confirm the lack of Underscores in Windows 7 using CB 13.12.
Edit: I am guessing that advanced_compiler_options.xrc is the cause of the issue.
Tim S.
On Linux Kubuntu 13.10 (amd64) I am using Code::Blocks svn 9492 built from Jens Lody's tarball
On Win7 I am using Nightly Build svn 9455