Coder Social home page Coder Social logo

build issue on windows about py-k4a HOT 9 CLOSED

amy-caali avatar amy-caali commented on August 19, 2024
build issue on windows

from py-k4a.

Comments (9)

amy-caali avatar amy-caali commented on August 19, 2024

The fix here was moving some files (include folders and .lib files) around from my kinect install (Azure Kinect SDK v1.2.0) to my Python37 directories (include and lib folders)!

Now, I have this error:

Creating library build\temp.win-amd64-3.7\Release\k4a.cp37-win_amd64.lib and object build\temp.win-amd64-3.7\Release\k4a.cp37-win_amd64.exp
capture.obj : error LNK2001: unresolved external symbol __imp_k4a_capture_get_depth_image
capture.obj : error LNK2001: unresolved external symbol __imp_k4a_image_get_buffer
capture.obj : error LNK2001: unresolved external symbol __imp_k4a_image_get_stride_bytes
capture.obj : error LNK2001: unresolved external symbol __imp_k4a_image_get_size
capture.obj : error LNK2001: unresolved external symbol __imp_k4a_device_get_capture
capture.obj : error LNK2001: unresolved external symbol __imp_k4a_capture_get_color_image
capture.obj : error LNK2001: unresolved external symbol __imp_k4a_image_get_height_pixels
capture.obj : error LNK2001: unresolved external symbol __imp_k4a_image_get_width_pixels
device.obj : error LNK2001: unresolved external symbol __imp_k4a_device_get_version
device.obj : error LNK2001: unresolved external symbol __imp_k4a_device_stop_cameras
device.obj : error LNK2001: unresolved external symbol __imp_k4a_device_open
device.obj : error LNK2001: unresolved external symbol __imp_k4a_device_get_serialnum
device.obj : error LNK2001: unresolved external symbol __imp_k4a_device_get_installed_count
device.obj : error LNK2001: unresolved external symbol __imp_k4a_device_close
device.obj : error LNK2001: unresolved external symbol __imp_k4a_device_start_cameras
types.obj : error LNK2001: unresolved external symbol __imp_k4a_image_release
types.obj : error LNK2001: unresolved external symbol __imp_k4a_capture_release
build\lib.win-amd64-3.7\k4a.cp37-win_amd64.pyd : fatal error LNK1120: 17 unresolved externals
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe' failed with exit status 1120

from py-k4a.

amy-caali avatar amy-caali commented on August 19, 2024

Still stuck on this -- I can see I've got some issue pointing files to the right files (although I cannot find anywhere where these functions are actually defined in the Kinect sdk, only declared in k4a.h) and have been editing my Path and PYTHONPATH and copying files into different locations to try and resolve, but no luck. Based on my errors earlier and the requirements in the k4a.h file, I think I may not have my .dll files in the right location or linked correctly. Any ideas/advice?! Thank you!

from py-k4a.

amy-caali avatar amy-caali commented on August 19, 2024

Do I need to re-compile the SDK from scratch on my computer? Or is having it installed (and able to run k4aviewer) enough?

from py-k4a.

brendandburns avatar brendandburns commented on August 19, 2024

Sorry, I only tried this on Linux, so I'm not sure about linking on Windows.

You're definitely having linker errors which means that for some reason the linker can't find the .dll for the Kinect for Azure library...

I have to admit, I don't know very much about how to build things on Windows. I'll see what I can do but I can't promise anything. Apologies!

from py-k4a.

amy-caali avatar amy-caali commented on August 19, 2024

I think I solved it! For what it's worth I was facing two issues: 1) I needed quotes in my LINK environmental variable (oof!) and 2) I was pointing to the wrong k4a.dll; needed the one in the "release" folder. I will try to write up more in detail what I did to compile on Windows and post here soon; just wanted to let you know I got it compiled. (I did not need to recompile the full c-build on my machine, just point to the correct files in my already installed SDK.)

from py-k4a.

amy-caali avatar amy-caali commented on August 19, 2024

Here's a rough outline of the process I used to set up on two different windows machines:

-- had Python 3.7 installed and working
-- had Azure Kinect Sensor SDK installed (with Microsoft Installer), k4aviewer.exe works
-- had VS2019 with C++ desktop development tools, C++/CLI, and most recent Windows 10 SDK installed
-- environmental variables CMAKE_C_COMPILER pointing to cl.exe inside VS2019
-- environmental variable LINK pointing to k4a.lib, with quotes! (because t he defaultAzure SDK folder name has spaces in it)
-- added sdk\include to user Path
-- added Python DLLs folder to user Path
-- copied k4a folder of sdk to Python include folder
-- copied k4a.dll and k4a.pyd to Python DLLs folder
-- copied k4a.lib to Python lib folder

python setup.py build
python setup.py install

The details were different on both computers, but hopefully this helps anyone else trying to install!

from py-k4a.

brendandburns avatar brendandburns commented on August 19, 2024

Cool, glad you got it working. I'd love a Pull Request (PR) for a Markdown file describing how to do this.

It's easier for someone to find the docs that way rather than looking at the issues.

Thanks!

from py-k4a.

abbott1234 avatar abbott1234 commented on August 19, 2024

For the file named k4a.pyd which I did found in my sdk folder. And the copied files most of they have more then one in sdk folder
And the error same as the last error you meet. I have tried add quotes and k4a.dll is the one in release folder

from py-k4a.

abbott1234 avatar abbott1234 commented on August 19, 2024

The above error is solved, but when am running example.py, it request k4a module. I did not found k4a.pyd in the sdk folder either. Did 1.3sdk delete this file?

from py-k4a.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.