in reply to Any help on Perl h2xs would appreciate
You need to properly quote your paths, as they contain whitespace, for example Program Files. Likely you should just leave the INC entries (etc) alone and let ExtUtils::MakeMaker fill them in for you, but if you insist on manually filling them, maybe the following works:
... INC => ' "-I/C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\incl +ude" "-I/C:\Program Files\Microsoft Visual Studio 8\VC\include"', ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Any help on Perl h2xs would appreciate
by anupama (Novice) on Feb 17, 2009 at 12:25 UTC | |
. I get the following error msg: C:\Perl\bin\Remote-Connection>nmake Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. cp lib/Remote/Connection.pm blib\lib\Remote\Connection.pm C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -typemap C:\Perl\lib\ExtUtils\typemap -typemap typemap Connection.xs > Connection.xsc && C:\Perl\bin\ perl.exe -MExtUtils::Command -e mv Connection.xsc Connection.c cl.exe -c -I. -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_I MPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi - DNDEBUG -O1 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-IC:\Perl\lib\CORE" Connection.c Connection.c C:\Perl\bin\Remote-Connection\afxv_w32.h(178) : error C2371: 'HKEY' : redefinition; different basic types C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(246) : see declaration of 'HKEY' C:\Perl\bin\Remote-Connection\afxv_w32.h(227) : error C2054: expected '(' to follow 'inline' C:\Perl\bin\Remote-Connection\afxv_w32.h(228) : error C2085: 'GetWindowTask' : not in formal parameter list C:\Perl\bin\Remote-Connection\afxv_w32.h(228) : error C2143: syntax error : missing ';' before '{' C:\Perl\bin\Remote-Connection\afxv_w32.h(235) : error C2054: expected '(' to follow 'inline' C:\Perl\bin\Remote-Connection\afxv_w32.h(236) : error C2085: 'GetNextWindow' : not in formal parameter list C:\Perl\bin\Remote-Connection\afxv_w32.h(236) : error C2143: syntax error : missing ';' before '{' C:\Perl\bin\Remote-Connection\afxv_w32.h(242) : error C2054: expected '(' to follow 'inline' C:\Perl\bin\Remote-Connection\afxv_w32.h(248) : error C2085: 'DrawState' : not in formal parameter list C:\Perl\bin\Remote-Connection\afxv_w32.h(248) : error C2143: syntax error : missing ';' before '{' C:\Perl\bin\Remote-Connection\afxv_w32.h(256) : error C2054: expected '(' to follow 'inline' C:\Perl\bin\Remote-Connection\afxv_w32.h(257) : error C2085: 'AfxDrawStatusTextA' : not in formal parameter list C:\Perl\bin\Remote-Connection\afxv_w32.h(258) : error C2061: syntax error : identifier 'inline' C:\Perl\bin\Remote-Connection\afxv_w32.h(260) : error C2054: expected '(' to follow 'inline' C:\Perl\bin\Remote-Connection\afxv_w32.h(265) : error C2085: 'DrawStatusText' :not in formal parameter list C:\Perl\bin\Remote-Connection\afxv_w32.h(265) : error C2143: syntax error : missing ';' before '{' C:\Perl\bin\Remote-Connection\afxv_w32.h(271) : error C2054: expected '(' to follow 'inline' C:\Perl\bin\Remote-Connection\afxv_w32.h(271) : error C2082: redefinition of formal parameter 'FreeResource' C:\Perl\bin\Remote-Connection\afxv_w32.h(271) : error C2143: syntax error : missing ';' before '{' C:\Perl\bin\Remote-Connection\afxv_w32.h(274) : error C2054: expected '(' to follow 'inline' C:\Perl\bin\Remote-Connection\afxv_w32.h(274) : error C2085: 'UnlockResource' :not in formal parameter list C:\Perl\bin\Remote-Connection\afxv_w32.h(274) : error C2143: syntax error : missing ';' before '{' C:\Perl\bin\Remote-Connection\afx.h(193) : error C2061: syntax error : identifier 'CObject' C:\Perl\bin\Remote-Connection\afx.h(193) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(195) : error C2061: syntax error : identifier 'CException' C:\Perl\bin\Remote-Connection\afx.h(195) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(196) : error C2061: syntax error : identifier 'CArchiveException' C:\Perl\bin\Remote-Connection\afx.h(196) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(197) : error C2061: syntax error : identifier 'CFileException' C:\Perl\bin\Remote-Connection\afx.h(197) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(198) : error C2061: syntax error : identifier 'CSimpleException' C:\Perl\bin\Remote-Connection\afx.h(198) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(199) : error C2061: syntax error : identifier 'CMemoryException' C:\Perl\bin\Remote-Connection\afx.h(199) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(200) : error C2061: syntax error : identifier 'CNotSupportedException' C:\Perl\bin\Remote-Connection\afx.h(200) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(201) : error C2061: syntax error : identifier 'CInvalidArgException' C:\Perl\bin\Remote-Connection\afx.h(201) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(203) : error C2061: syntax error : identifier 'CFile' C:\Perl\bin\Remote-Connection\afx.h(203) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(204) : error C2061: syntax error : identifier 'CStdioFile' C:\Perl\bin\Remote-Connection\afx.h(204) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(205) : error C2061: syntax error : identifier 'CMemFile' C:\Perl\bin\Remote-Connection\afx.h(205) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(211) : error C2061: syntax error : identifier 'CArchive' C:\Perl\bin\Remote-Connection\afx.h(211) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(212) : error C2061: syntax error : identifier 'CDumpContext' C:\Perl\bin\Remote-Connection\afx.h(212) : error C2059: syntax error : ';' C:\Perl\bin\Remote-Connection\afx.h(261) : error C2059: syntax error : '}' C:\Perl\bin\Remote-Connection\afx.h(262) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(364) : error C2054: expected '(' to follow 'inline' C:\Perl\bin\Remote-Connection\afx.h(364) : error C2143: syntax error : missing ')' before '...' C:\Perl\bin\Remote-Connection\afx.h(364) : error C2085: 'AfxTrace' : not in formal parameter list C:\Perl\bin\Remote-Connection\afx.h(364) : error C2143: syntax error : missing ';' before '...' C:\Perl\bin\Remote-Connection\afx.h(364) : error C2059: syntax error : ')' C:\Perl\bin\Remote-Connection\afx.h(444) : error C2143: syntax error : missing ')' before '=' C:\Perl\bin\Remote-Connection\afx.h(444) : error C2072: 'AfxInitialize' : initialization of a function C:\Perl\bin\Remote-Connection\afx.h(444) : warning C4142: benign redefinition of type C:\Perl\bin\Remote-Connection\afx.h(444) : error C2370: 'DWORD' : redefinition;different storage class C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(151) : see declaration of 'DWORD' C:\Perl\bin\Remote-Connection\afx.h(444) : error C2146: syntax error : missing ';' before identifier 'dwVersion' C:\Perl\bin\Remote-Connection\afx.h(444) : error C2059: syntax error : ')' C:\Perl\bin\Remote-Connection\afx.h(453) : error C2143: syntax error : missing ')' before '*' C:\Perl\bin\Remote-Connection\afx.h(453) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(453) : error C2059: syntax error : ')' C:\Perl\bin\Remote-Connection\afx.h(455) : error C2061: syntax error : identifier 'AFX_CLASSINIT' C:\Perl\bin\Remote-Connection\afx.h(455) : error C2059: syntax error : '}' C:\Perl\bin\Remote-Connection\afx.h(463) : error C2061: syntax error : identifier 'CObject' C:\Perl\bin\Remote-Connection\afx.h(467) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(471) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(472) : error C2143: syntax error : missing ')' before '*' C:\Perl\bin\Remote-Connection\afx.h(472) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(472) : error C2059: syntax error : ')' C:\Perl\bin\Remote-Connection\afx.h(472) : error C2143: syntax error : missing '{' before 'const' C:\Perl\bin\Remote-Connection\afx.h(472) : warning C4091: ' ' : ignored on leftof 'const int' when no variable is declared C:\Perl\bin\Remote-Connection\afx.h(475) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(476) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(476) : warning C4028: formal parameter 1 different from declaration C:\Perl\bin\Remote-Connection\afx.h(477) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(477) : error C2373: 'CreateObject' : redefinition; different type modifiers C:\Perl\bin\Remote-Connection\afx.h(471) : see declaration of 'CreateObject' C:\Perl\bin\Remote-Connection\afx.h(478) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(478) : error C2373: 'CreateObject' : redefinition; different type modifiers C:\Perl\bin\Remote-Connection\afx.h(471) : see declaration of 'CreateObject' C:\Perl\bin\Remote-Connection\afx.h(481) : error C2143: syntax error : missing ')' before '&' C:\Perl\bin\Remote-Connection\afx.h(481) : error C2143: syntax error : missing '{' before '&' C:\Perl\bin\Remote-Connection\afx.h(481) : error C2059: syntax error : '&' C:\Perl\bin\Remote-Connection\afx.h(481) : error C2059: syntax error : ')' C:\Perl\bin\Remote-Connection\afx.h(482) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(482) : error C2143: syntax error : missing ')' before '&' C:\Perl\bin\Remote-Connection\afx.h(482) : error C2143: syntax error : missing '{' before '&' C:\Perl\bin\Remote-Connection\afx.h(482) : error C2059: syntax error : '&' C:\Perl\bin\Remote-Connection\afx.h(482) : error C2059: syntax error : ')' C:\Perl\bin\Remote-Connection\afx.h(485) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(486) : error C2143: syntax error : missing '{' before '*' C:\Perl\bin\Remote-Connection\afx.h(487) : error C2059: syntax error : '}' C:\Perl\bin\Remote-Connection\afx.h(496) : error C2143: syntax error : missing ')' before '=' C:\Perl\bin\Remote-Connection\afx.h(496) : error C2072: 'AfxThrowArchiveException' : initialization of a function C:\Perl\bin\Remote-Connection\afx.h(496) : error C2059: syntax error : ')' C:\Perl\bin\Remote-Connection\afx.h(497) : error C2143: syntax error : missing ')' before '=' C:\Perl\bin\Remote-Connection\afx.h(497) : error C2072: 'AfxThrowFileException': initialization of a function C:\Perl\bin\Remote-Connection\afx.h(498) : error C2182: 'LPCTSTR' : illegal useof type 'void' C:\Perl\bin\Remote-Connection\afx.h(498) : error C2040: 'LPCTSTR' : 'int' differs in levels of indirection from 'LPCSTR' C:\Perl\bin\Remote-Connection\afx.h(498) : error C2495: 'LPCTSTR' : '__declspec(noreturn)' can only be applied to function declarations or definitions C:\Perl\bin\Remote-Connection\afx.h(498) : error C2146: syntax error : missing ';' before identifier 'lpszFileName' C:\Perl\bin\Remote-Connection\afx.h(498) : error C2059: syntax error : ')' C:\Perl\bin\Remote-Connection\afx.h(504) : error C2054: expected '(' to follow'inline' C:\Perl\bin\Remote-Connection\afx.h(504) : fatal error C1003: error count exceeds 100; stopping compilation NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.exe"' : return code '0x2' Stop. | [reply] |
by syphilis (Archbishop) on Feb 17, 2009 at 12:50 UTC | |
The first error is: It looks to me that, at line 178 of C:\Perl\bin\Remote-Connection\afxv_w32.h, HKEY is being redefined, and your compiler is upset about that. So ... try to fix that first. One thing I've just noticed from your first post in this thread is that you've assigned LD => '$(CC)'. I think that's rather unusual for a Microsoft compiler. Normally I'm used to seeing link assigned to LD. I don't know much about C++, and I don't think this has anything to do with the immediate problem, but it's something to bear in mind if you experience linking errors later on. Cheers, Rob | [reply] [d/l] [select] |
by anupama (Novice) on Feb 18, 2009 at 04:21 UTC | |
when i run the command nmake i get the foolowing error msg: C:\Perl\bin\Remote-Connection\afxv_w32.h(178) : error C2371: 'HKEY' : +redefinition; different basic types C:\Program Files\Microsoft Visual + Studio 8\VC\PlatformSDK\include\windef.h(246) : see declaration of '+HKEY' . But if i dont have any Vcc++ dependent header file in my project folder and try to execute the same follwing error msg pops up C:\Perl\bin\Remote-Connection>nmake cp lib/Remote/Connection.pm blib\lib\Remote\Connection.pm C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -typemap C:\Perl\lib\ExtUtils\typemap -typemap typemap Connection.xs > Connection.xsc && C:\Perl\bin\perl.exe -MExtUtils::Command -e mv Connection.xsc Connection.c cl -TP -c -I. -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE-DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_I MPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-IC:\Perl\lib\CORE" Connection.c Connection.c c:\perl\bin\remote-connection\const-c.inc(52) : warning C4060: switch statement contains no 'case' or 'default' labels C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE\afx.h(24) : fatal error C1189: #error : Building MFC application with /MDd (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MDd NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.EXE"' : return code '0x2' Stop. | [reply] |
by syphilis (Archbishop) on Feb 17, 2009 at 23:47 UTC | |
With the 'cl' compiler, you'll need to let the compiler know that the source files are C++ (assuming they are, in fact written in C++). You can do that by setting CC to cl -TP As an alternative to that, renaming Connection.c to Connection.cpp might also work. Otherwise, cl will regard the source as being C code, and probably report numerous syntax errors. Cheers, Rob | [reply] [d/l] [select] |