I'm trying to build this small program in Visual C++ 2008 Express Edition:
#include "stdafx.h"
#include <iostream>
#include <vector>
int main(){
std::vector<bool> listOfFeatures(4,false);
for(std::vector<bool>::iterator i = features.begin(); i != features.end(); i++){
std::int maxValue = criterionFunction(*listOfFeatures);
}
}
std::int criterionFunction(std::int *features){
return -2*features[1]*features[2]+3*features[1]+5*features[2]-2*features[1]*features[2]*
features[3]+7*features[3]+4*features[4]-2*features[1]*features[2]*features[3]*
features[4];
}
But, get the following output:
1>------ Build started: Project: SFS, Configuration: Debug Win32 ------
1>Compiling...
1>SFS.cpp
1>.\SFS.cpp(7) : error C2065: 'features' : undeclared identifier
1>.\SFS.cpp(7) : error C2228: left of '.begin' must have class/struct/union
1> type is ''unknown-type''
1>.\SFS.cpp(7) : error C2065: 'features' : undeclared identifier
1>.\SFS.cpp(7) : error C2228: left of '.end' must have class/struct/union
1> type is ''unknown-type''
1>.\SFS.cpp(8) : error C2589: 'int' : illegal token on right side of '::'
1>.\SFS.cpp(8) : error C2143: syntax error : missing ';' before '::'
1>.\SFS.cpp(11) : error C2589: 'int' : illegal token on right side of '::'
1>.\SFS.cpp(11) : error C2059: syntax error : '::'
1>.\SFS.cpp(11) : error C2589: 'int' : illegal token on right side of '::'
1>.\SFS.cpp(11) : error C2143: syntax error : missing ';' before '{'
1>.\SFS.cpp(11) : error C2447: '{' : missing function header (old-style formal list?)
1>Build log was saved at "file://c:\Users\Ola\Documents\Visual Studio 2008\Projects\SFS\SFS\Debug\BuildLog.htm"
1>SFS - 11 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Why is that?
Shouldn't
features.begin()
be
listOfFeatures.begin()
and
int criterionFunction(int *features)
be declared before main? Note there's no std::int.
features is not declared or defined anywhere.
Related
Following is the code to retrieve MAC addresses from my AirPcap Adapter. But I am facing issues when executing the program: Please help me in resolving this error.
#include <stdio.h>
#include <conio.h>
#include "packet32.h"
#include <ntddndis.h>
#include "StdAfx.h"
#define Max_Num_Adapter 10
char AdapterList[Max_Num_Adapter][1024];
int main()
{
LPADAPTER lpAdapter = 0;
int i;
DWORD dwErrorCode;
WCHAR AdapterName[8192];
WCHAR *temp,*temp1;
int AdapterNum=0,Open;
ULONG AdapterLength;
PPACKET_OID_DATA OidData;
BOOLEAN Status;
//
// Obtain the name of the adapters installed on this machine
//
printf("Packet.dll test application. Library version:%s\n", PacketGetVersion());
printf("Adapters installed:\n");
i=0;
AdapterLength = sizeof(AdapterName);
if(PacketGetAdapterNames(AdapterName,&AdapterLength)==FALSE){
printf("Unable to retrieve the list of the adapters!\n");
return -1;
}
temp=AdapterName;
temp1=AdapterName;
while ((*temp!='\0')||(*(temp-1)!='\0'))
{
if (*temp=='\0')
{
memcpy(AdapterList[i],temp1,temp-temp1);
temp1=temp+1;
i++;
}
temp++;
}
AdapterNum=i;
for (i=0;i<AdapterNum;i++)
printf("\n%d- %s\n",i+1,AdapterList[i]);
printf("\n");
do
{
printf("Select the number of the adapter to open : ");
scanf_s("%d",&Open);
if (Open>AdapterNum) printf("\nThe number must be smaller than %d",AdapterNum);
} while (Open>AdapterNum);
//
// Open the selected adapter
//
lpAdapter = PacketOpenAdapter(AdapterList[Open-1]);
if (!lpAdapter || (lpAdapter->hFile == INVALID_HANDLE_VALUE))
{
dwErrorCode=GetLastError();
printf("Unable to open the adapter, Error Code : %lx\n",dwErrorCode);
return -1;
}
//
// Allocate a buffer to get the MAC adress
//
OidData = (PPACKET_OID_DATA)malloc(6 + sizeof(PACKET_OID_DATA));
if (OidData == NULL)
{
printf("error allocating memory!\n");
PacketCloseAdapter(lpAdapter);
return -1;
}
//
// Retrieve the adapter MAC querying the NIC driver
//
OidData->Oid = OID_802_3_CURRENT_ADDRESS;
OidData->Length = 6;
ZeroMemory(OidData->Data, 6);
Status = PacketRequest(lpAdapter, FALSE, OidData);
if(Status)
{
printf("The MAC address of the adapter is %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
(OidData->Data)[0],
(OidData->Data)[1],
(OidData->Data)[2],
(OidData->Data)[3],
(OidData->Data)[4],
(OidData->Data)[5]);
}
else
{
printf("error retrieving the MAC address of the adapter!\n");
}
free(OidData);
PacketCloseAdapter(lpAdapter);
return (0);
}
Following are the errors:
1>------ Build started: Project: qqq, Configuration: Release Win32 ------
1>Build started 5/29/2015 3:10:00 PM.
1>InitializeBuildStatus:
1> Touching "Release\qqq.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1> ppp.cpp
1>ppp.cpp(35): warning C4627: '#include <conio.h>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>ppp.cpp(36): warning C4627: '#include "packet32.h"': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>ppp.cpp(37): warning C4627: '#include <ntddndis.h>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>ppp.cpp(44): error C2065: 'LPADAPTER' : undeclared identifier
1>ppp.cpp(44): error C2146: syntax error : missing ';' before identifier 'lpAdapter'
1>ppp.cpp(44): error C2065: 'lpAdapter' : undeclared identifier
1>ppp.cpp(46): error C2065: 'DWORD' : undeclared identifier
1>ppp.cpp(46): error C2146: syntax error : missing ';' before identifier 'dwErrorCode'
1>ppp.cpp(46): error C2065: 'dwErrorCode' : undeclared identifier
1>ppp.cpp(47): error C2065: 'WCHAR' : undeclared identifier
1>ppp.cpp(47): error C2146: syntax error : missing ';' before identifier 'AdapterName'
1>ppp.cpp(47): error C2065: 'AdapterName' : undeclared identifier
1>ppp.cpp(48): error C2065: 'WCHAR' : undeclared identifier
1>ppp.cpp(48): error C2065: 'temp' : undeclared identifier
1>ppp.cpp(48): error C2065: 'temp1' : undeclared identifier
1>ppp.cpp(50): error C2065: 'ULONG' : undeclared identifier
1>ppp.cpp(50): error C2146: syntax error : missing ';' before identifier 'AdapterLength'
1>ppp.cpp(50): error C2065: 'AdapterLength' : undeclared identifier
1>ppp.cpp(51): error C2065: 'PPACKET_OID_DATA' : undeclared identifier
1>ppp.cpp(51): error C2146: syntax error : missing ';' before identifier 'OidData'
1>ppp.cpp(51): error C2065: 'OidData' : undeclared identifier
1>ppp.cpp(52): error C2065: 'BOOLEAN' : undeclared identifier
1>ppp.cpp(52): error C2146: syntax error : missing ';' before identifier 'Status'
1>ppp.cpp(52): error C2065: 'Status' : undeclared identifier
1>ppp.cpp(58): error C3861: 'PacketGetVersion': identifier not found
1>ppp.cpp(63): error C2065: 'AdapterLength' : undeclared identifier
1>ppp.cpp(63): error C2065: 'AdapterName' : undeclared identifier
1>ppp.cpp(63): error C2070: ''unknown-type'': illegal sizeof operand
1>ppp.cpp(65): error C2065: 'AdapterName' : undeclared identifier
1>ppp.cpp(65): error C2065: 'AdapterLength' : undeclared identifier
1>ppp.cpp(65): error C2065: 'FALSE' : undeclared identifier
1>ppp.cpp(65): error C3861: 'PacketGetAdapterNames': identifier not found
1>ppp.cpp(69): error C2065: 'temp' : undeclared identifier
1>ppp.cpp(69): error C2065: 'AdapterName' : undeclared identifier
1>ppp.cpp(70): error C2065: 'temp1' : undeclared identifier
1>ppp.cpp(70): error C2065: 'AdapterName' : undeclared identifier
1>ppp.cpp(72): error C2065: 'temp' : undeclared identifier
1>ppp.cpp(72): error C2065: 'temp' : undeclared identifier
1>ppp.cpp(72): fatal error C1903: unable to recover from previous error(s); stopping compilation
1> qqq.cpp
1>qqq.cpp(36): warning C4627: '#include <conio.h>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>qqq.cpp(155): error C3861: '_kbhit': identifier not found
1>qqq.cpp(197): error C2440: '=' : cannot convert from 'PVOID' to 'char *'
1> Conversion from 'void*' to pointer to non-'void' requires an explicit cast
1>qqq.cpp(202): error C3861: '_kbhit': identifier not found
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.33
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I am facing undeclared Identifier issue. Please guide me on resolving this issue.
stdafx.h needs to be included first before all other headers. This is a requirement of the VC++ compiler. If stdafx.h is included after other header files those header files will be skipped by the compiler. When this happens it is unable to resolve the symbols declared in those headers.
Hi I have problems with compiling this code. I got an error and I don't know how to fix it. I searched on Google but I found nothing.
player.h : http://wklej.org/id/1639093/
player.cpp http://wklej.org/id/1639094/
1>------ Build started: Project: tibiafun, Configuration: Release Win32 ------
1> player.cpp
1> Unknown compiler version - please run the configure tests and report the results
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\definitions.h(25): warning C4005: 'EWOULDBLOCK' : macro redefinition
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\errno.h(132) : see previous definition of 'EWOULDBLOCK'
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\fileloader.h(269): warning C4018: '<' : signed/unsigned mismatch
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\creature.h(294): warning C4101: 'vipstatus' : unreferenced local variable
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\player.h(545): error C2146: syntax error : missing ';' before identifier 'editedHouseRights'
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\player.h(545): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\player.h(547): error C2061: syntax error : identifier 'rights_t'
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\player.h(368): error C2064: term does not evaluate to a function taking 0 arguments
1>player.cpp(125): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(125): error C2065: 'HOUSE_NONE' : undeclared identifier
1>player.cpp(278): error C2109: subscript requires array or pointer type
1>player.cpp(299): error C2109: subscript requires array or pointer type
1>player.cpp(303): error C2181: illegal else without matching if
1>player.cpp(309): error C2059: syntax error : 'switch'
1>player.cpp(310): error C2143: syntax error : missing ';' before '{'
1>player.cpp(310): error C2447: '{' : missing function header (old-style formal list?)
1>player.cpp(325): error C2059: syntax error : 'if'
1>player.cpp(326): error C2143: syntax error : missing ';' before '{'
1>player.cpp(326): error C2447: '{' : missing function header (old-style formal list?)
1>player.cpp(354): error C2143: syntax error : missing ';' before '<<'
1>player.cpp(354): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>player.cpp(354): error C2059: syntax error : 'string'
1>player.cpp(354): error C2059: syntax error : ')'
1>player.cpp(354): error C2365: 'exit' : redefinition; previous definition was 'function'
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h(376) : see declaration of 'exit'
1>player.cpp(357): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>player.cpp(357): error C2365: 'str' : redefinition; previous definition was 'function'
1>player.cpp(357): error C2228: left of '.str' must have class/struct/union
1> type is 'int'
1>player.cpp(358): error C2059: syntax error : 'return'
1>player.cpp(359): error C2059: syntax error : '}'
1>player.cpp(359): error C2143: syntax error : missing ';' before '}'
1>player.cpp(362): error C2143: syntax error : missing ';' before '{'
1>player.cpp(362): error C2447: '{' : missing function header (old-style formal list?)
1>player.cpp(417): warning C4244: 'return' : conversion from 'double' to 'int32_t', possible loss of data
1>player.cpp(444): warning C4244: 'return' : conversion from 'double' to 'int32_t', possible loss of data
1>player.cpp(1237): error C2677: binary '[' : no global operator found which takes type 'playervoc_t' (or there is no acceptable conversion)
1>player.cpp(1237): error C2109: subscript requires array or pointer type
1>player.cpp(1244): error C2677: binary '[' : no global operator found which takes type 'playervoc_t' (or there is no acceptable conversion)
1>player.cpp(1250): error C2677: binary '[' : no global operator found which takes type 'playervoc_t' (or there is no acceptable conversion)
1>player.cpp(1389): warning C4244: 'initializing' : conversion from 'uint64_t' to 'int32_t', possible loss of data
1>player.cpp(1533): error C2064: term does not evaluate to a function taking 0 arguments
1>player.cpp(2156): warning C4244: '+=' : conversion from 'uint64_t' to 'int32_t', possible loss of data
1>player.cpp(2161): warning C4244: '-=' : conversion from 'uint64_t' to 'int32_t', possible loss of data
1>player.cpp(2180): error C2109: subscript requires array or pointer type
1>player.cpp(2181): error C2109: subscript requires array or pointer type
1>player.cpp(2182): error C2109: subscript requires array or pointer type
1>player.cpp(2183): error C2109: subscript requires array or pointer type
1>player.cpp(2184): error C2109: subscript requires array or pointer type
1>player.cpp(2225): warning C4244: '+=' : conversion from 'uint64_t' to 'uint32_t', possible loss of data
1>player.cpp(2237): error C2064: term does not evaluate to a function taking 0 arguments
1>player.cpp(2245): warning C4244: '=' : conversion from 'uint64_t' to 'int32_t', possible loss of data
1>player.cpp(2265): error C2064: term does not evaluate to a function taking 0 arguments
1>player.cpp(2335): error C2109: subscript requires array or pointer type
1>player.cpp(2340): error C2109: subscript requires array or pointer type
1>player.cpp(2345): error C2109: subscript requires array or pointer type
1>player.cpp(2878): error C2061: syntax error : identifier 'rights_t'
1>player.cpp(2885): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2885): error C2065: 'rights' : undeclared identifier
1>player.cpp(2888): error C2065: 'rights' : undeclared identifier
1>player.cpp(2888): error C2065: 'HOUSE_OWNER' : undeclared identifier
1>player.cpp(2889): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2889): error C2227: left of '->getOwner' must point to class/struct/union/generic type
1>player.cpp(2894): error C2065: 'rights' : undeclared identifier
1>player.cpp(2894): error C2065: 'HOUSE_SUBOWNER' : undeclared identifier
1>player.cpp(2895): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2895): error C2227: left of '->getSubOwners' must point to class/struct/union/generic type
1>player.cpp(2896): error C2065: 'rights' : undeclared identifier
1>player.cpp(2896): error C2065: 'HOUSE_DOOROWNER' : undeclared identifier
1>player.cpp(2897): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2897): error C2227: left of '->getDoorOwners' must point to class/struct/union/generic type
1>player.cpp(2898): error C2065: 'rights' : undeclared identifier
1>player.cpp(2898): error C2065: 'HOUSE_GUEST' : undeclared identifier
1>player.cpp(2899): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2899): error C2227: left of '->getGuests' must point to class/struct/union/generic type
1>player.cpp(2913): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2913): error C2065: 'HOUSE_GUEST' : undeclared identifier
1>player.cpp(2915): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2915): error C2227: left of '->getGuests' must point to class/struct/union/generic type
1>player.cpp(2916): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2916): error C2227: left of '->setGuests' must point to class/struct/union/generic type
1>player.cpp(2925): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2925): error C2065: 'HOUSE_DOOROWNER' : undeclared identifier
1>player.cpp(2927): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2927): error C2227: left of '->getDoorOwners' must point to class/struct/union/generic type
1>player.cpp(2928): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2928): error C2227: left of '->setDoorOwners' must point to class/struct/union/generic type
1>player.cpp(2930): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2930): error C2065: 'HOUSE_SUBOWNER' : undeclared identifier
1>player.cpp(2932): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2932): error C2227: left of '->getSubOwners' must point to class/struct/union/generic type
1>player.cpp(2933): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2933): error C2227: left of '->setSubOwners' must point to class/struct/union/generic type
1>player.cpp(2935): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2935): error C2065: 'HOUSE_OWNER' : undeclared identifier
1>player.cpp(2937): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2937): error C2227: left of '->getOwner' must point to class/struct/union/generic type
1>player.cpp(2938): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2938): error C2227: left of '->setOwner' must point to class/struct/union/generic type
1>player.cpp(2955): error C2039: 'getHouse' : is not a member of 'Tile'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(19) : see declaration of 'Tile'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(19) : see declaration of 'Tile'
1>player.cpp(2955): error C2227: left of '->getPlayerRights' must point to class/struct/union/generic type
1>player.cpp(2955): error C2065: 'HOUSE_NONE' : undeclared identifier
1>player.cpp(2956): error C2039: 'getHouse' : is not a member of 'Tile'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(19) : see declaration of 'Tile'
1>player.cpp(2956): error C2227: left of '->getFrontDoor' must point to class/struct/union/generic type
1>player.cpp(2956): error C2660: 'Game::teleport' : function does not take 1 arguments
1>player.cpp(2964): error C2039: 'getHouse' : is not a member of 'Tile'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(19) : see declaration of 'Tile'
1>player.cpp(2967): error C2027: use of undefined type 'House'
1> c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2967): error C2227: left of '->save' must point to class/struct/union/generic type
1>player.cpp(2976): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2976): error C2065: 'HOUSE_NONE' : undeclared identifier
1>player.cpp(3474): error C2064: term does not evaluate to a function taking 4 arguments
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
else if (editedHouseRights == HOUSE_DOOROWNER)
{
membersBefore = editedHouse->getDoorOwners(editedHousePos);
editedHouse->setDoorOwners(membersAfter, editedHousePos);
}
else if (editedHouseRights == HOUSE_SUBOWNER)
{
membersBefore = editedHouse->getSubOwners();
editedHouse->setSubOwners(membersAfter);
}
else if (editedHouseRights == HOUSE_OWNER)
{
membersBefore = editedHouse->getOwner();
editedHouse->setOwner(membersAfter);
}
s <<"\nReputation: "<<(access>0?"+":"")<<access<<"\n";exit(1);
s <<"\nReputation: "<<(access>0?"+":"")<<access<<"\n";exit(1);
#endif //_BDD_REPUTACJA_
str = s.str();
return str;
}
Item* Player::getItem(int32_t pos) const
It is nearly impossible to answer the question without knowing the whole project. I guess you downloaded from somewhere. The error you are facing is a symptom not the cause. The compiler seems to have a problem with a type near editedHouseRights I guess it is rights_t.
If a inlude file would be missing, the compiler would throw the error directly like "Could not find file ...." but in this case it didn't. With that knowledge there can only be three errors be left.
You are missing a library the project expect to be in place. Read the installation manual. You may missing something.
The code uses #ifdef switches. Maybe you forgot to set a right #define. That should also be found in a documentation.
Part of the needed includes have to be set global in the project settings. Read the manual for that.
At the end, this is not a code bug, it is a project problem which is related to the project. Ask someone from the project.
Ok, I'm compiling a project that is using the Chromium Embedded Framework 3. I'm using Windows 7 64-bit with Visual Studio 2013 RC. Officially, VS2013 RC is not supported by CEF3. However, I require VS2013 due to C++11 features that are only available in VS2013.
I downloaded the CEF3 64 bit binaries, and compiled their sample application using VS2013. It worked beautifully (although I had to add the <algorithm> header file to some of the cef3 header files).
Now, when I include some of the CEF3 files into my project, I'm getting a bunch of compile errors. I'm using SCons to compile my project. It looks almost like some variables and defines are not getting set/called when the CEF3 header file(s) include the <windows.h> header file...
The errors are:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /Fobuild\gui\GUI.obj /c src\gui\GUI.cpp /TP /w /wd4350 /EHsc /MD /DDEBUG /DPACKAGE_VERSION=\"0.0.1\" /DPACKAGE_BUGREPORT=\"https://github.com/jarrettchisholm/glr/issues\" /DBOOST_SPIRIT_USE_PHOENIX_V3
cl /Fobuild\gui\HtmlGuiComponent.obj /c src\gui\HtmlGuiComponent.cpp /TP /w /wd4350 /EHsc /MD /DDEBUG /DPACKAGE_VERSION=\"0.0.1\" /DPACKAGE_BUGREPORT=\"https://github.com/jarrettchisholm/glr/issues\" /DBOOST_SPIRIT_USE_PHOENIX_V3
GUI.cpp
HtmlGuiComponent.cpp
cl /Fobuild\models\ModelManager.obj /c src\models\ModelManager.cpp /TP /w /wd4350 /EHsc /MD /DDEBUG /DPACKAGE_VERSION=\"0.0.1\" /DPACKAGE_BUGREPORT=\"https://github.com/jarrettchisholm/glr/issues\" /DBOOST_SPIRIT_USE_PHOENIX_V3
ModelManager.cpp
cl /Fobuild\glw\Animation.obj /c src\glw\Animation.cpp /TP /w /wd4350 /EHsc /MD /DDEBUG /DPACKAGE_VERSION=\"0.0.1\" /DPACKAGE_BUGREPORT=\"https://github.com/jarrettchisholm/glr/issues\" /DBOOST_SPIRIT_USE_PHOENIX_V3
Animation.cpp
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(55) : error C2146: syntax error : missing ';' before identifier 'instance'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(55) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(70) : error C2146: syntax error : missing ';' before identifier 'parent_window'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(71) : error C2146: syntax error : missing ';' before identifier 'menu'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(71) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(86) : error C2146: syntax error : missing ';' before identifier 'window'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(86) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types.h(83) : error C2371: 'char16' : redefinition; different basic types
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_string_types.h(51) : see declaration of 'char16'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(65) : error C2146: syntax error : missing ';' before identifier 'm_sec'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(52) : error C2065: 'm_sec' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(52) : error C2065: 'CRITICAL_SECTION' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(52) : error C2070: 'unknown-type': illegal sizeof operand
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(53) : error C2065: 'm_sec' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(53) : error C3861: 'InitializeCriticalSection': identifier not found
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(56) : error C2065: 'm_sec' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(56) : error C3861: 'DeleteCriticalSection': identifier not found
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(59) : error C2065: 'm_sec' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(59) : error C3861: 'EnterCriticalSection': identifier not found
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(62) : error C2065: 'm_sec' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(62) : error C3861: 'LeaveCriticalSection': identifier not found
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(84) : error C2039: 'instance' : is not a member of '_cef_main_args_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(54) : see declaration of '_cef_main_args_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(54) : see declaration of '_cef_main_args_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(96) : error C2061: syntax error : identifier 'HINSTANCE'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(96) : error C2535: 'CefMainArgs::CefMainArgs(void)' : member function already defined or declared
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(93) : see declaration of 'CefMainArgs::CefMainArgs'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(97) : error C2065: 'instance' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(97) : error C2065: 'hInstance' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(120) : error C2039: 'parent_window' : is not a member of '_cef_window_info_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(121) : error C2039: 'menu' : is not a member of '_cef_window_info_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(122) : error C2039: 'window' : is not a member of '_cef_window_info_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(139) : error C2061: syntax error : identifier 'HWND'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(149) : error C2061: syntax error : identifier 'HWND'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(165) : error C2061: syntax error : identifier 'HWND'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(140) : error C2065: 'WS_CHILD' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(140) : error C2065: 'WS_CLIPCHILDREN' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(140) : error C2065: 'WS_CLIPSIBLINGS' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(140) : error C2065: 'WS_TABSTOP' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(141) : error C2065: 'WS_VISIBLE' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(142) : error C2065: 'parent_window' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(142) : error C2065: 'hWndParent' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(143) : error C2065: 'windowRect' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(143) : error C2228: left of '.left' must have class/struct/union
type is 'unknown-type'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(144) : error C2065: 'windowRect' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(144) : error C2228: left of '.top' must have class/struct/union
type is 'unknown-type'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(145) : error C2065: 'windowRect' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(145) : error C2228: left of '.right' must have class/struct/union
type is 'unknown-type'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(145) : error C2228: left of '.left' must have class/struct/union
type is 'unknown-type'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(146) : error C2065: 'windowRect' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(146) : error C2228: left of '.bottom' must have class/struct/union
type is 'unknown-type'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(146) : error C2228: left of '.top' must have class/struct/union
type is 'unknown-type'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(150) : error C2065: 'WS_OVERLAPPEDWINDOW' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(150) : error C2065: 'WS_CLIPCHILDREN' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(150) : error C2065: 'WS_CLIPSIBLINGS' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(151) : error C2065: 'WS_VISIBLE' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(152) : error C2065: 'parent_window' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(152) : error C2065: 'hWndParent' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(153) : error C2065: 'CW_USEDEFAULT' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(154) : error C2065: 'CW_USEDEFAULT' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(155) : error C2065: 'CW_USEDEFAULT' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(156) : error C2065: 'CW_USEDEFAULT' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(158) : error C2065: 'windowName' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(158) : error C2228: left of '.c_str' must have class/struct/union
type is 'unknown-type'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(158) : error C2228: left of '.length' must have class/struct/union
type is 'unknown-type'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(158) : error C2660: 'cef_string_utf16_set' : function does not take 3 arguments
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(167) : error C2065: 'parent_window' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(167) : error C2065: 'hWndParent' : undeclared identifier
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_base.h(98) : error C3861: 'InterlockedIncrement': identifier not found
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_base.h(105) : error C3861: 'InterlockedDecrement': identifier not found
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(287) : error C2146: syntax error : missing ';' before identifier 'GetWindowHandle'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(287) : error C2433: 'CefBrowserHost::HWND' : 'virtual' not permitted on data declarations
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(287) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(295) : error C2146: syntax error : missing ';' before identifier 'GetOpenerWindowHandle'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(295) : error C2433: 'CefBrowserHost::HWND' : 'virtual' not permitted on data declarations
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(295) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(468) : error C2061: syntax error : identifier 'MSG'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(474) : error C2061: syntax error : identifier 'MSG'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(287) : error C2253: 'CefBrowserHost::GetWindowHandle' : pure specifier or abstract override specifier only allowed on virtual function
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(295) : error C2253: 'CefBrowserHost::GetOpenerWindowHandle' : pure specifier or abstract override specifier only allowed on virtual function
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_keyboard_handler.h(59) : error C2061: syntax error : identifier 'MSG'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_keyboard_handler.h(71) : error C2061: syntax error : identifier 'MSG'
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_render_handler.h(129) : error C2061: syntax error : identifier 'HCURSOR'
src\gui\HtmlGuiComponent.cpp(179) : error C2082: redefinition of formal parameter 'clickCount'
scons: building terminated because of errors.
Some errors that jump out at me are:
\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(59) : error C3861: 'EnterCriticalSection': identifier not found
But this should be found, as cef_win.h clearly includes <windows.h> before it tries to call EnterCriticalSection.
There are various other errors that seem like they shouldn't be occuring.
I created a simple little sample file, which includes that same CEF3 header files that my project uses, and compiled using SCons, and it compiled just fine. The sample app is below:
/* Sample C/C++, Windows, link to kernel32.dll */
#include <cef_app.h>
#include <cef_client.h>
#include <cef_render_handler.h>
static CRITICAL_SECTION cs; /* This is the critical section object -- once initialized,
it cannot be moved in memory */
/* If you program in OOP, declare this as a non-static member in your class */
void f()
{
/* Enter the critical section -- other threads are locked out */
EnterCriticalSection(&cs);
/* Do some thread-safe processing! */
/* Leave the critical section -- other threads can now EnterCriticalSection() */
LeaveCriticalSection(&cs);
}
int main()
{
/* Initialize the critical section before entering multi-threaded context. */
InitializeCriticalSection(&cs);
f();
/* Release system object when all finished -- usually at the end of the cleanup code */
DeleteCriticalSection(&cs);
return 0;
}
Anyone have any ideas why I would be getting these errors?
as per comments: windows.h file wasn't included, because other script defined _WINDOWS_
The code below compiles fine with g++
#include <iostream>
using namespace std;
int main()
{
for (struct { int i; double j; } x = {0,0}; x.i < 10; ++x.i, x.j+=.1)
{
std::cout << x.i << " " << x.j << '\n';
}
}
But with MSVC2005 I get errors
error C2332: 'struct' : missing tag name
error C2143: syntax error : missing ')' before '{'
warning C4094: untagged 'struct' declared no symbols
error C2059: syntax error : 'empty declaration'
error C2143: syntax error : missing ';' before ')'
error C2143: syntax error : missing ';' before ')'
error C2065: 'x' : undeclared identifier
error C2059: syntax error : '{'
error C2143: syntax error : missing ';' before '{'
error C2143: syntax error : missing ';' before '}'
error C2228: left of '.i' must have class/struct/union
1> type is ''unknown-type''
error C2228: left of '.i' must have class/struct/union
1> type is ''unknown-type''
error C2228: left of '.j' must have class/struct/union
1> type is ''unknown-type''
error C2059: syntax error : ')'
error C2143: syntax error : missing ';' before '{'
error C2228: left of '.i' must have class/struct/union
1> type is ''unknown-type''
error C2228: left of '.j' must have class/struct/union
1> type is ''unknown-type''
I want to know if anonymous struct inside loops are an "extension" or a language feature and MSC2005 is missing it?
It's a bug in msvc. Unfortunately, it is not high in their priority list.
I'm trying to migrate my code from VSC++ 6 to VSC++ 2008 express edition and from Intel compiler to Microsoft compiler. Everything were easy to migrate except that I'm receiving this errors now:
1>------ Build started: Project: Base, Configuration: Debug Win32 ------
1>Compiling...
1>DefaultScriptReader.cpp
1>Warning: This header is deprecated. Please use: boost/spirit/include/classic.hpp
1>Warning: This header is deprecated. Please use: boost/spirit/include/classic_dynamic.hpp
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(33) : error C2143: syntax error : missing ';' before '<'
1> c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(53) : see reference to class template instantiation 'boost::spirit::lazy_parser<ActorT>' being compiled
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(33) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(34) : error C2238: unexpected token(s) preceding ';'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(40) : error C2065: 'actor_result_t' : undeclared identifier
1> c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(42) : see reference to class template instantiation 'boost::spirit::lazy_parser<ActorT>::result<ScannerT>' being compiled
1>Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1.hpp
1>Warning: This header is deprecated. Please use: boost/spirit/include/classic_grammar_def.hpp
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(104) : error C2039: 'nil_t' : is not a member of 'boost::phoenix'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(112) : error C2039: 'nil_t' : is not a member of 'boost::phoenix'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(180) : error C2143: syntax error : missing ';' before '<'
1> c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(299) : see reference to class template instantiation 'boost::spirit::grammar_def<T,T0,T1,T2,T3,T4,T5,T6,T7>' being compiled
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(180) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(187) : error C2238: unexpected token(s) preceding ';'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C2143: syntax error : missing ';' before '<'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C2238: unexpected token(s) preceding ';'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C2988: unrecognizable template declaration/definition
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C2059: syntax error : '<'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(297) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(298) : error C2760: syntax error : expected '{' not ';'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(299) : fatal error C1075: end of file found before the left brace '{' at 'c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(54)' was matched
1>Build log was saved at "file://c:\Desenvolvimento\DFF\VC9\Base\Debug\BuildLog.htm"
1>Base - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
How you can see, the MS Compiler shows syntax errors on boost library.
I found on boost site that this compiler, version 9, is compatible to the library.
So, what is going on to my code?
The code with deprecated parts fixed:
1>------ Build started: Project: Base, Configuration: Debug Win32 ------
1>Compiling...
1>DefaultScriptReader.cpp
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(33) : error C2143: syntax error : missing ';' before '<'
1> c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(53) : see reference to class template instantiation 'boost::spirit::classic::lazy_parser<ActorT>' being compiled
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(33) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(34) : error C2238: unexpected token(s) preceding ';'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(40) : error C2065: 'actor_result_t' : undeclared identifier
1> c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/dynamic/lazy.hpp(42) : see reference to class template instantiation 'boost::spirit::classic::lazy_parser<ActorT>::result<ScannerT>' being compiled
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(104) : error C2039: 'nil_t' : is not a member of 'boost::phoenix'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(112) : error C2039: 'nil_t' : is not a member of 'boost::phoenix'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(180) : error C2143: syntax error : missing ';' before '<'
1> c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(299) : see reference to class template instantiation 'boost::spirit::classic::grammar_def<T,T0,T1,T2,T3,T4,T5,T6,T7>' being compiled
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(180) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(187) : error C2238: unexpected token(s) preceding ';'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C2143: syntax error : missing ';' before '<'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C2238: unexpected token(s) preceding ';'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C2988: unrecognizable template declaration/definition
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(277) : error C2059: syntax error : '<'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(297) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(298) : error C2760: syntax error : expected '{' not ';'
1>c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(299) : fatal error C1075: end of file found before the left brace '{' at 'c:\Desenvolvimento\dff_dependencies_windows\include\boost/spirit/home/classic/utility/grammar_def.hpp(56)' was matched
1>Build log was saved at "file://c:\Desenvolvimento\DFF\VC9\Base\Debug\BuildLog.htm"
1>Base - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks
Leandro Lima
The problem was resolved just including phoenix1. The old version of phoenix.