[odb-users] compiling odb library

Boris Kolpackov boris at codesynthesis.com
Thu Mar 17 03:25:00 EDT 2022


Phillip Shelton <phillip.shelton at cardno.com.au> writes:

> C:\compilers\hello>g++.exe -std=c++23 -print-search-dirs
> install: c:\compilers\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/
> programs: =c:/compilers/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/;c:/compilers/mingw64/bin/../libexec/gcc/;c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/x86_64-w64-mingw32/11.2.0/;c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/
> libraries: =c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/;c:/compilers/mingw64/bin/../lib/gcc/;c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/11.2.0/;c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../x86_64-w64-mingw32/11.2.0/;c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../lib/;/mingw/lib/x86_64-w64-mingw32/11.2.0/;/mingw/lib/../lib/;c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/;c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../;/mingw/lib/
> 
> But I am not sure that I should be seeing ;/mingw/lib/ in either of them.
> That sounds like it would be trying to find a root directory called mingw
> in whatever drive was current for the build. Which I know I don't have.

Yes, that's the problem, your MinGW GCC appears to be mis-configured:
MinGW runtime (unlike MSYS2) doesn't do anything special for POSIX paths
and so /mingw/lib/ is not translated to something like c:/mingw/lib but
rather used as a Windows path with the peculiar semantics of being
relative to the current drive.

In build2 we treat such paths as invalid and I've now fixed the relevant
code to issue diagnostics rather than fail with an unhandled exception.

While the correct place to fix this is in your MinGW GCC, I was also
thinking if we can somehow work around this in build2. We could ignore
such paths but I am not sure that's a good idea since if you did have,
say, c:\mingw\{include,lib} with some stuff in it, I believe GCC would
have used it. You can test this theory by creating c:\mingw\include and
then see if the output of the second command (-v -E, running from drive
c:) still says that it is ignoring c:\mingw\include.

Another option would be to just complete such paths with the current
drive so that we get consistent behavior with GCC, even if having
paths like this is asking for trouble.



More information about the odb-users mailing list