Open mrortach opened 1 week ago
Hi @mrortach As you are using Visual Studio, I wonder whether you need to set up linkages to realsense2.dll. If the full RealSense SDK has been installed on Windows using the Intel.RealSense.SDK-WIN10 installer file then the SDK provides three .props property sheet files for doing this. They can be found at C: > Program Files (x86) > Intel RealSense SDK 2.0
Once the SDK is installed and you can access the three props files in the SDK folder, the link below has a C++ Visual Studio tutorial shared by a RealSense user for creating a starter project using the props files.
https://github.com/EduardoWang/visual-studio-real-sense-record-and-playback-project
I tried to compile pyrealsense2 version 2.54.2.5684 for Python 3.12 using the method you suggested, but it didn't work.
As the errors reference GL, I wonder whether they are occurring because -DBUILD_GRAPHICAL_EXAMPLES=TRUE is not included in your CMake build instruction. When building librealsense from source, this instruction is required in order to build the SDK with OpenGL graphics support included.
When setting -DBUILD_GRAPHICAL EXAMPLES to True, -DBUILD_EXAMPLES must also be true. So adding these two flags to your CMake build instruction would make it look like this:
cmake .. -DFORCE_RSUSB_BACKEND=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_BINDINGS=bool:true -DPYTHON_EXECUTABLE="C:/***/AppData/Local/Programs/Python/Python312/python.exe" -DBUILD_EXAMPLES=TRUE -DBUILD_GRAPHICAL_EXAMPLES=TRUE
Another approach to installation may be to install the 2.54.2 SDK without pyrealsense2 by using the Intel.RealSense.SDK-WIN10 installer file and de-selecting the Python wrapper component on the installer's configurartion options so that the Python 3.7 version of the wrapper is not installed.
https://github.com/IntelRealSense/librealsense/releases/tag/v2.54.2
Then once the 2.54.2 SDK is installed, build the Python wrapper separately from source code for Python 3.12.
I partially did it yesterday, but today I couldn't get it done.
What errors do you get when building the Python wrapper on Windows separately after the SDK is installed, please?
Hi @mrortach Do you require further assistance with this case, please? Thanks!
I still need help, I haven't tried the last shared things. I'll look as soon as I have time.
Okay, that's no problem at all. Thanks very much for the update. I look forward to your next report. Good luck!
Body: I'm trying to build pyrealsense2 from source on Windows using Visual Studio 2022. I followed the instructions provided in the Intel RealSense GitHub repository.
Here are the steps I took:
git clone https://github.com/IntelRealSense/librealsense.git cd librealsense git checkout v2.54.2
mkdir build cd build
cmake .. -DFORCE_RSUSB_BACKEND=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_BINDINGS=bool:true -DPYTHON_EXECUTABLE="C:/***/AppData/Local/Programs/Python/Python312/python.exe"
However, I'm encountering the following errors:
LNK1181: cannot open input file 'realsense2-gl.lib' LNK4199: /DELAYLOAD:realsense2d.dll ignored; no imports found from realsense2d.dll LNK4199: /DELAYLOAD:realsense2-gl.dll ignored; no imports found from realsense2-gl.dll LNK4199: /DELAYLOAD:realsense2.dll ignored; no imports found from realsense2.dll
Here is a screenshot of the error list in Visual Studio:
I have confirmed that realsense2.dll and realsense2-gl.dll are present in the C:\Windows\System32\librealsense\build\Release directory.
Additional Configuration: In Configuration Properties > Linker > General > Additional Library Directories, I have added:
C:\Windows\System32\librealsense\build C:\Windows\System32\librealsense\build\Release
In Configuration Properties > Linker > Input > Additional Dependencies, I have added:
realsense2.lib realsense2-gl.lib
Despite this, the build fails with the errors mentioned above. How can I resolve this issue and successfully build pyrealsense2?
System Information: OS: Windows 11 Visual Studio 2022 Python 3.12 Any help or suggestions would be greatly appreciated. Thank you!