On Thu, Aug 7, 2014 at 8:42 PM, Richard Shaw <hobbes1...@gmail.com> wrote:
> I'm working on documenting how to build a project natively in windows, which
> first means figuring out the quirks myself and I ran into an issue with g++
> not being able to find headers with unix style paths "/usr/local/include".
>
> My environment:
> Windows 7 32bit
> mingw-w64 from win-builds.org
> MSYS from the MinGW-w64 sourceforge page
>
>
> The project requires wxWidgets which I have building and installing fine
> with no tweaks. In order to determine C/CXX flags, linker requirements, etc,
> wxWigets provides a script wx-config that provides them. My project is cmake
> based (if it matters) and I'm using the built-in FindWxWidgets/UseWxWidgets
> modules for library and inclide directory detection (which uses wx-config on
> *nix systems).
>
> The problem occurs when I try to build my project:
>
> cd /C/Tools/Projects/freedv/src && /C/Tools/msys/opt/windows_32/bin/g++.exe
> -D
> HAVE_CONFIG_H -DSVN_REVISION=\"1786M\" -D_FILE_OFFSET_BITS=64
> -D_NO_AUTOTOOLS_ -
> D__WXMSW__ -Wall -mthreads -g @CMakeFiles/freedv.dir/includes_CXX.rsp   -o
> CMake
> Files/freedv.dir/dlg_about.cpp.obj -c
> /C/Tools/Projects/svn/freetel/fdmdv2/src/d
> lg_about.cpp
> c:/Tools/Projects/svn/freetel/fdmdv2/src/dlg_about.cpp:21:22: fatal error:
> wx/ff
> ile.h: No such file or directory
>  #include <wx/ffile.h>
>                       ^
> compilation terminated.
>
> The contents of includes_CSS.rsp:
> -IC:/Tools/Projects/freedv -Ic:/Tools/msys/local/include -isystem
> /usr/local/lib/wx/include/msw-unicode-static-3.0 -isystem
> /usr/local/include/wx-3.0 -Ic:/Tools/msys/local/include/codec2
> -IC:/Tools/Projects/svn/freetel/fdmdv2/src
>
> As you can see, most of the includes use the windows path, "C:/Tools/..."
> except the two wxWidgets entries use the unix style "/usr/local", however,
> msys doesn't seem to have a problem:
> $ file /usr/local/include/wx-3.0/wx/ffile.h
> /usr/local/include/wx-3.0/wx/ffile.h: ASCII C++ program text, with CRLF line
> terminators
>
> If I change the /usr/local to c;/Tools/msys/local/include/wx-3.0 (and the
> same for the other) then compilation completes without error.
>
> Am I missing something obvious here? Isn't the whole point of msys is so
> that you can use unix style paths?

Yes, you are missing something here, whether it's obvious or not
depends on how long you've spent working with MSYS* and MinGW-w64.

MSYS will convert paths when it gets a chance to and thinks it should,
for example when calling a native Windows program like GCC. At that
time it will look through the command line and environment variables
with knowledge of the mount points and convert things that appear to
be path-y. However, you're using CMake here and it's emitted MSYS
paths into @response files (the .rsp files) and then native GCC has
been told to process those files, so MSYS doesn't get another chance
to transform them. Emitting stuff to a file isn't a good place to
transform paths because it's not known what tool will process those
files and it'd be horribly slow and break in a million different ways
if transformations were applied to all file IO.

My recommendation is to dump MSYS and use MSYS2 as it's way better (if
you do that you can use a huge amount of prebuilt libraries) but
otherwise figure out how to stop whatever version of CMake you are
using from using response files.

>
> Thanks,
> Richard
>
> ------------------------------------------------------------------------------
> Infragistics Professional
> Build stunning WinForms apps today!
> Reboot your WinForms applications with our WinForms controls.
> Build a bridge from your legacy apps to the future.
> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to