ProjectPhysX / FluidX3D

The fastest and most memory efficient lattice Boltzmann CFD software, running on all GPUs via OpenCL. Free for non-commercial use.
https://youtube.com/@ProjectPhysX
Other
3.77k stars 300 forks source link

Getting "fatal error C1083" on compilation #85

Closed ksio89 closed 1 year ago

ksio89 commented 1 year ago

I installed Visual Studio 2022 Community edition, selecting only "Desktop development with C++" workload, and then followed the instructions. However, during compilation, the console throws several "fatal C1083 error" messages:

Build started... 1>------ Build started: Project: FluidX3D, Configuration: Release x64 ------ 1>D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(513,5): warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found. 1>graphics.cpp 1>info.cpp 1>kernel.cpp 1>lbm.cpp 1>lodepng.cpp 1>main.cpp 1>setup.cpp 1>shapes.cpp 1>D:\ksio89\Downloads\FluidX3D-master\src\lodepng.hpp(31,10): fatal error C1083: Cannot open include file: 'string.h': No such file or directory (compiling source file src\lodepng.cpp) 1>D:\ksio89\Downloads\FluidX3D-master\src\OpenCL\include\CL\cl.hpp(150,10): fatal error C1083: Cannot open include file: 'malloc.h': No such file or directory (compiling source file src\lbm.cpp) 1>D:\ksio89\Downloads\FluidX3D-master\src\OpenCL\include\CL\cl.hpp(150,10): fatal error C1083: Cannot open include file: 'malloc.h': No such file or directory (compiling source file src\setup.cpp) 1>D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\yvals.h(17,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory (compiling source file src\kernel.cpp) 1>D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\yvals.h(17,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory (compiling source file src\shapes.cpp) 1>D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\yvals.h(17,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory (compiling source file src\info.cpp) 1>D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\yvals.h(17,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory (compiling source file src\graphics.cpp) 1>D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\yvals.h(17,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory (compiling source file src\main.cpp) 1>Done building project "FluidX3D.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Build started at 9:08 PM and took 05,268 seconds ==========

Is some package or workload missing? I don't have familiarity with an advanced IDE like MVS, so I have no idea what's missing.

ProjectPhysX commented 1 year ago

Hu @ksio89,

thanks for posting this. Download the Windows 10 SDK within the Visual Studio Installer, that should solve it. The software needs the <Windows.h> library for interactive graphics. I'll add this to the documentation!

Kind regards, Moritz

ksio89 commented 1 year ago

Thanks, that did the trick, thanks. However, I'm now getting these errors after uncommenting the relevant lines in setup.cpp and defines.hpp:

Build started... 1>------ Build started: Project: FluidX3D, Configuration: Release x64 ------ 1>graphics.cpp 1>D:\ksio89\Downloads\FluidX3D-master\src\graphics.cpp(698,6): error C2084: function 'void update_frame(const double)' already has a body 1>D:\ksio89\Downloads\FluidX3D-master\src\graphics.cpp(468,6): message : see previous definition of 'update_frame' 1>D:\ksio89\Downloads\FluidX3D-master\src\graphics.cpp(726,5): error C2084: function 'int main(int,char *[])' already has a body 1>D:\ksio89\Downloads\FluidX3D-master\src\graphics.cpp(496,5): message : see previous definition of 'main' 1>D:\ksio89\Downloads\FluidX3D-master\src\graphics.cpp(741,3): error C2065: 'update_frame': undeclared identifier 1>Done building project "FluidX3D.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Build started at 2:02 PM and took 02,094 seconds ==========

ksio89 commented 1 year ago

Nevermind again, the errors were caused because I missed the installation of MSVC v142, after installing the package the setup is compiling correctly.