Pelles C forum

Pelles C => General discussions => Topic started by: player55 on June 13, 2013, 04:51:39 PM

Title: Cannot use GLFW library
Post by: player55 on June 13, 2013, 04:51:39 PM
I'm trying to get the GLFW library to work with Pelles C. I downloaded the precompiled Visual Studio binaries and included all the right libraries. First, POLINK told me it can't find 'msvcrt.lib', so I copied it from the Visual Studio lib folder into my own. Then I got this error:


POLINK: error: Symbol 'free' is multiply defined: 'crt64.lib(free.obj)' and 'msvcrt.lib(MSVCR110.dll)'.
POLINK: error: Symbol 'malloc' is multiply defined: 'crt64.lib(malloc.obj)' and 'msvcrt.lib(MSVCR110.dll)'.


I then turned on "Omit default library name in object files" to remove the conflict. However, I then got another list of errors:


POLINK: error: Unresolved external symbol '__stderr'.
POLINK: error: Unresolved external symbol '__negmaskf'.
POLINK: fatal error: 2 unresolved external(s).


Any suggestions?
Title: Re: Cannot use GLFW library
Post by: TimoVJL on June 13, 2013, 06:07:36 PM
;glfw3dll.def
LIBRARY glfw3.dll
EXPORTS
"glfwCreateWindow"
"glfwDefaultWindowHints"
"glfwDestroyWindow"
"glfwExtensionSupported"
"glfwGetClipboardString"
"glfwGetCurrentContext"
"glfwGetCursorPos"
"glfwGetFramebufferSize"
"glfwGetGammaRamp"
"glfwGetInputMode"
"glfwGetJoystickAxes"
"glfwGetJoystickButtons"
"glfwGetJoystickName"
"glfwGetKey"
"glfwGetMonitorName"
"glfwGetMonitorPhysicalSize"
"glfwGetMonitorPos"
"glfwGetMonitors"
"glfwGetMouseButton"
"glfwGetPrimaryMonitor"
"glfwGetProcAddress"
"glfwGetTime"
"glfwGetVersion"
"glfwGetVersionString"
"glfwGetVideoMode"
"glfwGetVideoModes"
"glfwGetWGLContext"
"glfwGetWin32Window"
"glfwGetWindowAttrib"
"glfwGetWindowMonitor"
"glfwGetWindowPos"
"glfwGetWindowSize"
"glfwGetWindowUserPointer"
"glfwHideWindow"
"glfwIconifyWindow"
"glfwInit"
"glfwJoystickPresent"
"glfwMakeContextCurrent"
"glfwPollEvents"
"glfwRestoreWindow"
"glfwSetCharCallback"
"glfwSetClipboardString"
"glfwSetCursorEnterCallback"
"glfwSetCursorPos"
"glfwSetCursorPosCallback"
"glfwSetErrorCallback"
"glfwSetFramebufferSizeCallback"
"glfwSetGamma"
"glfwSetGammaRamp"
"glfwSetInputMode"
"glfwSetKeyCallback"
"glfwSetMonitorCallback"
"glfwSetMouseButtonCallback"
"glfwSetScrollCallback"
"glfwSetTime"
"glfwSetWindowCloseCallback"
"glfwSetWindowFocusCallback"
"glfwSetWindowIconifyCallback"
"glfwSetWindowPos"
"glfwSetWindowPosCallback"
"glfwSetWindowRefreshCallback"
"glfwSetWindowShouldClose"
"glfwSetWindowSize"
"glfwSetWindowSizeCallback"
"glfwSetWindowTitle"
"glfwSetWindowUserPointer"
"glfwShowWindow"
"glfwSwapBuffers"
"glfwSwapInterval"
"glfwTerminate"
"glfwWaitEvents"
"glfwWindowHint"
"glfwWindowShouldClose"
EDIT:
polib.exe /DEF:glfw3dll.def /OUT:glfw3dll.lib /MACHINE:AMD64
Title: Re: Cannot use GLFW library
Post by: player55 on June 13, 2013, 07:33:37 PM
Got it to work using:

polib /def:glfw3.def glfw3.lib /machine:amd64

Did you use dumpbin to create that .def file?

The resulting lib is surprisingly smaller than the VS one. Any idea why that is?

Thanks
Title: Re: Cannot use GLFW library
Post by: TimoVJL on June 13, 2013, 08:13:34 PM
Quote from: player55 on June 13, 2013, 07:33:37 PM
Did you use dumpbin to create that .def file?
no, i use this: http://forum.pellesc.de/index.php?topic=3700.msg13749#msg13749
Title: Re: Cannot use GLFW library
Post by: player55 on June 13, 2013, 08:40:40 PM
Ah, that's a helpful add-in, thanks.

I wanted a truly static library though and I managed to build GLFW 3.0 in Pelles C for anyone who needs it (attached).