PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

problem using Winsock2.h

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
p.j.knowles



Joined: 20 Apr 2006
Posts: 18

PostPosted: Fri Apr 05, 2013 3:52 am    Post subject: problem using Winsock2.h Reply with quote

Hi,

I'm having problems including the file Winsock2.h on 32-bit Windows XP with pgi 13.3 compilers. I'm sure I had this working sometime before (pgi 12.9 I think). The following trivial example:

Code:
#include <Winsock2.h>

int main() {
 return 0;
}


gives the following error:

Code:
PGC-W-0043-Redefinition of symbol, va_list (C:\PROGRA~1\PGI/win32/13.3/include\stdarg.h: 37)
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword gasm (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3765)
PGC-S-0040-Illegal use of symbol, mov (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3766)
PGC-W-0156-Type not specified, 'int' assumed (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3766)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier mov by ',' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3767)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier lock by ';' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3768)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier setc by '!=' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3769)
PGC-S-0039-Use of undeclared variable bts (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3768)
PGC-S-0054-Subscript operator ([]) applied to non-array (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3768)
PGC-S-0036-Syntax error: Recovery attempted by inserting ';' before '}' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3770)
PGC-S-0039-Use of undeclared variable al (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3770)
PGC-W-0118-Function InterlockedBitTestAndSet does not contain a return statement (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3771)
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword gasm (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3780)
PGC-S-0040-Illegal use of symbol, mov (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3781)
PGC-W-0156-Type not specified, 'int' assumed (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3781)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier mov by ',' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3782)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier lock by ';' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3783)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier setc by '!=' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3784)
PGC-S-0039-Use of undeclared variable btr (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3783)
PGC-S-0054-Subscript operator ([]) applied to non-array (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3783)
PGC-S-0036-Syntax error: Recovery attempted by inserting ';' before '}' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3785)
PGC-W-0118-Function InterlockedBitTestAndReset does not contain a return statement (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3786)
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword gasm (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3988)
PGC-S-0040-Illegal use of symbol, xchg (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3989)
PGC-W-0156-Type not specified, 'int' assumed (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3989)
PGC-S-0036-Syntax error: Recovery attempted by inserting ';' before '}' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3990)
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword gasm (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4034)
PGC-S-0040-Illegal use of symbol, mov (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4035)
PGC-W-0156-Type not specified, 'int' assumed (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4035)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier rdpmc by ';' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4036)
PGC-W-0118-Function ReadPMC does not contain a return statement (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4038)
PGC-S-0032-Syntax error: Unexpected input at identifier rdtsc (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4066)
PGC-S-0029-Syntax error: Recovery attempted by deleting from identifier rdtsc on line 4066 through '}' on line 4067 (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h)
PGC-F-0008-Error limit exceeded (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4111)
PGC/x86 Windows 13.3-0: compilation aborted


Any ideas?

Thanks,

Andy
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6213
Location: The Portland Group Inc.

PostPosted: Fri Apr 05, 2013 10:07 am    Post subject: Reply with quote

Thanks Andy. It looks like we're missing an ifdef around some Microsoft only code in the header file. We recently started using Open Tools 11 and is why it works with 12.9 (which used Open Tools 10). I've added TPR#19259 to track this issue.

As a work around you can try adding the define flag "-D_MSC_FULL_VER=140030223". Granted, I'm not sure if it will cause other issues, but at least it will allow this one file to compile.
Code:

PGI$ pgcc -c wins.c  -V13.4 -w -m32 -D_MSC_FULL_VER=140030223
PGC/x86 Windows 13.4-0: compilation completed with warnings


Best Regards,
Mat
Back to top
View user's profile
p.j.knowles



Joined: 20 Apr 2006
Posts: 18

PostPosted: Sat Apr 06, 2013 9:38 am    Post subject: Reply with quote

Mat,

Strangely this doesn't fix everything like it does for you, although it does reduce the amount of reported problems:

Code:
pgcc -c test.c -w -m32 -D_MSC_FULL_VER=140030223
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword gasm (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3988)
PGC-S-0040-Illegal use of symbol, xchg (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3989)
PGC-S-0036-Syntax error: Recovery attempted by inserting ';' before '}' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 3990)
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword gasm (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4034)
PGC-S-0040-Illegal use of symbol, mov (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4035)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier rdpmc by ';' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4036)
PGC-S-0032-Syntax error: Unexpected input at identifier rdtsc (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4066)
PGC-S-0029-Syntax error: Recovery attempted by deleting from identifier rdtsc on line 4066 through '}' on line 4067 (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h)
PGC-S-0035-Syntax error: Recovery attempted by replacing '{' by ';' (C:\PROGRA~1\PGI/win32/13.3/include\WinNT10.h: 4095)
PGC/x86 Windows 13.3-0: compilation completed with severe errors


This isn't a major problem right now, since I've plenty of other things to fix for our Windows port and I can just comment the code which needs Winsock2.h at the moment.

Thanks,

Andy
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 445

PostPosted: Tue May 21, 2013 3:28 pm    Post subject: TPR 19259 is corrected in release 13.5 Reply with quote

Andy,

TPR 19259 32-bit Windows C/C++
Compilation errors occur with winnt11.h on 32-bit Windows Corrected the syntax of the __asm statements in winnt11.h

has been fixed in 13.5. Thanks for reporting.

dave
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group