shogun-toolbox / shogun

Shōgun
http://shogun-toolbox.org
BSD 3-Clause "New" or "Revised" License
3.03k stars 1.04k forks source link

dirent.h is missing when installed #4238

Closed vigsterkr closed 6 years ago

vigsterkr commented 6 years ago

it came out in #4231 that we are not shipping the dirent.h just have it when we compile... which makes compilation of dll and static lib successful but compiling against an installed libshogun will not be possible as we dont ship this dirent.h :(

vigsterkr commented 6 years ago

@fyoda actually i've just checked, MSDirent is being installed to shogun/lib/external/MSDirent so there should be no problem with dirent.h.

vigsterkr commented 6 years ago

can you actually paste me a compile command and the corresponding error when you observe problems with dirent.h?

friente commented 6 years ago

@vigsterkr

E:\Software\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release
    cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I..\libs\shogun\include -IE:\Software\Qt\5.9.3\msvc2015_64\include -IE:\Software\Qt\5.9.3\msvc2015_64\include\QtGui -IE:\Software\Qt\5.9.3\msvc2015_64\include\QtANGLE -IE:\Software\Qt\5.9.3\msvc2015_64\include\QtCore -I..\build_release\_moc -IE:\Software\Qt\5.9.3\msvc2015_64\mkspecs\win32-msvc -Fo..\build_release\_obj\ @C:\Users\myUser\AppData\Local\Temp\main.obj.128308.0.jom
main.cpp
..\libs\shogun\include\shogun/lib/any.h(162): warning C4100: 'other': unreferenced formal parameter
..\libs\shogun\include\shogun/io/SGIO.h(16): fatal error C1083: Cannot open include file: 'dirent.h': No such file or directory
jom: C:\Users\myUser\Desktop\shoguntest\src\Makefile.Release [..\build_release\_obj\main.obj] Error 2
jom: C:\Users\myUser\Desktop\shoguntest\src\Makefile [release] Error 2
vigsterkr commented 6 years ago

@fyoda ok so based on this i dont see any of the compiler flags that are being exported to ShogunTarget.cmake. how do you add shogun to your project?

friente commented 6 years ago

@vigsterkr I simply add the shogun's include path to my project, then link the .dll against the main.cpp.

vigsterkr commented 6 years ago

@fyoda yeah unfortunately that's not enough :) you use qmake? in case of cmake i could tell you how to use shogun, but i'm not so sure yet how to that with Qt build framework

friente commented 6 years ago

I'm sorry @vigsterkr :), yes I use qmake. I'll send you more information when I go back to my PC.

friente commented 6 years ago

@vigsterkr I think that the problem is that there is no path specified when dirent.h is included. Indeed if I add #include <shogun/lib/external/MSDirent/dirent.h>

instead of #include <dirent.h>

It works

vigsterkr commented 6 years ago

@fyoda yes that's the problem,... but that's actually specified in the target cmake, i.e. ShogunTarget.cmake if you'd include shogun like that into your project.

friente commented 6 years ago

@vigsterkr I understand the point but I don't know how to include the generated ShogunTarget.cmake in my Qt project. Maybe I can just add the following include paths:

set_target_properties(shogun::shogun-static PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/shogun;${_IMPORT_PREFIX}/include/shogun/lib/external/MSDirent;${_IMPORT_PREFIX}/include/shogun/lib/external/eigen;${_IMPORT_PREFIX}/include/shogun/lib/external/rxcpp;${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "winmm.lib"
  INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "include/shogun/lib/external/eigen;include/shogun/lib/external/rxcpp"
)

specified in ShogunTarget.cmake

friente commented 6 years ago

@vigsterkr Adding those paths to my .pro file solve the issue.

vigsterkr commented 6 years ago

@fyoda yes that was the idea..... thxn!