Project

General

Profile

Bug #12545

Ruby 2.3.1 compilation error [Windows]

Added by local.tourist.kiev (Ivan Serdyuk) over 3 years ago. Updated 1 day ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.3.1 (2016-04-26 patchlevel 112) [i386-mswin32_80]
[ruby-core:76285]

Description

Greetings. Having problems with compilation:

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

        CC = cl -nologo
        LD = cl -nologo
        LDSHARED = cl -nologo -LD
        CFLAGS = -MD -Zi -W2 -wd4100 -wd4127 -wd4210 -wd4214 -wd4255 -wd4574  -w
d4668 -wd4710 -wd4711 -wd4820 -wd4996  -we4028 -we4142 -O2sy-  -Zm600
        XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/i386-mswin32_80 -I./include -
I. -I./missing
        CPPFLAGS =  -D_WIN32_WINNT=0x0600
        DLDFLAGS = -incremental:no -debug -opt:ref -opt:icf -dll
        SOLIBS =
compiling win32/win32.c
win32.c
win32/win32.c(3953) : error C2143: syntax error : missing ')' before '*'
win32/win32.c(3953) : error C2081: 'NET_LUID' : name in formal parameter list illegal
win32/win32.c(3953) : error C2143: syntax error : missing '{' before '*'
win32/win32.c(3953) : error C2059: syntax error : ')'
win32/win32.c(3953) : error C2059: syntax error : ';'
win32/win32.c(3954) : error C2143: syntax error : missing ')' before '*'
win32/win32.c(3954) : error C2143: syntax error : missing '{' before '*'
win32/win32.c(3954) : error C2059: syntax error : ','
win32/win32.c(3954) : error C2059: syntax error : ')'
win32/win32.c(3955) : error C2061: syntax error : identifier 'pConvertInterfaceGuidToLuid'
win32/win32.c(3955) : error C2059: syntax error : ';'
win32/win32.c(3955) : error C2513: '/*global*/ ' : no variable declared before '='
win32/win32.c(3956) : error C2061: syntax error : identifier 'pConvertInterfaceLuidToNameA'
win32/win32.c(3956) : error C2059: syntax error : ';'
win32/win32.c(3956) : error C2513: '/*global*/ ' : no variable declared before '='
win32/win32.c(3979) : error C2065: 'pConvertInterfaceGuidToLuid' : undeclared identifier
win32/win32.c(3981) : error C2065: 'cigl_t' : undeclared identifier
win32/win32.c(3981) : error C2146: syntax error : missing ';' before identifier 'get_proc_address'
win32/win32.c(3983) : error C2065: 'pConvertInterfaceLuidToNameA' : undeclared identifier
win32/win32.c(3985) : error C2065: 'cilnA_t' : undeclared identifier
win32/win32.c(3985) : error C2146: syntax error : missing ';' before identifier 'get_proc_address'
win32/win32.c(3992) : error C2065: 'NET_LUID' : undeclared identifier
win32/win32.c(3992) : error C2146: syntax error : missing ';' before identifier 'luid'
win32/win32.c(3992) : error C2065: 'luid' : undeclared identifier
win32/win32.c(4001) : error C2063: 'pConvertInterfaceGuidToLuid' : not a function
win32/win32.c(4002) : error C2063: 'pConvertInterfaceLuidToNameA' : not a function
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86

History

Updated by local.tourist.kiev (Ivan Serdyuk) over 3 years ago

  • Assignee changed from cruby-windows to tenderlovemaking (Aaron Patterson)

Updated by duerst (Martin Dürst) over 3 years ago

  • Assignee changed from tenderlovemaking (Aaron Patterson) to nobu (Nobuyoshi Nakada)

Updated by duerst (Martin Dürst) over 3 years ago

  • Status changed from Open to Feedback

Can this bug be reproduced on trunk?

Updated by local.tourist.kiev (Ivan Serdyuk) over 3 years ago

Martin Dürst wrote:

Can this bug be reproduced on trunk?

Yes. As also as for 2.1.9, 2.2.5

Updated by duerst (Martin Dürst) over 3 years ago

I don't see any problems with cygwin, so this problem may be compiler-specific. Can you try with another compiler? (e.g. another version of a Microsoft Complier?)

Updated by local.tourist.kiev (Ivan Serdyuk) over 3 years ago

Various versions of Microsoft compiler gave same errors. Might suggestion is that it is some sort of typdef related resolution issue.

My proposal is to split this win32.c file into different files, allow one of those to completely cover all definitions, and compiler would compile .a (or .lib ?) file. After that, another file would contain practical code, with pre-compiled header as a MUST. But that would require to modify Makefile generator.

I do not see any configuration against Windows version (WinAPI). API seam to got changed since versions. Besides performance improvements would be affected for Windows 7/8/10, so this raises more questions. My guess is to compare MSDN libraries, and to choose different implementation.

Please vote and switch it to a proper status.

Updated by duerst (Martin Dürst) over 3 years ago

Ivan Serdyuk wrote:

Various versions of Microsoft compiler gave same errors.

Can you say which ones, exactly? Were there Microsoft compilers that didn't give these errors?

Might suggestion is that it is some sort of typdef related resolution issue.

My proposal is to split this win32.c file into different files, allow one of those to completely cover all definitions, and compiler would compile .a (or .lib ?) file. After that, another file would contain practical code, with pre-compiled header as a MUST. But that would require to modify Makefile generator.

A patch, or a series of patches, would be very helpful.

I do not see any configuration against Windows version (WinAPI). API seam to got changed since versions. Besides performance improvements would be affected for Windows 7/8/10, so this raises more questions. My guess is to compare MSDN libraries, and to choose different implementation.

The cygwin and mingw versions seem to work independently of Windows versions, which suggests that it's not a Windows versions problem. But I'm not at all a Windows expert.

Please vote and switch it to a proper status.

For Ruby, there's no voting (except with actual contributions such as patches). I'm keeping it in the 'feedback' state because a patch is also a kind of feedback.

#8

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • File deleted (win32.c)

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Description updated (diff)

According to MSDN, NET_LUID is used since Windows Vista released in 2006.
Visual C++ 8.0 was released in 2005, so it wouldn't know that union.

Maybe the condition for the version is wrong?

diff --git a/win32/win32.c b/win32/win32.c
index 47408e0..cc81985 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3913,7 +3913,7 @@ socketpair(int af, int type, int protocol, int *sv)
     return 0;
 }

-#if !defined(_MSC_VER) || _MSC_VER >= 1400
+#if !defined(_MSC_VER) || _MSC_VER > 1400
 /* License: Ruby's */
 static void
 str2guid(const char *str, GUID *guid)

Updated by local.tourist.kiev (Ivan Serdyuk) over 3 years ago

I just finished compilation attempts for VS 2008, VS 2010. win32.c compiled for all 2.x versions.

Looks like I have chosen a recent compiler (VS 2005) so it should be avoided. Please update requirements for Windows version.

Regards
Ivan

Updated by duerst (Martin Dürst) over 3 years ago

Ivan Serdyuk wrote:

I just finished compilation attempts for VS 2008, VS 2010. win32.c compiled for all 2.x versions.

So compilation works with VS 2008 and VS 2012, but not with VS 2005?

Looks like I have chosen a recent compiler (VS 2005) so it should be avoided. Please update requirements for Windows version.

Which files/web pages should be updated?

#12

Updated by jeremyevans0 (Jeremy Evans) 1 day ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF