Recent Posts

Pages: 1 ... 5 6 7 8 9 [10]
91
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.
92
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!
93
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.  :(
94
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'
95
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.
96
You can go to C::B menu Setting/Compiler and inspect "Global Compiler Settings"/"Toolchain executables" for "Selected compiler"
97
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?
98
Nightly builds / The 25 October 2025 build (13754) is out.
« Last post by killerbot on October 26, 2025, 06:50:03 pm »
We switched to gcc 15.1.0 (on 23 May 2025) --> download the new wx/mingw dll's see link below

Get the compiler we use here : https://github.com/brechtsanders/winlibs_mingw/releases/download/15.1.0posix-12.0.0-ucrt-r1/winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64ucrt-12.0.0-r1.7z

Get quick announcements through the RSS feed http://www.codeblocks.org/nightly/CodeBlock_RSS.xml

Before you use a nightly make sure you understand how it works.

A link to the unicode windows wxWidget dll(s) for Code::Blocks : https://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/Prerequisites/wxmsw32u_gcc_cb_wx328_2D_gcc1510-mingw64.7z
A link to Mingw64 dll's needed by Code::Blocks : http://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/Prerequisites/Mingw64dlls15.1.0.7z


The 26 October 2025 build is out.
  - Windows :
   http://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/2025/CB_20251026_rev13754_win64.7z
  - Linux :
   none

The current SDK version is : 2.25.0

Resolved Fixed:

  • Clangd_client: Apply Christo patch #1559 for makefiles (Thanks christo)
  • BrowseTracker: Apply JumpTracker.h assert fix (Thanks Christo and Letartare)
  • dragscroll: version 1/4/15 251020 Remember the original (current) mouse position for other events to use.

Regressions/Confirmed/Annoying/Common bugs:


    99
    Thanks. Can we dynamically change the outer window size? Well, we still need to find a way to fix such issue, though this is not a big issue.  :)
    100
    General (but related to Code::Blocks) / Re: forums.codeblocks.org Cert has expired
    « Last post by ollydbg on October 26, 2025, 08:25:13 am »
    New cert has an expiry date of:
    - Thu, 22 Jan 2026 15:46:40 GMT

    Thanks, I will report to our site admin about this.
    Pages: 1 ... 5 6 7 8 9 [10]