Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems compiling example in MinGW #35

Open
wini3d opened this issue Feb 7, 2016 · 11 comments
Open

Problems compiling example in MinGW #35

wini3d opened this issue Feb 7, 2016 · 11 comments

Comments

@wini3d
Copy link

wini3d commented Feb 7, 2016

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?

@refi64
Copy link

refi64 commented Feb 7, 2016

What's the error message?

@wini3d
Copy link
Author

wini3d commented Feb 7, 2016

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.

@ChlorideCull
Copy link

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.

@wini3d
Copy link
Author

wini3d commented Feb 11, 2016

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

@ChlorideCull
Copy link

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

@wini3d
Copy link
Author

wini3d commented Feb 13, 2016

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..

@ChlorideCull
Copy link

Can you dump a complete log?

@hugoam
Copy link
Owner

hugoam commented Feb 14, 2016

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.

@wini3d
Copy link
Author

wini3d commented Feb 15, 2016

@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

@wini3d wini3d changed the title Problems linking with GLFW Problems compiling example in MinGW Feb 15, 2016
@hugoam
Copy link
Owner

hugoam commented Feb 16, 2016

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.

@wini3d
Copy link
Author

wini3d commented Feb 17, 2016

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants