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.
Related
#include "stdafx.h"
#include <iostream>
#include <conio.h>
int main()
{
int choice,num1,num2,num3,num4,result;
cout<<"NOTE:PASSWORD IS HIHGLY ENCYRPTED BETWEEN EACH 2 NUMBERS a + Sign!!!!"<<endl;
cout<<"Choose where you want to go:"<<endl;
cout<<"1-Wifi password list"<<endl;
cout<<"2-Facebook Password & Email"<<endl;
cin>>choice;
cout<<"Please Enter the password to continue:"<<endl;
cin>>num1>>num2>>num3>>num4;
switch(choice)
{
case 1: if (result==100)
{
cout<<"!!!!!Congratz you are Proffesional Cracker!!!!!"<<endl;
break;
}
else
{
result=num1+num2+num3+num4
cout<<"The sum of the Numbers aren't equal to the encyrpted number! try again"<<endl;
break
}
}
return 0;
}
i am making this project that if he choose case 1: ...... the "IF" show if result==100 then to cout<<"You are proffesinal cracker"<
but after compiling errors displayed in output
1>------ Build started: Project: login, Configuration: Debug Win32
------ 1> stdafx.cpp 1> login.cpp 1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(12): error
C2065: 'cout' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(12): error
C2065: 'endl' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(13): error
C2065: 'cout' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(13): error
C2065: 'endl' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(14): error
C2065: 'cout' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(14): error
C2065: 'endl' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(15): error
C2065: 'cout' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(15): error
C2065: 'endl' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(16): error
C2065: 'cin' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(17): error
C2065: 'cout' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(17): error
C2065: 'endl' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(18): error
C2065: 'cin' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(24): error
C2065: 'cout' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(24): error
C2065: 'endl' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(30): error
C2146: syntax error : missing ';' before identifier 'cout'
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(30): error
C2065: 'cout' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(30): error
C2065: 'endl' : undeclared identifier
1>c:\users\mycomm\desktop\gallery\c++\login\login\login.cpp(32): error
C2143: syntax error : missing ';' before '}'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
please review my code and help
The compiler does not recognise cout in this context.
You should refer the scope of cout with the scope operator ::
cout is part of the std namespace.
So wherever you have cout, substitute it with std::cout.
The same is part with endl -> std::endl. The same applies to cin -> std::cin. Alternatively use '\n' instead of std::endl.
Just for further knowledge:
You could add using namespace std; in the top of your code. But, it is not normally suggested because of the best answer provided in this question.
And some advice:
Your switch statement is redundant, since you only evaluate if a value is ONE SINGLE option. You can change it with a normal if statement and then nest your existing if statement inside. Check switch statement documentation to see when it is more appropriate to use it.
#include <stdio.h>
#include <conio.h>
#include <windows.h>
typedef short _stdcall (*PtrInp)(short EndPorta);
typedef void _stdcall (*PtrOut)(short EndPorta, short datum);
HINSTANCE hLib;
PtrInp inportB;
PtrOut outportB;
int main()
{
/*Inpout32*/
//Carrega a DLL na memória.
hLib = LoadLibrary("inpout32.dll");
if(hLib == NULL)
{
printf("Error.");
getch();
}
else {
inportB = (PtrInp) GetProcAddress(hLib, "Inp32");
if(inportB == NULL)
{
printf("\nError2");
}
//Obtém o endereço da função Out32 contida na DLL.
outportB = (PtrOut) GetProcAddress(hLib, "Out32");
if(outportB == NULL)
{
printf("Error3");
}
}
When I compile using DevC++, the code works just fine, but when I try to compile it in Visual C++ it gives a bunch of errors, how can I fix them?
The following errors is shown in the output:
1><PATH>(12) : error C2059: syntax error : '('
1><PATH>(13) : error C2059: syntax error : '('
1><PATH>(15) : error C2065: 'PtrInp' : undeclared identifier
1><PATH>(15) : error C2146: syntax error : missing ';' before identifier 'inportB'
1><PATH>(15) : error C2065: 'inportB' : undeclared identifier
1><PATH>(16) : error C2065: 'PtrOut' : undeclared identifier
1><PATH>(16) : error C2146: syntax error : missing ';' before identifier 'outportB'
1><PATH>(16) : error C2065: 'outportB' : undeclared identifier
1><PATH>(30) : error C2065: 'inportB' : undeclared identifier
1><PATH>(30) : error C2065: 'PtrInp' : undeclared identifier
1><PATH>(30) : error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
1><PATH>(31) : error C2065: 'inportB' : undeclared identifier
1><PATH>(36) : error C2065: 'outportB' : undeclared identifier
1><PATH>(36) : error C2065: 'PtrOut' : undeclared identifier
1><PATH>(36) : error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
1><PATH>(37) : error C2065: 'outportB' : undeclared identifier
1><PATH>(53) : error C3861: 'outportB': identifier not found
1><PATH>(56) : error C3861: 'outportB': identifier not found
1><PATH>(59) : error C3861: 'outportB': identifier not found
1><PATH>(62) : error C3861: 'outportB': identifier not found
1><PATH>(65) : error C3861: 'outportB': identifier not found
1><PATH>(68) : error C3861: 'outportB': identifier not found
1><PATH>(71) : error C3861: 'outportB': identifier not found
1><PATH>(74) : error C3861: 'outportB': identifier not found
1><PATH>(80) : error C3861: 'outportB': identifier not found
Under MSVC the calling convention should be placed within the parenthesis
typedef short (__stdcall *PtrInp)(short EndPorta);
typedef void (__stdcall *PtrOut)(short EndPorta, short datum);
Please also make sure you use MBCS (Mutli Byte Charecter Set) within your project settings
It has to be __stdcall, i.e. a double-underscore. In addition to this, the classifier __stdcall should be applied to the function itself, not to the return value:
typedef short (__stdcall *PtrInp)(short EndPorta);
typedef void (__stdcall *PtrOut)(short EndPorta, short datum);
See more examples here: http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx
Help me to fix this Error
#include <Windows.h>
#include <stdio.h>
#include <Psapi.h>
td_NtQuerySystemInformation NtQuerySystemInformation = NULL;
td_NtQueryObject NtQueryObject = NULL;
td_NtDuplicateObject NtDuplicateObject = NULL;
BOOL Init() {
HMODULE hNtdll = GetModuleHandle(TEXT("ntdll.dll"));
if(!hNtdll)
return FALSE;
NtQuerySystemInformation = (td_NtQuerySystemInformation)GetProcAddress(hNtdll, "NtQuerySystemInformation");
NtQueryObject = (td_NtQueryObject)GetProcAddress(hNtdll, "NtQueryObject");
NtDuplicateObject = (td_NtDuplicateObject)GetProcAddress(hNtdll, "NtDuplicateObject");
return (NtQuerySystemInformation && NtQueryObject && NtDuplicateObject);
}
BOOL AcquireDebugPrivilege() {
HANDLE hToken = NULL;
if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
return FALSE;
BOOL bSuccess = FALSE;
TOKEN_PRIVILEGES tp;
tp.PrivilegeCount = 1;
if(LookupPrivilegeValue(0, SE_DEBUG_NAME, &tp.Privileges[0].Luid)) {
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if(AdjustTokenPrivileges(hToken, 0, &tp, sizeof(tp), 0, 0))
bSuccess = TRUE;
}
CloseHandle(hToken);
return bSuccess;
}
BOOL IsProcessFound(DWORD dwProcessId, PSYSTEM_PROCESS_INFORMATION pInfos) {
PSYSTEM_PROCESS_INFORMATION pCurrent = pInfos;
while(TRUE) {
if((DWORD)pCurrent->UniqueProcessId == dwProcessId)
return TRUE;
if(pCurrent->NextEntryOffset == 0)
break;
pCurrent = (PSYSTEM_PROCESS_INFORMATION)((DWORD_PTR)pCurrent + pCurrent- >NextEntryOffset);
}
return FALSE;
}
BOOL DetectHiddenProcesses(PUINT piCount) {
if(!piCount)
return FALSE;
*piCount = 0;
// first, we retrieve the process list (this is dirty but the only way)
DWORD dwLen = sizeof(SYSTEM_PROCESS_INFORMATION);
PSYSTEM_PROCESS_INFORMATION pProcessInfos = (PSYSTEM_PROCESS_INFORMATION)malloc(dwLen);
while(pProcessInfos) {
NTSTATUS status = NtQuerySystemInformation(SystemProcessInformation, pProcessInfos, dwLen, &dwLen);
if(NT_SUCCESS(status))
break;
else if(status != STATUS_INFO_LENGTH_MISMATCH) {
free(pProcessInfos);
return FALSE;
}
free(pProcessInfos);
pProcessInfos = (PSYSTEM_PROCESS_INFORMATION)malloc(dwLen);
}
if(!pProcessInfos)
return FALSE;
// secondly, we retreive all open handle
dwLen = sizeof(SYSTEM_HANDLE_INFORMATION);
PSYSTEM_HANDLE_INFORMATION pHandleInfos = (PSYSTEM_HANDLE_INFORMATION)malloc(dwLen);
while(pHandleInfos) {
NTSTATUS status = NtQuerySystemInformation(SystemHandleInformation, pHandleInfos, dwLen, &dwLen);
if(NT_SUCCESS(status))
break;
else if(status != STATUS_INFO_LENGTH_MISMATCH) {
free(pHandleInfos);
return FALSE;
}
free(pHandleInfos);
pHandleInfos = (PSYSTEM_HANDLE_INFORMATION)malloc(dwLen);
}
if(!pHandleInfos)
return FALSE;
// now, we find all handle to a process
POBJECT_TYPE_INFORMATION pType = (POBJECT_TYPE_INFORMATION)malloc(4096);
if(!pType) {
free(pHandleInfos);
free(pProcessInfos);
return FALSE;
}
for(ULONG i = 0; i < pHandleInfos->HandleCount; i++) {
DWORD dwOwner = pHandleInfos->Handles[i].ProcessId;
HANDLE hHandle = (HANDLE)pHandleInfos->Handles[i].Handle;
HANDLE hOwner = OpenProcess(PROCESS_DUP_HANDLE, FALSE, dwOwner);
if(hOwner == NULL)
continue;
// we duplicate the handle so we can query it
HANDLE hHandleLocal = NULL;
NTSTATUS status = NtDuplicateObject(hOwner, hHandle, GetCurrentProcess(), &hHandleLocal, 0, 0, DUPLICATE_SAME_ACCESS | DUPLICATE_SAME_ATTRIBUTES);
if(NT_SUCCESS(status)) {
// now we query its type
status = NtQueryObject(hHandleLocal, ObjectTypeInformation, pType, 4096, NULL);
if(NT_SUCCESS(status)) {
if(pType->TypeName.Buffer && wcscmp(pType->TypeName.Buffer, L"Process") == 0) {
DWORD dwProcessId = GetProcessId(hHandleLocal);
// check if the process is not hidden
if(!IsProcessFound(dwProcessId, pProcessInfos)) {
// hoho here we go
wchar_t szProcess[MAX_PATH];
if(GetProcessImageFileNameW(hHandleLocal, szProcess, MAX_PATH) == 0)
wcscpy_s(szProcess, L"<Unknown>");
printf("[%0.4d] %ws\n", dwProcessId, szProcess);
(*piCount)++;
}
}
}
}
CloseHandle(hOwner);
}
free(pType);
free(pHandleInfos);
free(pProcessInfos);
return TRUE;
}
int main(int argc, char* argv[]) {
UINT iHiddenCount = 0;
if(!AcquireDebugPrivilege()) {
printf("Unable to acquire debug privilege.\n");
return EXIT_FAILURE;
}
if(!Init()) {
printf("Initialization failure.\r\n");
return EXIT_FAILURE;
}
DetectHiddenProcesses(&iHiddenCount);
printf("Found %d hidden process%s.\r\n", iHiddenCount, (iHiddenCount > 1 ? "es" : ""));
return EXIT_SUCCESS;
}
Code
1>------ Build started: Project: mand, Configuration: Release Win32 ------
1> Main.cpp
1>Main.cpp(5): error C2146: syntax error : missing ';' before identifier 'NtQuerySystemInformation'
1>Main.cpp(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Main.cpp(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Main.cpp(6): error C2146: syntax error : missing ';' before identifier 'NtQueryObject'
1>Main.cpp(6): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Main.cpp(6): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Main.cpp(7): error C2146: syntax error : missing ';' before identifier 'NtDuplicateObject'
1>Main.cpp(7): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Main.cpp(7): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Main.cpp(14): error C2146: syntax error : missing ';' before identifier 1>Main.cpp(15): error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
1>Main.cpp(16): error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
1>Main.cpp(41): error C2061: syntax error : identifier 'PSYSTEM_PROCESS_INFORMATION'
1>Main.cpp(42): error C2065: 'PSYSTEM_PROCESS_INFORMATION' : undeclared identifier
1>Main.cpp(42): error C2146: syntax error : missing ';' before identifier 'pCurrent'
1>Main.cpp(42): error C2065: 'pCurrent' : undeclared identifier
1>Main.cpp(42): error C2065: 'pInfos' : undeclared identifier
1>Main.cpp(45): error C2065: 'pCurrent' : undeclared identifier
1>Main.cpp(45): error C2227: left of '->UniqueProcessId' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>Main.cpp(48): error C2065: 'pCurrent' : undeclared identifier
1>Main.cpp(48): error C2227: left of '->NextEntryOffset' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>Main.cpp(50): error C2065: 'pCurrent' : undeclared identifier
1>Main.cpp(50): error C2065: 'PSYSTEM_PROCESS_INFORMATION' : undeclared identifier
1>Main.cpp(50): error C2065: 'pCurrent' : undeclared identifier
1>Main.cpp(50): error C2065: 'pCurrent' : undeclared identifier
1>Main.cpp(50): error C2227: left of '->NextEntryOffset' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>Main.cpp(62): error C2065: 'SYSTEM_PROCESS_INFORMATION' : undeclared identifier
1>Main.cpp(62): error C2070: ''unknown-type'': illegal sizeof operand
1>Main.cpp(63): error C2065: 'PSYSTEM_PROCESS_INFORMATION' : undeclared identifier
1>Main.cpp(63): error C2146: syntax error : missing ';' before identifier 'pProcessInfos'
1>Main.cpp(63): error C2065: 'pProcessInfos' : undeclared identifier
1>Main.cpp(63): error C2065: 'PSYSTEM_PROCESS_INFORMATION' : undeclared identifier
1>Main.cpp(63): error C2146: syntax error : missing ';' before identifier 'malloc'
1>Main.cpp(65): error C2065: 'pProcessInfos' : undeclared identifier
1>Main.cpp(66): error C2065: 'SystemProcessInformation' : undeclared identifier
1>Main.cpp(66): error C2065: 'pProcessInfos' : undeclared identifier
1>Main.cpp(67): error C3861: 'NT_SUCCESS': identifier not found
1>Main.cpp(69): error C2065: 'STATUS_INFO_LENGTH_MISMATCH' : undeclared identifier
1>Main.cpp(70): error C2065: 'pProcessInfos' : undeclared identifier
1>Main.cpp(74): error C2065: 'pProcessInfos' : undeclared identifier
1>Main.cpp(75): error C2065: 'pProcessInfos' : undeclared identifier
1>Main.cpp(75): error C2065: 'PSYSTEM_PROCESS_INFORMATION' : undeclared identifier
1>Main.cpp(75): error C2146: syntax error : missing ';' before identifier 'malloc'
1>Main.cpp(78): error C2065: 'pProcessInfos' : undeclared identifier
1>Main.cpp(82): error C2065: 'SYSTEM_HANDLE_INFORMATION' : undeclared identifier
1>Main.cpp(82): error C2070: ''unknown-type'': illegal sizeof operand
1>Main.cpp(83): error C2065: 'PSYSTEM_HANDLE_INFORMATION' : undeclared identifier
1>Main.cpp(83): error C2146: syntax error : missing ';' before identifier 'pHandleInfos'
1>Main.cpp(83): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(83): error C2065: 'PSYSTEM_HANDLE_INFORMATION' : undeclared identifier
1>Main.cpp(83): error C2146: syntax error : missing ';' before identifier 'malloc'
1>Main.cpp(85): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(86): error C2065: 'SystemHandleInformation' : undeclared identifier
1>Main.cpp(86): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(87): error C3861: 'NT_SUCCESS': identifier not found
1>Main.cpp(89): error C2065: 'STATUS_INFO_LENGTH_MISMATCH' : undeclared identifier
1>Main.cpp(90): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(94): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(95): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(95): error C2065: 'PSYSTEM_HANDLE_INFORMATION' : undeclared identifier
1>Main.cpp(95): error C2146: syntax error : missing ';' before identifier 'malloc'
1>Main.cpp(98): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(102): error C2065: 'POBJECT_TYPE_INFORMATION' : undeclared identifier
1>Main.cpp(102): error C2146: syntax error : missing ';' before identifier 'pType'
1>Main.cpp(102): error C2065: 'pType' : undeclared identifier
1>Main.cpp(102): error C2065: 'POBJECT_TYPE_INFORMATION' : undeclared identifier
1>Main.cpp(102): error C2146: syntax error : missing ';' before identifier 'malloc'
1>Main.cpp(103): error C2065: 'pType' : undeclared identifier
1>Main.cpp(104): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(105): error C2065: 'pProcessInfos' : undeclared identifier
1>Main.cpp(109): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(109): error C2227: left of '->HandleCount' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>Main.cpp(110): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(110): error C2227: left of '->Handles' must point to class/struct/union/generic type
1>Main.cpp(110): error C2228: left of '.ProcessId' must have class/struct/union
1>Main.cpp(111): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(111): error C2227: left of '->Handles' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>Main.cpp(111): error C2228: left of '.Handle' must have class/struct/union
1>Main.cpp(119): error C2065: 'DUPLICATE_SAME_ATTRIBUTES' : undeclared identifier
1>Main.cpp(119): error C2064: term does not evaluate to a function taking 7 arguments
1>Main.cpp(120): error C3861: 'NT_SUCCESS': identifier not found
1>Main.cpp(122): error C2065: 'ObjectTypeInformation' : undeclared identifier
1>Main.cpp(122): error C2065: 'pType' : undeclared identifier
1>Main.cpp(123): error C3861: 'NT_SUCCESS': identifier not found
1>Main.cpp(124): error C2065: 'pType' : undeclared identifier
1>Main.cpp(124): error C2227: left of '->TypeName' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>Main.cpp(124): error C2228: left of '.Buffer' must have class/struct/union
1>Main.cpp(124): error C2065: 'pType' : undeclared identifier
1>Main.cpp(124): error C2227: left of '->TypeName' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>Main.cpp(124): error C2228: left of '.Buffer' must have class/struct/union
1>Main.cpp(127): error C2065: 'pProcessInfos' : undeclared identifier
1>Main.cpp(142): error C2065: 'pType' : undeclared identifier
1>Main.cpp(144): error C2065: 'pHandleInfos' : undeclared identifier
1>Main.cpp(145): error C2065: 'pProcessInfos' : undeclared identifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
These types are undefined and therefore unknown to the compiler:
td_NtQuerySystemInformation NtQuerySystemInformation = NULL;
td_NtQueryObject NtQueryObject = NULL;
td_NtDuplicateObject NtDuplicateObject = NULL;
Same for PSYSTEM_PROCESS_INFORMATION, POBJECT_TYPE_INFORMATION etc.
You need to include their definition.
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_
I'm a newbie in OpenCV, an currently following a totorial to display an image using Windows Form App (Visual C++ 2008). The tutorial instruct me to make a header file independently (its called cvToBitmap.h) before applying it on the stdafx.h of the header file in the project. The header file is functioned to convert an image in IplImage format into bitmap format. But, when i compiled the program, it occured 50 program error in the header program.
Below is the cvToBitmap.h source program
#ifndef _CVTOBITMAP_H_
#define _CVTOBITMAP_H_
static void FillBitmapInfo (BITMAPINFO* bmi, int
width, int height, int bpp, int origin)
{
assert ((bmi&&width>=0)&&(height>=0)&&((bpp==8)
||(bpp==24)||(bpp==32)));
BITMAPINFOHEADER* bmih=&(bmi->bmiHeader);
memset(bmih,0,sizeof(*bmih));
bmih->biSize=sizeof(BITMAPINFOHEADER);
bmih->biWidth=width;
bmih->biHeight=origin?abs(height):-abs(height);
bmih->biPlanes=1;
bmih->biBitCount=(unsigned short)bpp;
bmih->biCompression=BI_RGB;
if(bpp==8){
RGBQUAD* palatte = bmi->bmiColors;
for(int i=0;i<256;i++){
palette[i].rgbBlue=palette[i].rgbGreen=palette[i].rgbRed=(BYTE)i;
palette[i].rgbReserved=0;
}
}
}
System::Drawing::Bitmap^ IplImageToBitmap(IplImage* src){
SIZE size = (0,0);
int channels=0;
void* dst_ptr=0;
const int channels0=3;
int origin=0;
CvMat stub,dst,*image;
bool changed_size=false;
HDC hdc=CreateCompatibleDC(0);
if(CV_IS_IMAGE_HDR(src))
origin=src->origin;
image=cvGetMat(src,&stub);
uchar buffer(sizeof(BITMAPINFO*)buffer;
size.cx=src->width;
size.cy=src->height;
channels=channels0;
FillBitmapInfo(binfo,size.cx,size.cy,channels*8,1);
HBITMAP hBitmap=reateDIBSection(hdc, binfo,DIB_RGB_COLORS, &dst_ptr,0,0);
if (hBitmap==NULL)
return nullptr;
cvInitMatHeader(&dst, size.cy,size.cx,CV_8UC3, dst_ptr, (size.cx*channels+3)&-4);
cvConvertImage(image, &ddst, origin=0 ? CV_CVTIMG:0);
System::Drawing::Bitmap^ bmpImage=
System::Drawing::Image::FromHbitmap(
System::IntPtr(hBitmap));
DeleteObject(hBitmap);
DeleteDC(hdc);
return bmpImage;
}
#endif
And Below is the error info
1>C:\opencv\build\include\cvToBitmap.h(6) : error C2065: 'BITMAPINFO' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(6) : error C2065: 'bmi' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(7) : error C2062: type 'int' unexpected
1>C:\opencv\build\include\cvToBitmap.h(8) : error C2143: syntax error : missing ';' before '{'
1>C:\opencv\build\include\cvToBitmap.h(8) : error C2447: '{' : missing function header (old-style formal list?)
1>C:\opencv\build\include\cvToBitmap.h(29) : error C2065: 'SIZE' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(29) : error C2146: syntax error : missing ';' before identifier 'size'
1>C:\opencv\build\include\cvToBitmap.h(29) : error C2065: 'size' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(37) : error C2065: 'HDC' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(37) : error C2146: syntax error : missing ';' before identifier 'hdc'
1>C:\opencv\build\include\cvToBitmap.h(37) : error C2065: 'hdc' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(37) : error C3861: 'CreateCompatibleDC': identifier not found
1>C:\opencv\build\include\cvToBitmap.h(41) : error C2065: 'BITMAPINFO' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(41) : error C2059: syntax error : ')'
1>C:\opencv\build\include\cvToBitmap.h(42) : error C2065: 'size' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(42) : error C2228: left of '.cx' must have class/struct/union
1> type is ''unknown-type''
1>C:\opencv\build\include\cvToBitmap.h(43) : error C2065: 'size' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(43) : error C2228: left of '.cy' must have class/struct/union
1> type is ''unknown-type''
1>C:\opencv\build\include\cvToBitmap.h(45) : error C2065: 'binfo' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(45) : error C2065: 'size' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(45) : error C2228: left of '.cx' must have class/struct/union
1> type is ''unknown-type''
1>C:\opencv\build\include\cvToBitmap.h(45) : error C2065: 'size' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(45) : error C2228: left of '.cy' must have class/struct/union
1> type is ''unknown-type''
1>C:\opencv\build\include\cvToBitmap.h(45) : error C3861: 'FillBitmapInfo': identifier not found
1>C:\opencv\build\include\cvToBitmap.h(46) : error C2065: 'HBITMAP' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(46) : error C2146: syntax error : missing ';' before identifier 'hBitmap'
1>C:\opencv\build\include\cvToBitmap.h(46) : error C2065: 'hBitmap' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(46) : error C2065: 'hdc' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(46) : error C2065: 'binfo' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(46) : error C2065: 'DIB_RGB_COLORS' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(46) : error C3861: 'reateDIBSection': identifier not found
1>C:\opencv\build\include\cvToBitmap.h(47) : error C2065: 'hBitmap' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(49) : error C2065: 'size' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(49) : error C2228: left of '.cy' must have class/struct/union
1> type is ''unknown-type''
1>C:\opencv\build\include\cvToBitmap.h(49) : error C2065: 'size' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(49) : error C2228: left of '.cx' must have class/struct/union
1> type is ''unknown-type''
1>C:\opencv\build\include\cvToBitmap.h(49) : error C2065: 'size' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(49) : error C2228: left of '.cx' must have class/struct/union
1> type is ''unknown-type''
1>C:\opencv\build\include\cvToBitmap.h(50) : error C2065: 'ddst' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(50) : error C2065: 'CV_CVTIMG' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(51) : error C2065: 'bmpImage' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(51) : error C2275: 'System::Drawing::Bitmap' : illegal use of this type as an expression
1>C:\opencv\build\include\cvToBitmap.h(53) : error C2065: 'hBitmap' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(54) : error C2065: 'hBitmap' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(54) : error C3861: 'DeleteObject': identifier not found
1>C:\opencv\build\include\cvToBitmap.h(55) : error C2065: 'hdc' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(55) : error C3861: 'DeleteDC': identifier not found
1>C:\opencv\build\include\cvToBitmap.h(56) : error C2065: 'bmpImage' : undeclared identifier
1>C:\opencv\build\include\cvToBitmap.h(57) : error C2143: syntax error : missing ')' before '}'
1>C:\opencv\build\include\cvToBitmap.h(57) : error C2143: syntax error : missing ';' before ')'
1>TampilForm - 50 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have no idea, what is the missing part.. Please help.. thanks..
You should include header with BITMAPINFO structure - add #include <windows.h> to your header file.