axodox / axodox-machinelearning

This repository contains a pure C++ ONNX implementation of multiple offline AI models, such as StableDiffusion (1.5 and XL), ControlNet, Midas, HED and OpenPose.
MIT License
604 stars 34 forks source link

Can't build project, looks like there's at least one unlisted dependency #7

Open by321 opened 1 year ago

by321 commented 1 year ago

Hi, I made sure I have all the dependencies listed in the readme, but I still can't build the project. It looks like there's at least one more dependency that I need to install, but I have no idea what it might be. Build output (see attached file for entire output):

Build started... 1>------ Build started: Project: Axodox.MachineLearning.Desktop, Configuration: Debug x64 ------ 1>pch.cpp 1>C:\github2\axodox-machinelearning\packages\Axodox.Common.1.0.12\include\Graphics\Devices\GraphicsTypes.h(7,38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\github2\axodox-machinelearning\packages\Axodox.Common.1.0.12\include\Graphics\Devices\GraphicsTypes.h(7,25): error C2146: syntax error: missing ';' before identifier 'IDXGIFactoryT' 1>C:\github2\axodox-machinelearning\packages\Axodox.Common.1.0.12\include\Graphics\Devices\GraphicsTypes.h(8,38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\github2\axodox-machinelearning\packages\Axodox.Common.1.0.12\include\Graphics\Devices\GraphicsTypes.h(8,25): error C2146: syntax error: missing ';' before identifier 'IDXGIAdapterT' // more errors follow ...

Looks like for whatever reason, the symbols in GraphicsTypes.h (IDXGIFactory4, IDXGIAdapter3, ID3D11Device5, etc) are undefined. BuildErrors.txt

axodox commented 1 year ago

That is weird, those types should come from the directX part of https://github.com/axodox/axodox-common/blob/main/Axodox.Common.Shared/includes.h

Can you verify that it is included? Also you might need to run the update_dependencies.ps1 to use the latest nuget packages.

alex-aparin commented 1 year ago

I have the same issue. It sounds like solution cannot be built from visual studio application directly. I suppose it's related with usage of axodox.common package, because it defines needed macro for direct3d. (My visual studio showed errors that common's headers cannot be found) But usage build_nuget.ps1 script allowed me to build library. I hope this may help

axodox commented 1 year ago

I have ran update_dependencies.ps1 and committed the results. It will work now.

axodox commented 1 year ago

The issue was that the code was still referencing an older version of axodox-common. On my setup I use env vars to allow simultaneous building of of common, machinelearning and unpaint without regenerating nuget packages or updating any references, while the build script is designed to pull the latest nuget no matter what.

In your case you build straight from Studio, and have not run the update_dependencies.ps1, this resulting in VS trying to build the code with the old version of common, which failed.

axodox commented 1 year ago

You may close the issue, if you see that my latest change resolved it for you.

alex-aparin commented 1 year ago

@axodox Thank you, now it looks better. I have built Desktop/Test project via studio. Unfortunately Universal project outputs error: 1>The build tools for 'v143' application Type Windows Store (Platform Toolset = 'v143') cannot be found. Please install the workflow for this application type and include the build tools for the. It seems like I missed some toolset during setup. I will try to use only desktop version. In the case of success I will return to investigae Universal project later.

axodox commented 1 year ago

@alex-aparin Usually VS would prompt you with a GUI to install when opening the solution. You can just open VS installer and install the "C++ (v143) Universal Windows Platform tools" from individual components tab.