hugoam/kiui

Problems compiling example in MinGW

Opened this issue · 11 comments

Hi, My build was good for the most part but the linking process throws an error. I have successfully pointed the include path and lib (glfw*.a) for GLFW. I'm using MinGW on both glfw and kiui cmake builds

Any ideas?

What's the error message?

Oh yes, here it is: http://pastebin.com/qScAbn1N

I have added libglfw3.a with GLFW_LIBRARIES during CMake configuration and there were no errors.

The __imp_ prefix means that it wants a DLL to be linked, IIRC. It wants the DLL version of GLEW, link that before linking kiui.

Thanks @ChlorideCull The weird thing is the cmake build only produces libkiui.dll.a and no dll. What am I missing?

You need to get the shared MinGW build of GLEW, that would be a dependency. Alternatively, build it yourself.

Thanks, already done that. I'm still having the same errors having tried and linked either glfw3.dll or libglfw3.dll.a

http://pastebin.com/Gp8UdnJG

As you can see, I'm also getting some redeclared errors prior to the linker errors..

Can you dump a complete log?

The problem you are having is with glew, it is unrelated to GLFW.
I believe if you are not linking with a shared library of glew, you have to define GLEW_STATIC before compiling glew.c.
I think default is dllimport if you don't set GLEW_STATIC, which means you have to link with glew library.
Since you are not doing that, just add GLEW_STATIC to your compiler definitions.

@ChlorideCull and @hugoam Thanks, adding GLEW_STATIC define in glew.h solves the library and compile example problem, it is definitely not related to GLFW, but when I tried to run the example exe, I'm now getting this assertion error and it crashes.

kiui

The path for data files is set to "../data" in example_nanovg.cpp
So you should 'install' it in a way that the data repertory is in the parent directory from where the .exe is located.
That means you should copy the data folder inside bin according to your example path, or move the exe up one level, or modify the path in example_nanovg.cpp to "../../data" and rebuild.

@hugoam thanks, but I did all just that and still getting the same error. (move up one level or changing to "../../data" in example_nanovg.cpp)