[odb-users] Question regarding ODB on windows without gcc compiler

DEMBROGE Michael michael.dembroge at leica-geosystems.com
Fri Oct 4 18:43:09 EDT 2024


Hello Boris,

I'm unable to produce a version of the ODB compiler on a Windows system with no dependency on the g++ compiler. The issue is that the odb compiler must be built with a gcc compiler (see error message below in red). But, building the odb compiler using gcc as the compiler (i.e. "config.cxx=g++") creates a dependency on g++.exe which is not available on Windows.

Here is an overview of my steps:

  1.  install build2 using the build2-install-msvc-0.17.0.bat file.
  2.  Build odb compiler using the following commands:
     *   bpkg create -d odb-msvc cc config.cxx=cl config.cc.coptions=-O2 config.install.root=d:\odb
     *   cd odb-msvc
     *   odb-msvc> bpkg build odb at https://pkg.cpget.org/1/beta<mailto:odb at https://pkg.cpget.org/1/beta>
     *   bpkg install odb


I get the following error due to passing visual studio's "cl" as the compiler:
db-2.5.0-b.27\build\root.build:51:5: error: ODB compiler can only be built with GCC

So, I then reinstalled build2 using the build2-install-mingw-0.17.0.bat  followed by these steps:

  1.  Build odb compiler using the following command:
  2.  D:\odb-build>bpkg create -d odb-mingw cc config.cxx=g++ config.cc.coptions=-O2 config.install.root=c:\odb
  3.  D:\odb-build>cd odb-mingw
  4.  D:\odb-build>bpkg build odb at https://pkg.cppget.org/1/beta<mailto:odb at https://pkg.cppget.org/1/beta>
  5.  D:\odb-build>bpkg install odb


Then, as a test, I tried to run the odb compiler manually from it's local bin folder and I get the following error message:
C:\odb\bin>odb.exe --std c++17 --database sqlite
g++: error: file not found

I realize that installing build2 via the mingw-based .bat file will generate g++.exe in the build2/bin folder, but we are not supposed to be dependent on build/bin. Odb.exe should run in the target /bin folder as a standalone. This is consistent with the error message we get when we try to build our project in Visual Studio. It's complaining the g++.exe cannot be found.

Any ideas?

Thank you in advance,

Mike Dembroge
Leica Geosystems


More information about the odb-users mailing list