[odb-users] compiling odb library

Phillip Shelton phillip.shelton at cardno.com.au
Thu Mar 17 03:48:27 EDT 2022


Hi,

>Yes, that's the problem, your MinGW GCC appears to be mis-configured:

So strictly I should try to contact winlib and ask then how to properly configure MinGW.

And yes, when I do have a c:\mingw\include, the search path /mingw/include does find it.

gcc version 11.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders)
COLLECT_GCC_OPTIONS='-std=c++20' '-v' '-E' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 c:/compilers/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/cc1plus.exe -E -quiet -v -iprefix c:\compilers\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/ -D_REENTRANT - -mtune=generic -march=x86-64 -std=c++20 -dumpbase -
ignoring duplicate directory "c:/compilers/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include/c++/11.2.0"
ignoring duplicate directory "c:/compilers/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include/c++/11.2.0/x86_64-w64-mingw32"
ignoring duplicate directory "c:/compilers/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include/c++/11.2.0/backward"
ignoring duplicate directory "c:/compilers/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/include"
ignoring nonexistent directory "R:/winlibs64_stage/inst_gcc-11.2.0/share/gcc/include"
ignoring nonexistent directory "/R/winlibs64_stage/inst_gcc-11.2.0/share/gcc/include"
ignoring duplicate directory "c:/compilers/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed"
ignoring duplicate directory "c:/compilers/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
 c:\compilers\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include/c++/11.2.0
 c:\compilers\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include/c++/11.2.0/x86_64-w64-mingw32
 c:\compilers\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include/c++/11.2.0/backward
 c:\compilers\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/include
 c:\compilers\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include
 c:\compilers\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed
 c:\compilers\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include
 /mingw/include
End of search list.

So at the moment I can not use this compiler to build anything that requires build2 and therefore odb.

Phillip Shelton
Senior Transport Modeller
Cardno

Phone +61 7 3877 6991  
Address Level 11, 515 St Paul's Terrace, Fortitude Valley, 4006 Queensland Australia
Postal Locked Bag 4006, Fortitude Valley 4006
Email phillip.shelton at cardno.com.au  Web www.cardno.com

Cardno operates a quality management system that has been certified to ISO 9001.

This email and its attachments may contain confidential and/or privileged information for the sole use of the intended recipient(s). All electronically supplied data must be checked against an applicable hardcopy version which shall be the only document for which Cardno warrants accuracy. If you are not the intended recipient, any use, distribution or copying of the information contained in this email and its attachments is strictly prohibited. If you have received this email in error, please email the sender by replying to this message and immediately delete and destroy any copies of this email and any attachments. The views or opinions expressed are the author's own and may not reflect the views or opinions of Cardno.

-----Original Message-----
From: Boris Kolpackov <boris at codesynthesis.com> 
Sent: Thursday, 17 March 2022 5:25 PM
To: Phillip Shelton <phillip.shelton at cardno.com.au>
Cc: odb-users at codesynthesis.com
Subject: Re: [odb-users] compiling odb library

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:/com
> pilers/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-m
> ingw32/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/../l
> ib/;c:/compilers/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../.
> ./../../x86_64-w64-mingw32/lib/;c:/compilers/mingw64/bin/../lib/gcc/x8
> 6_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