From: Philip O. <Phi...@CF...> - 2015-04-19 22:21:37
|
Help needed. A bit of background I am an experienced Delphi programmer since it was Turbo pascal, so not a novice. I wrote a geodetic library many years ago but lost all my source code (long sad story) anyway, the DLL worked fine for me up until I moved to XE7 so need to re-write it for 64 bit. I'm now using Windows 8 (64 bit) I found the boost lib on the net so most of the work has already been done so why not use it as a base.(re-inventing wheels). When its compiled, I'll put a Delphi wrapper around it So I downloaded MinGW (32 bit) from source forge ... and it didn't work. The 'Stddef.h' file was missing and stopped dead. I saw that there was a development version so downloaded that and found the missing file. I compiled a simple hello world.hpp program and everything looked ok. Started to compile the boost lib but it failed to find any of the include files so kept adding -I directive and specified the all the include directories where I knew the files were located. command line was gcc infile.hpp -v -I -I -I ... outfile whatever I did, It would not find any of the .hpp files I though it was something to do with the long filenames even though they were surrounded by "" so I tried using the 8.3 ~ versions ... same result Thought it might be the \ and / problem so changed all \ to / ... same result (since windows 98 , either is recognised but there are some problems in the cmd prompt. Dir .../aDirectory won't work as the shell thinks you want to change an attribute) Copied the entire source to c:\ and renamed all the subdirs to short names... same result. Though I must have screwed something up in the install so then I saw the 64 bit version (mingw-w64) was available.. A Ha!!! Downloaded the installer from sourceforge and installed to the default directory in program files (I added the exe path to the path variable and removed the Mingw32 one. Tried to compile and bugger me ... same result. As I came across each error such as 'boost/config.hpp: No such file or directory #include <boost/config.hpp>, I copied the file to the directory where the script was running ... same result. However, in the HPP files, as it calls the includes with <dir/dir/filename.hpp> as per <boost/config.hpp> above, I had a brain wave and manually removed the dir/dir to leave just<filename.hpp> Bingo it finds the file, only to fail on the next .hpp file that has <dir/dir/filename.hpp> After threading through this and changing 10 files, I have given up. This can't be right. The compiler must be able to find the files in the include search order irrespective of what it written in the file, shouldn't it? The include list must be correct as it finds the files as long as I remove the redirection in the <> and just leave the filename. What I am doing wrong? A sample compiler output is shown below but all the others are the same. Files exist and include directories are recognised by the compiler. Apart from the duplicate directory entries (which I don't know how to fix) It looks ok to me. It's accepting the include directories and lists them first (so I assume that is the search order). Sorry it's such a long winded question. Spent all day on this. ++++++++++++++++++++++++++++++++++++++++ Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=C:/Program\ Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.2/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../../../src/gcc-4.9.2/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw492/x86_64-492-posix-seh-rt_v4-rev2/mingw64 --with-gxx-include-dir=/mingw64/x86_64-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --with-cloog=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='x86_64-posix-seh-rev2, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw492/x86_64-492-posix-seh-rt_v4-rev2/mingw64/opt/include -I/c/mingw492/prerequisites/x86_64-zlib-static/include -I/c/mingw492/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw492/x86_64-492-posix-seh-rt_v4-rev2/mingw64/opt/include -I/c/mingw492/prerequisites/x86_64-zlib-static/include -I/c/mingw492/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw492/x86_64-492-posix-seh-rt_v4-rev2/mingw64/opt/lib -L/c/mingw492/prerequisites/x86_64-zlib-static/lib -L/c/mingw492/prerequisites/x86_64-w64-mingw32-static/lib ' Thread model: posix gcc version 4.9.2 (x86_64-posix-seh-rev2, Built by MinGW-W64 project) COLLECT_GCC_OPTIONS='-v' '-I' 'C:/Source/Geometry/other/programs/proj4_to_boost' '-I' 'C:/Source/Geometry/boost/algorithm' '-I' 'C:/Source/Geometry/boost/algorithm/string' '-I' 'C:/Source/Geometry/boost/geometry/geometries' '-mtune=core2' '-march=nocona' C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.2/cc1plus.exe -quiet -v -I C:/Source/Geometry/other/programs/proj4_to_boost -I C:/Source/Geometry/boost/algorithm -I C:/Source/Geometry/boost/algorithm/string -I C:/Source/Geometry/boost/geometry/geometries -iprefix C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/ -D_REENTRANT C:/Source/Geometry/other/programs/proj4_to_boost/proj4_to_boost_geometry.cpp -quiet -dumpbase proj4_to_boost_geometry.cpp -mtune=core2 -march=nocona -auxbase proj4_to_boost_geometry -version -o C:\Users\Philip\AppData\Local\Temp\cc3Pc6y5.s GNU C++ (x86_64-posix-seh-rev2, Built by MinGW-W64 project) version 4.9.2 (x86_64-w64-mingw32) compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.2-p9, MPC version 1.0.2 warning: MPFR header version 3.1.2-p9 differs from library version 3.1.2-p10. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring duplicate directory "C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.9.2/include" ignoring nonexistent directory "C:/mingw492/x86_64-492-posix-seh-rt_v4-rev2/mingw64C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../include" ignoring duplicate directory "C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.9.2/include-fixed" ignoring duplicate directory "C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/include" ignoring nonexistent directory "C:/mingw492/x86_64-492-posix-seh-rt_v4-rev2/mingw64/mingw/include" #include "..." search starts here: #include <...> search starts here: C:/Source/Geometry/other/programs/proj4_to_boost C:/Source/Geometry/boost/algorithm C:/Source/Geometry/boost/algorithm/string C:/Source/Geometry/boost/geometry/geometries C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include-fixed C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/include C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/lib/gcc/../../x86_64-w64-mingw32/include/c++ C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/lib/gcc/../../x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32 C:/Program Files/mingw-w64/x86_64-4.9.2-posix-seh-rt_v4-rev2/mingw64/lib/gcc/../../x86_64-w64-mingw32/include/c++/backward End of search list. GNU C++ (x86_64-posix-seh-rev2, Built by MinGW-W64 project) version 4.9.2 (x86_64-w64-mingw32) compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.2-p9, MPC version 1.0.2 warning: MPFR header version 3.1.2-p9 differs from library version 3.1.2-p10. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: d3e8a972806c8fc76c113b5e63f25d20 In file included from C:/Source/Geometry/boost/algorithm/string.hpp:18:0, from C:/Source/Geometry/other/programs/proj4_to_boost/proj4_to_boost_geometry.cpp:18: C:/Source/Geometry/boost/algorithm/string/std_containers_traits.hpp:18:28: fatal error: boost/config.hpp: No such file or directory #include <boost/config.hpp> ++++++++++++++++++++++++++++++++++++++++ -- Best Regards Philip Ostle ALSN SPM Ile de Brehat +47 2367 4917 then 611 (VSAT Cabin) +870 363 523 015 (Inmarsat Cabin) +44 7802 313750 (Mobile when in Range) ============================================= |
From: Keith M. <kei...@us...> - 2015-04-19 23:30:20
|
On 19/04/15 23:21, Philip Ostle wrote: > I wrote a geodetic library many years ago but lost all my source code > (long sad story) anyway, the DLL worked fine for me up until I moved to > XE7 so need to re-write it for 64 bit. So, you likely need a 64-bit compiler. We don't (currently) provide one, but as you've noted, the mingw-w64 project does; they have their own mailing list, and we don't support their products here. > So I downloaded MinGW (32 bit) from source forge Probably not the one you want, given your 64-bit requirement. Notwithstanding... > ... and it didn't work. The 'Stddef.h' file was missing and stopped > dead. This is strange: stddef.h is included within the GCC installation itself, so if you've installed correctly, it should be present. (Do note that it should be referred to as "stddef.h", not "Stddef.h" -- C and C++ are case sensitive -- but Windows case insensitive file system should permit it to be found, even when incorrectly capitalized). > I saw that there was a development version so downloaded that and > found the missing file. Huh? You should *always* use the headers supplied with the compiler you are using; downloading arbitrary alternatives is likely to create all manner of problems. > As I came across each error such as > 'boost/config.hpp: No such file or directory > #include <boost/config.hpp>, I copied the file to the directory where > the script was running ... same result. > > ... > > What I am doing wrong? The correct approach would have been to ensure that the *parent* of the "boost" directory, (where "boost/config.hpp" resides), is specified in a "-I" option at compile time. (The use of angle brackets in the '#include <boost/config.hpp>' requires this, if that directory is not already within the compiler's default header search path; the current directory normally isn't). -- Regards, Keith. |
From: Philip O. <Phi...@CF...> - 2015-04-20 08:26:23
|
Thanks for the prompt reply Apologies if this was the wrong users group but the blurb make no (obvious) mention of 32 or 64 bit (I will quit this list and join theirs) but the problems were fundamental and applied equally to the 32 or 64 bit versions. It was something I was doing wrong and not a problem with the compiler(s) (I realised that quite early but tried to figure it out myself) I can assure you that the the original installation of MiniGW (32) was clean as I have no other c or c++ compilers and it was a first time install. Stddef.h was definitely missing. (Capitalised as its the start of a sentence) You comments have sorted me out. I now understand that the include directory is hierarchical. (makes sense really) Actually, I did try this earlier but the directory path requires a trailing back or fwd slash at the end (I assumed it needed to be blank) Anyway thanks, sorted now and on to the next hurdle. |
From: Keith M. <kei...@us...> - 2015-04-20 11:49:02
|
On 20/04/15 09:26, Philip Ostle wrote: > Stddef.h was definitely missing. (Capitalised as its the start of a > sentence) Still seems strange, as it's definitely present in a standard GCC installation. In my cross-compiler installation it's found at: $SYSROOT/lib/gcc/mingw32/4.8.2/include/stddef.h (which is in the compiler's default header search path); in a native compiler installation, it should be found in a corresponding location, with $SYSROOT representing something like c:/MinGW, and 4.8.2 being replaced by the actual GCC version of the installed compiler. -- Regards, Keith. |
From: Philip O. <Phi...@CF...> - 2015-04-20 14:31:51
|
In the mingw32 (C:\MinGW) installation, it is as you say in the 4.8.2 sub directory but it is not in the C:\MinGW\Include directory from the main branch. I did a full recursive directory search for it before loading the later 'development' version. Maybe what I actually loaded was the 4.8.2 version and not a developer. Whatever I did, the file magically appeared. thanks |
From: Keith M. <kei...@us...> - 2015-04-20 22:31:50
|
On 20/04/15 15:31, Philip Ostle wrote: > In the mingw32 (C:\MinGW) installation, it is as you say in the 4.8.2 > sub directory Which is correct; it is in the C:/MinGW/lib/gcc/mingw32/4.8.2/include directory, where GCC will search, and expect to find it. > but it is not in the C:\MinGW\Include directory from the main branch. No, it isn't; nor does it need to be, because it is provided as part of GCC itself, and GCC knows to look for it in its own include directory. The C:/MinGW/include directory is for platform specific headers, which *we* need to provide *in addition* to those provided by GCC itself, in order to give you a functional compiler implementation. -- Regards, Keith. |
From: Philip O. <Phi...@CF...> - 2015-04-21 20:54:06
|
Just to go back to the beginning. I downloaded this from the link on SourceForge mingw-get-setup.exe (Dated 15/09/2014) it opened up the installer (mingw-get version 0.6.2-beta-20131004-1) and completed the download. I changed the path to include C:\minGW32 and tried the test compile on 'hello world'. This is when it (and I) failed to find the missing stddef.h file. In the installer, I noticed mingw32-gcc 'dev' 4.8.1-4 (assumed it was a development version) and ticked the box (together with the mingw32.gcc 'doc', thinking this might be some useful documentation), let it do it's stuff and ran the test again, exactly as before, but this time it worked and the stddef.h file was found. I did not 'mess around with the headers', I did not find some obscure development exe, manually intervene or change anything. I only used what options the installer gave me. I don't know the reason for this, it was a clean install with no other compiler of any flavour not weird path or environment variables. I write this for information only I think this topic is now closed. On 21/04/2015 00:31, Keith Marshall wrote: > On 20/04/15 15:31, Philip Ostle wrote: >> In the mingw32 (C:\MinGW) installation, it is as you say in the 4.8.2 >> sub directory > Which is correct; it is in the C:/MinGW/lib/gcc/mingw32/4.8.2/include > directory, where GCC will search, and expect to find it. > >> but it is not in the C:\MinGW\Include directory from the main branch. > No, it isn't; nor does it need to be, because it is provided as part of > GCC itself, and GCC knows to look for it in its own include directory. > The C:/MinGW/include directory is for platform specific headers, which > *we* need to provide *in addition* to those provided by GCC itself, in > order to give you a functional compiler implementation. > |
From: Keith M. <kei...@us...> - 2015-04-21 22:55:14
|
On 21/04/15 21:53, Philip Ostle wrote: > I downloaded this from the link on SourceForge > > mingw-get-setup.exe (Dated 15/09/2014) > > it opened up the installer (mingw-get version 0.6.2-beta-20131004-1) > and completed the download. This clarifies the issue, thanks. > I changed the path to include C:\minGW32 and tried the test compile > on 'hello world'. This is when it (and I) failed to find the missing > stddef.h file. > > In the installer, I noticed mingw32-gcc 'dev' 4.8.1-4 (assumed it was a > development version) It isn't; it is an essential part of GCC, *required* to allow *you* to develop applications with GCC; mingw-get's dependency resolution should have automatically selected it for installation, along with the GCC executables. Did you observe any error messages, during the initial installation? If not, and this package was not auto-selected, then this would suggest a bug in the dependency specs for MinGW's GCC, (but then, it's odd that it hasn't been noticed before now). > and ticked the box (together with the mingw32.gcc 'doc', thinking > this might be some useful documentation), Yes, that's right, (provided you have an info reader, as available in MSYS, or from some other source). > let it do it's stuff and ran the test again, exactly as before, > but this time it worked and the stddef.h file was found. Good. Installing the "-dev" package was the necessary corrective step. > I did not 'mess around with the headers', I did not find some obscure > development exe, manually intervene or change anything. I only used > what options the installer gave me. Sorry, I misunderstood your original statement, (in a previous post). I understood you to mean you'd found, and installed, a copy of stddef.h from an unrelated source. > I write this for information only. I think this topic is now closed. I think so, too; it appears to have reached a satisfactory conclusion. -- Regards, Keith. |