Recent Posts

Pages: 1 ... 3 4 5 6 7 [8] 9 10
71
I modified the last command to give perf permissions, so now it is

Code
sudo sysctl -w kernel.perf_event_paranoid=1
72
Is there any way you could tell me what "auto" actually is or give me an example as to how to re-create the situation you're showing here?

You can simply do this:

1, clone the code repo or download the zip file:  asmwarrior/parserlib: A c++ recursive-descent PEG parsing library that supports left recursion..

2, open the cbp project in the root folder: https://github.com/asmwarrior/parserlib/blob/master/test_parser_lib.cbp

3, open the file: cpp_lexer_grammar.h in the C::B editor

4, you can use clangd_client, and use the mouse to hover the "token" variable in the line 172

5, you will see a very big tip window which cover the whole screen, note I only tested on Windows 10 OS.

Thanks.
73
Not the debug tip window, sometimes, the code completion tip(from the clangd_client plugin) window becomes extremely large, see the blow two screen shot, the tip window cover the whole C::B window, also the tip window extended to another screen.  :(

 Is there any way you could tell me what "auto" actually is or give me an example as to how to re-create the situation you're showing here?
74
To profile an executable application with Perf and Hotspot on Linux do the following:

  • Install Perf with the command
Code
sudo apt install linux-perf
  • Install Hotspot with the command
Code
sudo apt install hotspot
  • Open Code::Blocks and go to Tools menu
  • Make click on Add to add a new tool
  • In Name put Perf Profiler
  • Create a .sh script with a name perf-profile.sh in a custom location
  • Add the following code to the script
Code
#!/bin/bash

# Universal perf profiler for Code::Blocks 25.01
# Usage:
#   perf-profile.sh <executable_path> [lib_directory]
# If lib_directory is omitted, uses executable's directory.

PERF_OUTPUT_DIR="$HOME/PERF_DATA"

if [ $# -lt 1 ]; then
    echo "❌ Error: Missing executable path."
    echo "   Usage: $0 <executable> [lib_dir]"
    exit 1
fi

EXE_PATH="$1"
EXE_DIR="$(dirname "$EXE_PATH")"
EXE_NAME="$(basename "$EXE_PATH")"

if [ ! -f "$EXE_PATH" ]; then
    echo "❌ Executable not found: $EXE_PATH"
    exit 1
fi

# Determine lib directory
if [ $# -ge 2 ] && [ -n "$2" ]; then
    LIB_DIR="$2"
    echo "🧩 Using custom lib dir (arg): $LIB_DIR"
else
    LIB_DIR="$EXE_DIR"
    echo "🧩 Using executable's dir as lib dir: $LIB_DIR"
fi

if [ ! -d "$LIB_DIR" ]; then
    echo "⚠️  Warning: Library directory does not exist: $LIB_DIR"
fi

# Prepare output
mkdir -p "$PERF_OUTPUT_DIR"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
PERF_DATA_PATH="$PERF_OUTPUT_DIR/${EXE_NAME}_${TIMESTAMP}.perf.data"

echo "▶️  Profiling: $EXE_PATH"
echo "📂 Working dir: $EXE_DIR"
echo "💾 Perf data → $PERF_DATA_PATH"

cd "$EXE_DIR" || exit 1
export LD_LIBRARY_PATH="$LIB_DIR:$LD_LIBRARY_PATH"

perf record --call-graph dwarf -o "$PERF_DATA_PATH" \
  env LD_LIBRARY_PATH="$LIB_DIR:$LD_LIBRARY_PATH" "$EXE_PATH"

if [ -f "$PERF_DATA_PATH" ]; then
    echo "✅ Profiling done. Opening in Hotspot..."
    hotspot "$PERF_DATA_PATH" &
else
    echo "⚠️  No perf data generated."
fi
  • On the script you can custom the path PERF_OUTPUT_DIR to any location you want to store the perf collected data (this data is large in size so take that in count)
  • Give execution permissions to the script with the command
Code
chmod +x perf-profile.sh
  • In Code::Blocks Tools on Executable browse to the script file
  • In Parameters add the following
Code
$(TARGET_OUTPUT_FILE) /path/to/custom/libraries
  • where the path to custom libraries is the path where the libraries referenced by the application to profile are located
  • We leave Working directory empty
  • Click OK to add the tool
  • Add sudo capabilities to perf with the command
Code
sudo sysctl -w kernel.perf_event_paranoid=1

After doing all this we have the profiler Perf tool working in combination with Hotspot. To profile an application we activate a executable project rebuild all and then we go to Tools and click on the Perf Profiler, execute our application for a while and then close it to see the data analysis on Hotspot.
75
Nightly builds / Re: The 25 October 2025 build (13754) is out.
« Last post by cppuser on October 28, 2025, 02:31:37 pm »
thank you!
76
Not the debug tip window, sometimes, the code completion tip(from the clangd_client plugin) window becomes extremely large, see the blow two screen shot, the tip window cover the whole C::B window, also the tip window extended to another screen.  :(
77
Nightly builds / Re: The 25 October 2025 build (13754) is out.
« Last post by Xaviou on October 27, 2025, 07:16:23 pm »
Hi.

32 bits version for Windows can be downloaded from my website.

Debian Trixie (64 bits) and Bookworm (32 and 64 bits) can be installed from my repo
The corresponding unsigned deb files can also be downloaded from the website page linked above.

Ubuntu-22.04, 24.10, 25.04 and 25.10 versions can be installed from my ppa (they are now available for both amd64 and arm64 architectures).

Regards
Xav'
78
You can go to C::B menu Setting/Compiler and inspect "Global Compiler Settings"/"Toolchain executables" for "Selected compiler"

It is correct C:\Program Files\CodeBlocks\MinGW. This is very strange.
79
You can go to C::B menu Setting/Compiler and inspect "Global Compiler Settings"/"Toolchain executables" for "Selected compiler"
80
Using Code::Blocks / Problem with standalone exe
« Last post by bad_terminal on October 26, 2025, 10:31:14 pm »
Good evening,

So I've been using CodeBlocks for a number of years while attempting to learn C++. However, after a recent re-installation of 20.03, I noticed that while my programs compile in the editor, the exe's they produce are smaller than usual (215kb v 2487kb), and the standalone exe will not run.

If my understaniding is correct, it's because certain compiler flags weren't set.

Now, whilst I appear to have remedied this, what would cause this to happen? Are those flags not set as default with a fresh installation? I installed 20.03 the first time so long I don't remember having to set flags.

For anyone else having the same problem , the flags I had to set were -static -static-libgcc -static-libstdc++   in the compiler flags section

Also, in the global compiler section. there are numerous things to 'set' eg, C++ compiler , linker for dynamic libs, linker for static libs, resource compiler, make program.

I've set all these to x86_64-w64-mingw32-g++.exe, but really have no idea what any of them are meant to be set to, and/or what the effects of using different (but similarly named) compliers would have.

Please advise.
Thankyou.

So several days and no replies? A veritable hive of activity! Surely somebody knows what all those different 'compliers' are and what the difference is?
Pages: 1 ... 3 4 5 6 7 [8] 9 10