schwittlick / ofxDarknet

darknet neural network addon for openFrameworks
MIT License
496 stars 89 forks source link

cannot open source file "activations.h" on Windows #22

Closed AndreasRef closed 7 years ago

AndreasRef commented 7 years ago

Hi

I'm attempting to build some of the examples on Windows (Win 10 using Visual Studio 2015).

With all the examples I am running in to the same issue, where I get tons of errors stating that Visual Studio cannot open a lot of .h files from ofxDarknet.h.

skaermbillede 12

I have it running just fine on Mac and am not very experienced using openFrameworks in Visual Studio, so maybe I'm just doing a simple thing wrong?

First i build the project using the project generator. Inside Visual Studio I have it set to x64 mode, have ticked CUDA 8.0, set the C/C++ compile settings to default and copied the pthreadVC2.dll to the applications bin folder.

Am I missing something?

genekogan commented 7 years ago

not sure how to do this inside visual studio but it sounds like the folder with all those headers is not in the header search path (maybe also it's a problem with relative folder paths).

AndreasRef commented 7 years ago

Okay, might be. Any ideas how to solve this? @mrzl (or other people on Windows)?

gurmeetsidhu commented 7 years ago

okay so when I got these if you see how it is referencing it. Mine was saying something like "......\addons\ofxDarknet\libs\darknet\include\" just move your directories to match that folder layout so I put my example like so:

C:\Users\Baltej\Documents\of_v0.9.8_vs_release\examples\ofxDarknet

and then addons which are the source files that are being requested in your MSVS in:

C:\Users\Baltej\Documents\of_v0.9.8_vs_release\addons\ofxDarknet\libs\darknet\include:

AndreasRef commented 7 years ago

Hi @gurmeetsidhu Thanks for replying!

Not sure I understand you correctly? I need to copy the examples from the ofxDarknet addon to a new folder inside examples, like so: of_v0.9.8_vs_release\examples\ofxDarknet\yolo-2

And they still keep the addon in \addons\?

And no extra settings inside Visual Studio?

Best Andreas

gurmeetsidhu commented 7 years ago

Yes, not sure if this is the way to do it but it works I guess ... So I have the examples from ofxdarknet in this format

image

and the addons:

image

I really had no clue how to install this but if you have any unresolved symbols or any missing includes just add the right dependencies, took me about 20 mins to get everything linked up, barring some weird issues.

AndreasRef commented 7 years ago

Okay, cool thanks 👍! And how precisely do you "add the right dependencies"? I mean, what do you specifically do inside Visual Studio?

gurmeetsidhu commented 7 years ago

Okay so Im very bad at explaining things so just bear with this picture that will show you what to do. Go to your project -> left click -> click properties and then add additional includes here:

image

Here is raw input I put for additional include directories. Bear in mind I decided to clone openframeworks instead of just downloading the latest release so ... there's a lot of includes in here to directories I've had to download myself (don't worry if you downloaded release version you don't have to worry about downloading anything extra). So you probably don't need all of them but yea...

%(AdditionalIncludeDirectories) src src\cfg ......\addons\glew-2.0.0\include ......\addons\glm ......\addons\ofxDarknet\libs ......\addons\ofxDarknet\libs\3rdparty ......\addons\ofxDarknet\libs\3rdparty\dll ......\addons\ofxDarknet\libs\3rdparty\dll\x64 ......\addons\ofxDarknet\libs\3rdparty\dll\x86 ......\addons\ofxDarknet\libs\3rdparty\include ......\addons\ofxDarknet\libs\3rdparty\lib ......\addons\ofxDarknet\libs\3rdparty\lib\vs ......\addons\ofxDarknet\libs\3rdparty\lib\vs\Win32 ......\addons\ofxDarknet\libs\3rdparty\lib\vs\x64 ......\addons\ofxDarknet\libs\cuda ......\addons\ofxDarknet\libs\cuda\include ......\addons\ofxDarknet\libs\cuda\lib ......\addons\ofxDarknet\libs\cuda\lib\vs ......\addons\ofxDarknet\libs\cuda\lib\vs\x64 ......\addons\ofxDarknet\libs\darknet ......\addons\ofxDarknet\libs\darknet\include ......\addons\ofxDarknet\libs\darknet\lib ......\addons\ofxDarknet\libs\darknet\lib\vs ......\addons\ofxDarknet\libs\darknet\lib\vs\x64 ......\addons\ofxDarknet\libs\darknet\lib\vs\x64\Debug ......\addons\ofxDarknet\libs\darknet\lib\vs\x64\Release ......\addons\ofxDarknet\src ......\addons\ofxOpenCv\libs ......\addons\ofxOpenCv\libs\opencv ......\addons\ofxOpenCv\libs\opencv\include ......\addons\ofxOpenCv\libs\opencv\include\opencv ......\addons\ofxOpenCv\libs\opencv\include\opencv2 ......\addons\ofxOpenCv\libs\opencv\include\opencv2\calib3d ......\addons\ofxOpenCv\libs\opencv\include\opencv2\contrib ......\addons\ofxOpenCv\libs\opencv\include\opencv2\core ......\addons\ofxOpenCv\libs\opencv\include\opencv2\features2d ......\addons\ofxOpenCv\libs\opencv\include\opencv2\flann ......\addons\ofxOpenCv\libs\opencv\include\opencv2\gpu ......\addons\ofxOpenCv\libs\opencv\include\opencv2\gpu\device ......\addons\ofxOpenCv\libs\opencv\include\opencv2\gpu\device\detail ......\addons\ofxOpenCv\libs\opencv\include\opencv2\highgui ......\addons\ofxOpenCv\libs\opencv\include\opencv2\imgproc ......\addons\ofxOpenCv\libs\opencv\include\opencv2\legacy ......\addons\ofxOpenCv\libs\opencv\include\opencv2\ml ......\addons\ofxOpenCv\libs\opencv\include\opencv2\nonfree ......\addons\ofxOpenCv\libs\opencv\include\opencv2\objdetect ......\addons\ofxOpenCv\libs\opencv\include\opencv2\photo ......\addons\ofxOpenCv\libs\opencv\include\opencv2\stitching ......\addons\ofxOpenCv\libs\opencv\include\opencv2\stitching\detail ......\addons\ofxOpenCv\libs\opencv\include\opencv2\superres ......\addons\ofxOpenCv\libs\opencv\include\opencv2\ts ......\addons\ofxOpenCv\libs\opencv\include\opencv2\video ......\addons\ofxOpenCv\libs\opencv\include\opencv2\videostab ......\addons\ofxOpenCv\libs\opencv\lib ......\addons\ofxOpenCv\libs\opencv\lib\emscripten ......\addons\ofxOpenCv\libs\opencv\lib\vs ......\addons\ofxOpenCv\libs\opencv\lib\vs\Win32 ......\addons\ofxOpenCv\libs\opencv\lib\vs\Win32\Debug ......\addons\ofxOpenCv\libs\opencv\lib\vs\Win32\Release ......\addons\ofxOpenCv\libs\opencv\lib\vs\x64 ......\addons\ofxOpenCv\libs\opencv\lib\vs\x64\Debug ......\addons\ofxOpenCv\libs\opencv\lib\vs\x64\Release ......\addons\ofxOpenCv\libs\opencv\license ......\addons\ofxOpenCv\src

You should already have done this but in case you haven't add openCV libraries. I also am running cuDNN for another darknet build so ignore that:

image

RAW:

%(AdditionalLibraryDirectories) C:\opencv_2.4.9\opencv\build\x64\vc12\lib \lib\x64

And that's pretty much it sorry for long post

AndreasRef commented 7 years ago

Wow, thanks so much, will try it out!

AndreasRef commented 7 years ago

Hmm, I tried this, but no changes... Still the same errors.

From what I understand, your solution to solving this problem involves moving the files around to make sure that the paths are correct? Is that right?

However, what I don't understand is how that changes anything?

Wether you try to run the example from:

C:\Users\Baltej\Documents\of_v0.9.8_vs_release\examples\ofxDarknet\example-yolo2

or

C:\Users\Baltej\Documents\of_v0.9.8_vs_release\addons\ofxDarknet\example-yolo2

Should make no difference in terms of relative paths like: ..\..\..\addons\ofxDarknet\src\ofxDarknet.cpp

Since they are both on the same "level" relative to of_v0.9.8_vs_release\addons

Or am I missing something?

genekogan commented 7 years ago

@AndreasRef did you go through the steps written in the readme for Windows setup? https://github.com/mrzl/ofxDarknet#windows

AndreasRef commented 7 years ago

@genekogan yes, can't really see what I'm doing wrong...

Bendegreef commented 7 years ago

@AndreasRef I changed every include to the absolute path. Don't know if it's the right way, but it works for the includes. Now I'm stuck at the linking issue.

#include "activations.h" changed to: #include "D:\Openframeworks\addons\ofxDarknet\libs\darknet\include\activations.h"

schwittlick commented 7 years ago

@AndreasRef check this out here: https://github.com/mrzl/ofxDarknet/issues/23