I am trying to use the function GetAdapterIdentifier
but for some reason I keep on getting an error
g++ main.cpp -ld3d9 -ld3dcompiler -lgdi32 -static -static-libstdc++ -o output
main.cpp: In function 'int main()':
main.cpp:22:59: error: cannot call member function 'virtual HRESULT IDirect3D9::GetAdapterIdentifier(UINT, DWORD, D3DADAPTER_IDENTIFIER9*)' without object
22 | HRESULT hResult = IDirect3D9::GetAdapterIdentifier(x ,xWord, &pIdentifier);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:7: build] Error 1
This is my main.cpp file very simple yet still got an error
#include <iostream>
#include <d3d9.h>
#include <D3D9Types.h>
#include <tchar.h>
int main(void)
{
UINT x;
DWORD xWord;
D3DADAPTER_IDENTIFIER9 pIdentifier;
HRESULT hResult = IDirect3D9::GetAdapterIdentifier(x ,xWord, &pIdentifier);
return 0;
}
I am using a Makefile
to compile the main file
CC = g++
FILES = main.cpp
OUT_EXE = output
INCLUDES = -ld3d9 -ld3dcompiler -lgdi32 -static -static-libstdc++
build:$(FILES)
$(CC) $(FILES) $(INCLUDES) -o $(OUT_EXE)