Algomorph/pyboostcvconverter

Running on Windows?

Closed this issue · 8 comments

I am trying to get this running on Windows 7 x64 with Visual Studio 2013...

Unfortunately, when I run CMake, it says no C++ 11 support. Is C++ 11 necessary? When I integrate the source files in a VS 2013 project, I get the following:
Error 1 error LNK2001: unresolved external symbol pbcvt_ARRAY_API

Is it possible to make it run on Windows, or is this library meant for Linux only?

@koelscha, it should totally be possible to get it to run on windows, as long as you have C++11 support and boost. Just try with the VS 2015 community edition, it's free and has C++11. VS 2017 is out to, might be worth a shot, although might be a bit raw, I've never tried it.

Tried it with VS2015. Same problem.. Maybe Boost for Windows is somehow broken?

Hmm. Perhaps the define requirements for MSVC are different.
I don't have a machine to test on, but could you test by including:
#define pbcvt_ARRAY_API
at the top of pyboostcvconverter.hpp?

(Reference)

I can confirm that this compiles on Windows (x64 build) without any modifications to the source:

  • Visual Studio 2015 Update 3
  • Python 3.6.1
  • Boost 1.65.0
  • OpenCV 3.3.0

I used the following CMakeLists.txt and built a static library to link with multiple modules:

set(LIBRARY_NAME pyboostcvconverter CACHE INTERNAL "Library name")

file(GLOB project_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)

add_library(${LIBRARY_NAME} STATIC ${project_sources} ${CMAKE_CURRENT_SOURCE_DIR}/include/pyboostcvconverter/pyboostcvconverter.hpp)

target_include_directories(${LIBRARY_NAME} PUBLIC
    "${CMAKE_CURRENT_SOURCE_DIR}/include"
    ${Boost_INCLUDE_DIRS}
    ${OpenCV_INCLUDE_DIRS}
    ${PYTHON_INCLUDE_DIRS}
    ${NUMPY_INCLUDE_DIR}
)

target_link_libraries(${LIBRARY_NAME}
    ${Boost_LIBRARIES}
    ${OpenCV_LIBRARIES}
    ${PYTHON_LIBRARIES}
)

@nickdademo , thanks a bunch for testing!

@koelscha, I haven't heard back from you in awhile. I hope everything works now. If this is still a problem, post a message here and I'll reopen the issue.

hello, i am trying this implementation on VS2015, i succesfully compiled everything, python3.6 and boost 1.61.. then the target extension of my project is .pyd i copied to were my python modules are and when i try to import i get Import error: DLL load failed: module not found, does someone has an idea? is there maybe a version without the boost library?

cheers!!

@richipower you can simply eliminate the converter that uses boost from the code of your project, and only keep the manual matrix conversion functions. Then you won't need boost. But it sounds like you don't have boost libraries compiled into DLLs on your system, or perhaps they are not accessible in the environment path.
Again, the code here is meant to be used as a template. You can pull parts of the code and inject them into your project, you don't have to use all of it.