xinguai / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Compilation failed on mingw/cygwin #127

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cd <gtest-1.2-svn>
2. mkdir _build
3. cd _build
4. ../configure CC="/cygdrive/c/MinGW/bin/gcc.exe" 
CXX="/cygdrive/c/MinGW/bin/gcc.exe"  --
prefix="$HOME/install/gtest-1.2-svn"
5. make

What is the expected output? What do you see instead?

make failed with this error:
../src/gtest-filepath.cc:277: error: at this point in file

I would expect make to succeed.

What version of the product are you using? On what operating system?

URL: http://googletest.googlecode.com/svn/branches/release-1.2
Revision: 198

On WinXP SP2 under cygwin using mingw

Please provide any additional information below.

$ /cygdrive/c/MinGW/bin/gcc.exe --version
gcc.exe (GCC) 3.4.5 (mingw special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ /cygdrive/c/MinGW/bin/g++.exe --version
g++.exe (GCC) 3.4.5 (mingw special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I attach a patch solving this issue

Original issue reported on code.google.com by nicolas....@gmail.com on 6 Mar 2009 at 6:37

Attachments:

GoogleCodeExporter commented 9 years ago
This patch works on the trunk.

It fixes the use of mkdir(2) and provide a replacement for mkstemp(3).

Original comment by nicolas....@gmail.com on 6 Mar 2009 at 9:53

Attachments:

GoogleCodeExporter commented 9 years ago
Nicolas, I am not that familiar with MinGW but I understand that it provides 
header
files for accessing the Windows API. Can you try to define GTEST_OS_WINDOWS on 
the
MinGW platform and see if it compiles using Windows API? This may require less
modifications to the source and enable more features that would not be 
available on
MinGW otherwise.

Original comment by vladlosev on 7 Mar 2009 at 8:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
missdeer - I was able to build gtest with your patch under mingw. We'll want to
abstract the compiler used from the API, which will require more work. We'll 
work on
this after getting release 1.3 out.

Note to self:
http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux#Cross-compiling_under_Linu
x_for_MS_Windows
explains how to cross compile with mingw.

Original comment by vladlosev on 14 Mar 2009 at 8:20

GoogleCodeExporter commented 9 years ago
Thanks for the fix. Works a treat.. thought i was going crazy

Original comment by chaus...@gmail.com on 6 May 2009 at 6:25

GoogleCodeExporter commented 9 years ago

Original comment by vladlosev on 6 May 2009 at 5:14

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
chausler - what version of Google Test are you using?

Original comment by vladlosev on 7 Jul 2009 at 4:14