gnc_add_swig_guile_command compile errors

John Ralls jralls at
Thu Apr 5 17:23:25 EDT 2018

> On Apr 5, 2018, at 1:31 PM, Rob Gowin <robg at> wrote:
> Hello Devs,
> There have been a couple of folks who have run into errors when building
> 3.0 that complain about gnc_add_swig_guile_command (one report on IRC, one
> on -user).
> This will happen when the build directory is created inside the toplevel
> source (gnucash) directory instead of as a sibling to it. When the build
> directory is inside top-level gnucash, a reference to ../gnucash on a CMake
> command line will pick up gnucash/gnucash/CMakeLists.txt. This in turn
> loads gnucash/gnome/CMakeLists.txt which attempts the
> gnc_add_swig_guile_command.
> The solution is to make sure that the build directory is parallel to the
> toplevel gnucash directory. This is a bit confusing because we have a
> gnucash directory inside gnucash. The arrangement needs to be
> build-cmake
> gnucash
> +---- gnucash
> +---- libgnucash
> +---- ....
> [I'm not subscribed to -user; could someone please reply to DaveC49 with a
> pointer to this message?]


Thanks for the dope-slap. Indeed, I've seen several others make this mistake and even made it myself once or twice.

I'll stipulate that one solution, and probably the recommended solution, is indeed to separate your build directory from your source directory, but if you *insist* on having the build directory inside the source directory, be careful to get the path right. An alternative is to always use the absolute path to the root of the source directory: Then it doesn't matter where you put the build directory. Since we've switched to CMake and gotten rid of intltool the paths in gnucash.pot no longer include the relative path between builddir and srcdir so there's no good reason for builddir to be in the source tree.

John Ralls

More information about the gnucash-devel mailing list