Author Topic: [solved]How to debug a program that was build by cmake? (setting paths)  (Read 3168 times)

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 76
Can't setup codeblocks to find the .exe file to debug, it just prints "No executable specified, use `target exec'."

Source files are in src/, exe file is in build/bin/. I've set build type to "Use makefile", even though it doesn't actually build anything (I'd prefer to not build anything with codeblocks for now, too complex).

What does the "Execution directory" mean in Project options->Project section? Is this where it will search for makefile? I have set it to full path to build/.

In Project options->Build targets, I've set "Output filename" to "build\bin\my.exe", and "Execution working dir" to "build\bin".

I'm still using gdb from 32bit mingw, this time for debugging a 64bit mingw-w64 compiled app. I wonder if that's the source of the problem. I'll try to switch for a moment... Yes, that was it. Solved.

By the way, if I'll click "don't annoy me again" on some message, how can I undo it later?
« Last Edit: October 16, 2017, 08:54:22 am by visir »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: [solved]How to debug a program that was build by cmake? (setting paths)
« Reply #1 on: October 16, 2017, 11:52:41 am »
Have you tried to execute:
Code
$ cmake -G "CodeBlocks - Ninja" <path to project root>
or
$ cmake -G "CodeBlock - Unix Makefiles" <path to project root>

Unfortunately C::B is not really setup correctly to run project after they are installed (make install). So we need to work on this.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]