Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
log filename including compiler, version, linker and debug or release ?
BlueHazzard:
For me this works as expected... ( i had to replace your compiler by my default gcc, because otherwise wired things happened...)
Are you sure you are running the debug target (Near the gear toolbar icon you can use to compile is a drop down menu. There you can select the target you are compiling.)?
you have put the log output in the "release" target and the log copy script in the debug "target". In the build options you select the target on the tree control on the left. If you select the project name it will be executed by all targets...
pabristow:
I've tried this on another machine with similar failure, so I must have something different?
I am 99% confident that I am editing the right build options debug_gcc81 (because behaviour changes by adding post-build option).
Attached is snip of attempt to get permission to copy (that looks right). I actually chose "Allow this script", but I still don't get any .html log file, not the expected one that I get rebuilding with no post build events (but then deleted). But no .html log files generated.
My scripting settings have Copy files ticked on this machine (I have ticked them all on the other).
My hello_world.cbp and main.cpp are at J:\Cpp\hello_world, as was my .html log file.
Global compiler settings also attached.
Thanks for your considerable patience so far, but can you see what I am doing wrong?
BlueHazzard:
Yes! You use the wrong target...
Codeblocks has 4 hierarchies:
1) Workspace (loose collection of projects
2) Projects (collection of targets that have something in common, like compiler options)
3) Virtual targets, a collection of targets, that have to build at the same time (can not have any speciffic settings)
4) Targets: The actual receipts to make your program
Your project is build like this:
--- Code: --- hello_exceptions <- Project
|
|----- Debug_clang900 <-- Target
|----- Release_clang900 <-- Target
--- End code ---
And your pre and post build steps look like this:
--- Code: --- hello_exceptions
|
|----- Debug_clang900
| |-----Post build [[IO.copy log]]
|
|----- Release_clang900
|---- Pre build: [[Log()]]
--- End code ---
Codeblocks starts at the top and goes down the tree, but only one branch. If you build "Debug_clang900" target only this build steps are executed....
So you can do this (Solution 1):
--- Code: --- hello_exceptions
|
|----- Debug_clang900
| |----- Post build [[IO.copy log]]
|
|----- Release_clang900
|---- Post build [[IO.copy log]]
|---- Pre build: [[Log()]]
--- End code ---
or this (Solution 2):
--- Code: --- hello_exceptions
|---- Post build [[IO.copy log]]
|
|----- Debug_clang900
| |----- Pre build: [[Log()]]
|
|----- Release_clang900
--- End code ---
Or you select the right target:
To select a target:
Build->Select Target->Debug_clang900
Build->Rebuild
And you will get the copied log
To fix the post build steps (solution 1)
Project->Build options->Select Debug_clang900 on the left->Pre/Post build steps->Copy your script -> Select Release_clang900 on the left-> Pre/Post build steps-> paste the script
To fix the project (solution 2)
Remove the Script from Project->Build options->Select Debug_clang900 on the left->Pre/Post build steps
Add it to Project->Build options->Select Project name on the left->Pre/Post build steps
[Edit:] I messed up the debug and release things. Now they should be in sync with your project file
pabristow:
Thanks for improving my understanding of projects and build options.
I've tried to sort things out and have tried taking the scripts trust off, so that it asks for copy permission thus.
So is appears to be about to copy (but should the $PROJECTNAME) be already expanded at this point?
Even if I give permission, then I don't get any .html log file(s). I expect two files - is this ocrrect.
Code::blocks log says
Rebuild project:4
Log prebuild clang 900 debug
Log clang pre copy 900 debug
Log clang post copy 900 debug
Build log says
--- Code: ----------------- Clean: Debug_clang900 in hello_exceptions (compiler: LLVM Clang 900 Compiler)---------------
Cleaned "hello_exceptions - Debug_clang900"
Running target pre-build steps
-------------- Build: Debug_clang900 in hello_exceptions (compiler: LLVM Clang 900 Compiler)---------------
clang++.exe -g --verbose -c I:\Cpp\hello_boost\hello_exceptions\hello_exceptions.cpp -o obj\Debug\hello_exceptions.o
clang++.exe -o bin\Debug\hello_exceptions.exe obj\Debug\hello_exceptions.o
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\clang-900\LLVM\bin
"C:\\LLVM\\clang-900\\LLVM\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.24.28207 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello_exceptions.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -gcodeview -debug-info-kind=limited -momit-leaf-frame-pointer -v -coverage-notes-file "I:\\Cpp\\hello_boost\\hello_exceptions\\obj\\Debug\\hello_exceptions.gcno" -resource-dir "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0" -internal-isystem "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\winrt" -fdeprecated-macro -fdebug-compilation-dir "I:\\Cpp\\hello_boost\\hello_exceptions" -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.24.28207 -std=c++14 -fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o "obj\\Debug\\hello_exceptions.o" -x c++ "I:\\Cpp\\hello_boost\\hello_exceptions\\hello_exceptions.cpp"
clang -cc1 version 9.0.0 based upon LLVM 9.0.0 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
C:\LLVM\clang-900\LLVM\lib\clang\9.0.0\include
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28207\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
End of search list.
Output file is bin\Debug\hello_exceptions.exe with size 231.00 KB
Running target post-build steps
Nothing to be done (all items are up-to-date). <<<<<<<<<< is this expected? I haven't changed the source but have rebuilt.
--- End code ---
For Clang I confirm that I have the box ticked for create a log file (and do get a .html log if I remove the copy line from the postbuild options)
I still conclude that I appear not to be getting a log file to copy.
If the copy fails, should there be an error message somewhere?
Since this works once, your basic code is correct, something has changed in my setup?
But perhaps I have wasted enough of your time already? Thanks for your patience.
BlueHazzard:
--- Quote ---Even if I give permission, then I don't get any .html log file(s). I expect two files - is this ocrrect.
--- End quote ---
This is the files i get:
--- Code: ---hello_exceptions.cbp
hello_exceptions.cpp
hello_exceptions.depend
hello_exceptions.layout
hello_exceptions_build_log.html
hello_exceptions_build_log_Debug_clang900_2019-10-31-13.08_gcc.html
hello_exceptions_build_log_Debug_clang900_2019-10-31-13.09_gcc.html
hello_exceptions_build_log_Debug_clang900_2019-10-31-13.09_gcc22.html
hello_exceptions_build_log_Debug_clang900_2019-10-31-15.54_gcc.html
--- End code ---
You still have not answered what version of codeblocks you are using... I use the latest nightly....
--- Quote ---Build log says
Nothing to be done (all items are up-to-date). <<<<<<<<<< is this expected? I haven't changed the source but have rebuilt.
--- End quote ---
Yes... This is a bug in the build system logging...
--- Quote ---For Clang I confirm that I have the box ticked for create a log file (and do get a .html log if I remove the copy line from the postbuild options)
--- End quote ---
Out of curiosity, have you tried with the gcc compiler (do you have gcc installed)
--- Quote ---But perhaps I have wasted enough of your time already? Thanks for your patience.
--- End quote ---
Try with a new project and the default compiler and look...
Have you tried the Settings->Scripting->Trusts and Settings->Scripting->Security->Copy files?
[Edit:]
--- Quote ---If the copy fails, should there be an error message somewhere?
--- End quote ---
I honestly don't know... Probably not, because in macro replacement (the thing you do) the whole scripting output is redirected into void....
--- Quote ---I still conclude that I appear not to be getting a log file to copy.
--- End quote ---
So you do not get a log file, if the post build steps with the script are activated, but if you remove the script you get a log file?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version