Meigyoku-Thmn / imgui-demo

1 stars 0 forks source link

(Help) When i try to build winnt.h give a lot errors #1

Closed darkmathew closed 9 months ago

darkmathew commented 9 months ago

I need your help with the compilation issue; I'm working on an internal application to inject an ImGui window into a DirectX 8 game. However, the "winnt.h" is causing a series of errors when I try to build the project, due to PVOID64.

I would like to know how you configured your development environment to successfully build your project.

Which version of Visual Studio are you using?

In my case, I'm using Community 2022.

Thanks in advance!

darkmathew commented 9 months ago

My OS is Windows 10. I forgot to mention this.

Meigyoku-Thmn commented 9 months ago

@darkmathew Can you copy all text in the Output Window (Build Output) in Visual Studio?

You have to install vcpkg and use platform 32 bit.

I created this repo for personal use only so it's not guaranteed to be buildable on other computers.

darkmathew commented 9 months ago

@darkmathew Can you copy all text in the Output Window (Build Output) in Visual Studio?

You have to install vcpkg and use platform 32 bit.

I created this repo for personal use only so it's not guaranteed to be buildable on other computers.

I installed imgui 32 bits with vcpkg. In my case, the problem generating the build is because I'm making a dll that ends up calling wiint.h during compilation. What I do know is that the last SDK that faithfully supported Directx 8 was the Windows CE 6.0 SDK. I'm almost thinking about making a virtual machine with Windows XP to try to compile this :-(

This the Output Window:

Severity Code Description Project File Line Suppression State Details Error C3646 'Buffer': unknown override specifier InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515
Error C2146 syntax error: missing ';' before identifier 'PVOID64' InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C2146 syntax error: missing ';' before identifier 'PVOID64' InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C2146 syntax error: missing ';' before identifier 'PVOID64' InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C2146 syntax error: missing ';' before identifier 'PVOID64' InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C2146 syntax error: missing ';' before identifier 'PVOID64' InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515
Error (active) E0065 expected a ';' InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 426
Error C3615 constexpr function 'hooks::VirtualFunction' cannot result in a constant expression InternalDirectX8 C:\Users\djongalonga\source\repos\InternalDirectX8\src\hooks.h 10
Error C3615 constexpr function 'hooks::VirtualFunction' cannot result in a constant expression InternalDirectX8 C:\Users\djongalonga\source\repos\InternalDirectX8\src\hooks.h 10
Error C2065 'WindowProcess': undeclared identifier InternalDirectX8 C:\Users\djongalonga\source\repos\InternalDirectX8\src\gui.cpp 159
Error C3646 'Buffer': unknown override specifier InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515
Error C3646 'Buffer': unknown override specifier InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515
Error C3646 'Buffer': unknown override specifier InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515
Error C3646 'Buffer': unknown override specifier InternalDirectX8 C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winnt.h 14515

darkmathew commented 9 months ago

An update here!!

I made some changes to "winnt.h"

Line: typedef void *POINTER_64 PVOID64;

Fix it to: typedef void *POINTER_64, *PVOID64;

Now I can compile the application perfectly. But, I still have an impasse...

When I inject the dll containing the imgui application into the game, the window cannot be rendered, as the Directx8 CreateDevice is not able to do the work it should do.

I'm seeing what I can do to resolve this.

Meigyoku-Thmn commented 9 months ago

I re-cloned the repo on my computer and it can be built just fine, you don't have to install imgui, it will be automatically installed according to the vcpkg.json. You don't even have to setup DirectX8 SDK because the repo already has it.

My setup:

devenv_CcQ9huxmvx

Must be something particular on your own code.

darkmathew commented 9 months ago

Yes, your default project compiles perfectly now. At the moment I'm doing an internal implementation, in this case a DLL to inject into a game process and hook into the process' directx. Now I believe that the problems that arise I will have to deal with. Thank you very much for your availability, good work, because of your project I have not given up hope of trying to compile a project with DirectX 8 these days.

I'll close the issue, everything is ok with your project!

Thank you very much!