jimpark / unsis

Automatically exported from code.google.com/p/unsis
Other
59 stars 15 forks source link

Cannot build, errors compiling tokens.cpp #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run mkru.bat
2. Wait
3. See error messages

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

I'm trying to build unicode nsis 2.46.5 from source. I installed all that was 
required (python 2.7.6, scons 2.3.0, wxWidgets 2.8.12) and I am using Microsoft 
Visual Studio 2008 as a compiler under Windows Server 2003. I was doing all 
that said on "how to build" page (http://www.scratchpaper.com/build) starting 
from wxWidgets (it compiled fine with no errors). Then I ran this command:

C:\Python27\Scripts\scons UNICODE=yes NSIS_MAX_STRLEN=65536 NSIS_CONFIG_LOG=yes 
SKIPPLUGINS=all dist

At first everything was going fine but after a while I got loads of errors and 
build failed. These are the errors I am getting:

cl /Fobuild\urelease\makensis\tokens.obj /c Source\tokens.cpp /TP /nologo /GS- 
/O2 /EHsc /W3 /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS 
/D_CRT_SECURE_NO_DEPRECATE /D_CRT_NON_CONFORMING_SWPRINTFS /DNSISCALL=__stdcall 
/D_UNICODE /DUNICODE /D_WIN32_IE=0x0500 /Ibuild\urelease\config tokens.cpp
Source\tokens.cpp(332) : error C2039: 'unordered_map' : is not a member of 'std'
Source\tokens.cpp(332) : error C2143: syntax error : missing ';' before '<'
Source\tokens.cpp(332) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(335) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(335) : error C2143: syntax error : missing ';' before '&'
Source\tokens.cpp(336) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(337) : error C2146: syntax error : missing ';' before 
identifier 'tokenMap'
Source\tokens.cpp(337) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(337) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(342) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(345) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(348) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(348) : error C2143: syntax error : missing ';' before '&'
Source\tokens.cpp(348) : error C2086: 'const int TokenMap' : redefinition
        Source\tokens.cpp(335) : see declaration of 'TokenMap'
Source\tokens.cpp(349) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(350) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(350) : error C2143: syntax error : missing ';' before '&'
Source\tokens.cpp(350) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(351) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(365) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(365) : error C2143: syntax error : missing ';' before '&'
Source\tokens.cpp(365) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(366) : error C2825: 'TokenMap': must be a class or namespace 
when followed by '::'
Source\tokens.cpp(366) : error C2039: 'const_iterator' : is not a member of 
'`global namespace''
Source\tokens.cpp(366) : error C2146: syntax error : missing ';' before 
identifier 'const_iterator'
Source\tokens.cpp(366) : error C2065: 'const_iterator' : undeclared identifier
Source\tokens.cpp(366) : error C2146: syntax error : missing ';' before 
identifier 'iter'
Source\tokens.cpp(366) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(366) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(366) : error C2228: left of '.find' must have 
class/struct/union
        type is ''unknown-type''
Source\tokens.cpp(368) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(368) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(368) : error C2228: left of '.end' must have 
class/struct/union
        type is ''unknown-type''
Source\tokens.cpp(370) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(370) : error C2227: left of '->second' must point to 
class/struct/union/generic type
        type is ''unknown-type''
Source\tokens.cpp(370) : error C2227: left of '->name' must point to 
class/struct/union/generic type
Source\tokens.cpp(370) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(370) : error C2227: left of '->second' must point to 
class/struct/union/generic type
        type is ''unknown-type''
Source\tokens.cpp(370) : error C2227: left of '->usage_str' must point to 
class/struct/union/generic type
Source\tokens.cpp(381) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(381) : error C2143: syntax error : missing ';' before '&'
Source\tokens.cpp(381) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(382) : error C2825: 'TokenMap': must be a class or namespace 
when followed by '::'
Source\tokens.cpp(382) : error C2039: 'const_iterator' : is not a member of 
'`global namespace''
Source\tokens.cpp(382) : error C2146: syntax error : missing ';' before 
identifier 'const_iterator'
Source\tokens.cpp(382) : error C2065: 'const_iterator' : undeclared identifier
Source\tokens.cpp(382) : error C2146: syntax error : missing ';' before 
identifier 'iter'
Source\tokens.cpp(382) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(382) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(382) : error C2228: left of '.find' must have 
class/struct/union
        type is ''unknown-type''
Source\tokens.cpp(384) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(384) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(384) : error C2228: left of '.end' must have 
class/struct/union
        type is ''unknown-type''
Source\tokens.cpp(391) : error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int
Source\tokens.cpp(391) : error C2143: syntax error : missing ';' before '&'
Source\tokens.cpp(391) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(392) : error C2825: 'TokenMap': must be a class or namespace 
when followed by '::'
Source\tokens.cpp(392) : error C2039: 'const_iterator' : is not a member of 
'`global namespace''
Source\tokens.cpp(392) : error C2146: syntax error : missing ';' before 
identifier 'const_iterator'
Source\tokens.cpp(392) : error C2065: 'const_iterator' : undeclared identifier
Source\tokens.cpp(392) : error C2146: syntax error : missing ';' before 
identifier 'iter'
Source\tokens.cpp(392) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(392) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(392) : error C2228: left of '.find' must have 
class/struct/union
        type is ''unknown-type''
Source\tokens.cpp(394) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(394) : error C2065: 'tokenMap' : undeclared identifier
Source\tokens.cpp(394) : error C2228: left of '.end' must have 
class/struct/union
        type is ''unknown-type''
Source\tokens.cpp(396) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(396) : error C2227: left of '->second' must point to 
class/struct/union/generic type
        type is ''unknown-type''
Source\tokens.cpp(396) : error C2227: left of '->num_parms' must point to 
class/struct/union/generic type
Source\tokens.cpp(397) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(397) : error C2227: left of '->second' must point to 
class/struct/union/generic type
        type is ''unknown-type''
Source\tokens.cpp(397) : error C2227: left of '->opt_parms' must point to 
class/struct/union/generic type
Source\tokens.cpp(398) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(398) : error C2227: left of '->second' must point to 
class/struct/union/generic type
        type is ''unknown-type''
Source\tokens.cpp(398) : error C2227: left of '->index' must point to 
class/struct/union/generic type
Source\tokens.cpp(399) : error C2065: 'iter' : undeclared identifier
Source\tokens.cpp(399) : error C2227: left of '->second' must point to 
class/struct/union/generic type
        type is ''unknown-type''
Source\tokens.cpp(399) : error C2227: left of '->id' must point to 
class/struct/union/generic type
scons: *** [build\urelease\makensis\tokens.obj] Error 2
scons: building terminated because of errors.

Original issue reported on code.google.com by burning....@gmail.com on 27 Nov 2013 at 10:32

GoogleCodeExporter commented 9 years ago
I actually fixed this by making this change:

/*
#if defined(MSC_PLATFORM) && _MSC_VER < 1600
*/
typedef std::tr1::unordered_map<const TCHAR*, tokenType*, TokenHash, TokenPred> 
TokenMap;
/*
#else
typedef std::unordered_map<const TCHAR*, tokenType*, TokenHash, TokenPred> 
TokenMap;
#endif
*/

So I just commented #if-else-endif thing that wasn't working properly for some 
reason.

Original comment by burning....@gmail.com on 27 Nov 2013 at 10:50

jimpark commented 8 years ago

Try using a newer version of Visual Studio.