wjakob / nanogui

Minimalistic GUI library for OpenGL
Other
4.66k stars 608 forks source link

Issues building nanogui on Windows #120

Closed jonathanbernal closed 8 years ago

jonathanbernal commented 8 years ago

I ran CMake and then built the project that CMake generated with Visual Studio 2015. When running the project, I came across a linking error. I downloaded the source recursively and as submodules, but nothing worked. Any ideas on how I could solve this issue? Below is the build log from Visual Studio 2015.

1>------ Build started: Project: nanogui, Configuration: Debug x64 ------
1>  '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild'
1>  CMD.EXE was started with the above path as the current directory.
1>  UNC paths are not supported.  Defaulting to Windows directory.
1>  Running bin2c
1>  nanogui_resources.cpp
1>  theme.cpp
1>c1xx : fatal error C1083: Cannot open source file: '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\nanogui_resources.cpp': No such file or directory
1>\\buffalo.cs.fiu.edu\homes\Desktop\libraries\nanogui\lib\nanogui\src\theme.cpp(16): fatal error C1083: Cannot open include file: 'nanogui_resources.h': No such file or directory
2>------ Build started: Project: example1, Configuration: Debug x64 ------
3>------ Build started: Project: example2, Configuration: Debug x64 ------
4>------ Build started: Project: example3, Configuration: Debug x64 ------
5>------ Build started: Project: nanogui_python, Configuration: Debug x64 ------
3>  '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild'
3>  CMD.EXE was started with the above path as the current directory.
3>  UNC paths are not supported.  Defaulting to Windows directory.
3>  Building Custom Rule //buffalo.cs.fiu.edu/homes/Desktop/libraries/nanogui/lib/nanogui/CMakeLists.txt
2>  '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild'
2>  CMD.EXE was started with the above path as the current directory.
2>  UNC paths are not supported.  Defaulting to Windows directory.
2>  Building Custom Rule //buffalo.cs.fiu.edu/homes/Desktop/libraries/nanogui/lib/nanogui/CMakeLists.txt
2>  CMake does not need to re-run because \\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\CMakeFiles\generate.stamp is up-to-date.
5>  '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild'
4>  '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild'
4>  CMD.EXE was started with the above path as the current directory.
5>  CMD.EXE was started with the above path as the current directory.
5>  UNC paths are not supported.  Defaulting to Windows directory.
4>  UNC paths are not supported.  Defaulting to Windows directory.
5>  Building Custom Rule //buffalo.cs.fiu.edu/homes/Desktop/libraries/nanogui/lib/nanogui/CMakeLists.txt
4>  Building Custom Rule //buffalo.cs.fiu.edu/homes/Desktop/libraries/nanogui/lib/nanogui/CMakeLists.txt
2>  example1.cpp
5>  CMake does not need to re-run because \\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\CMakeFiles\generate.stamp is up-to-date.
5>  python.cpp
4>  CMake does not need to re-run because \\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\CMakeFiles\generate.stamp is up-to-date.
4>  example3.cpp
3>  CMake does not need to re-run because \\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\CMakeFiles\generate.stamp is up-to-date.
3>  example2.cpp
2>LINK : fatal error LNK1104: cannot open file '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\Debug\nanogui.lib'
4>LINK : fatal error LNK1104: cannot open file '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\Debug\nanogui.lib'
3>LINK : fatal error LNK1104: cannot open file '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\Debug\nanogui.lib'
5>LINK : fatal error LNK1104: cannot open file '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\Debug\nanogui.lib'
6>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
6>  '\\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild'
6>  CMD.EXE was started with the above path as the current directory.
6>  UNC paths are not supported.  Defaulting to Windows directory.
6>  Building Custom Rule //buffalo.cs.fiu.edu/homes/Desktop/libraries/nanogui/lib/nanogui/CMakeLists.txt
6>  CMake does not need to re-run because \\buffalo.cs.fiu.edu\homes\Desktop\NanoguiBuild\CMakeFiles\generate.stamp is up-to-date.
========== Build: 1 succeeded, 5 failed, 4 up-to-date, 0 skipped ==========
wjakob commented 8 years ago

easy: building from a network drive is likely the cause of the error. Just use a normal disk drive.

jonathanbernal commented 8 years ago

Thank you for your input. Now I'm running into another issue. I added the additional includes to my VS 2015 project and for linking I added nanogui.lib. I don't know if I'm missing something.

1>------ Build started: Project: Nanogui-test, Configuration: Debug x64 ------ 1> main.cpp 1>c:\libraries\nanogui\nanogui\include\nanogui\common.h(14): fatal error C1083: Cannot open include file: 'Eigen/Core': No such file or directory ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

jonathanbernal commented 8 years ago

I figured out what the issue was. All I needed was to specify the include directories for the dependencies stored in the /ext folder. However, I am getting the following error now. Am I missing any other dependencies that may not have been included in nanogui?

1>------ Build started: Project: Nanogui-test, Configuration: Debug x64 ------ 1> main.cpp 1>c:\libraries\nanogui\nanogui\include\nanogui\glutil.h(32): error C2065: 'GL_HALF_FLOAT': undeclared identifier ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

ndrshn commented 7 years ago

@thinkeneering I'm just getting same error as you.

wjakob commented 7 years ago

I pushed a fix -- does it work with that?

ndrshn commented 7 years ago

@wjakob now it gives an error as in the ss http://i.hizliresim.com/mEOMz8.png

wjakob commented 7 years ago

That's strange -- these are all standard OpenGL functions. The build works fine with AppVeyor on Visual Studio 2015, so I suspect that something is differerent about your setup. (incompatible VS version/ not updated to latest patch level / Git repository not checked out correctly)

wjakob commented 7 years ago

Actually, my bad -- why don't you try again? There was an issue with symbols on windows.

ndrshn commented 7 years ago

dear @wjakob ,

Thanks for your help. I'm gonna try it again to night at home. After your fix and error in my last entry, I tried different things and I stopped at last step. Now it gives "cinder-v140.lib" error. There is no cinder-v140.lib file in libs folder.

In adition, I build my test codes with openframeworks library. It worked fine but I wanna use nanogui because it looks better then library I used in openframeworks.

Again thanks for your help.

Regards, Onder

jonathanbernal commented 7 years ago

@ndrshn Were you able to solve your issue? If not, I think the problem you're getting is that you're forgetting to include some of the dependencies in the /ext folder. You must include them all in your Visual Studio project. Additionally, make sure your installation path for nanogui is in your local drive, not on a network drive.

If you're missing GL_HALF_FLOAT, all you need to do is edit glutil.h. You'll notice there are several constants defined as GL... Each declaration for memory addresses is 4 bytes apart. So, if the address of the last declared constant is 0x04, for instance, you can declare GL_HALF_FLOAT as

#define GL_HALF_FLOAT 0x08.

ndrshn commented 7 years ago

@thinkeneering Thanks for your help. I solved issue with github.