# Warns &amp; errors building glfw.dll wit

**URL:** <https://discourse.glfw.org/t/warns-amp-errors-building-glfw-dll-wit/233>\
**Category:** support\
**Created:** [April 30, 2012, 2:27am UTC](https://discourse.glfw.org/t/warns-amp-errors-building-glfw-dll-wit/233 "2012-04-30T02:27:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [April 30, 2012, 2:27am UTC](https://discourse.glfw.org/t/warns-amp-errors-building-glfw-dll-wit/233/1 "2012-04-30T02:27:30Z")

</div>

**anonymous** wrote on [Monday, April 30, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/d6b73a2f/#6be2):

Note - I just posted this as an issue in the bug tracker but just cross-  
posting here in case any forum users have fought this fight before me… onward:

This is on a fairly fresh vanilla Win7 64-bit installation with the latest  
mingw64, in a clean (freshly extracted) GLFW 2.7.5 source directory calling  
make win32-msys.

BUILDING LIBS

1. Warning at gcc -c -I. -I… -Wall -mwin32 -O2 -o win32\_init.o  
win32\_init.c:  
win32\_init.c: In function ‘\_glfwPlatformTerminate’:  
win32\_init.c:353:27: warning: cast to pointer from integer of different size

2. Warning at gcc -c -I. -I… -Wall -mwin32 -O2 -mdll -DGLFW\_BUILD\_DLL  
-D\_GLFW\_NO\_DLOAD\_GDI32 -D\_GLFW\_NO\_DLOAD\_WINMM -o win32\_init\_dll.o  
win32\_init.c:  
win32\_init.c: In function ‘\_glfwPlatformTerminate’:  
win32\_init.c:353:27: warning: cast to pointer from integer of different size

But the relevant output files do get created in .\lib\win32: glfw.dll  
libglfwdll.a and libglfw.a. However I worry those might be corrupted, since  
it’s impossible for me to link to them via gcc later on - if interested, see  
\<[http://stackoverflow.com/questions/10369513/dll-linking-via-windows-cgo-gcc-](http://stackoverflow.com/questions/10369513/dll-linking-via-windows-cgo-gcc-)  
ld-gives-undefined-reference-to-function-e\> for all my troubles with this. 🙂

\*\* BUILDING EXAMPLES

3. Warning at triangle.exe, pong3d.exe, splitview.exe, mipmaps.exe,  
gears.exe, boing.exe, wave.exe, heightmap.exe:  
c:/mingw64/bin/…/lib/gcc/x86\_64-w64-mingw32/4.6.1/…/…/…/…/x86\_64-w64-mi  
ngw32/bin/ld.exe: warning: cannot find entry symbol \_mainCRTStartup;  
defaulting to 0000000000401000

Not so for listmodes.exe, mthello.exe, mtbench.exe and particles.exe. Indeed  
those 4 are the only ones running properly here afterwards, the others just  
exit immediately without outputs or errors (naturally, since there is no  
entry point for them).

BUILDING TESTS

4. Warning at accuracy.exe, dynamic.exe:  
c:/mingw64/bin/…/lib/gcc/x86\_64-w64-mingw32/4.6.1/…/…/…/…/x86\_64-w64-mi  
ngw32/bin/ld.exe: warning: cannot find entry symbol \_mainCRTStartup;  
defaulting to 0000000000401000

No such problem for defaults.exe. For dynamic.exe it then proceeds with the  
following errors:

C:\Users\roxor\AppData\Local\Temp\cc8hsorn.o:dynamic.c:(.text.startup+0x1c):  
undefined reference to `\_\_imp\_glfwGetVersion’  
C:\Users\roxor\AppData\Local\Temp\cc8hsorn.o:dynamic.c:(.text.startup+0x62):  
undefined reference to `\_\_imp\_glfwInit’  
C:\Users\roxor\AppData\Local\Temp\cc8hsorn.o:dynamic.c:(.text.startup+0xcf):  
undefined reference to `\_\_imp\_glfwOpenWindow’  
C:\Users\roxor\AppData\Local\Temp\cc8hsorn.o:dynamic.c:(.text.startup+0x10b)  
: undefined reference to `\_\_imp\_glfwSetWindowTitle’  
C:\Users\roxor\AppData\Local\Temp\cc8hsorn.o:dynamic.c:(.text.startup+0x118)  
: undefined reference to `\_\_imp\_glfwSetWindowSizeCallback’  
C:\Users\roxor\AppData\Local\Temp\cc8hsorn.o:dynamic.c:(.text.startup+0x123)  
: undefined reference to `\_\_imp\_glfwSwapInterval’  
C:\Users\roxor\AppData\Local\Temp\cc8hsorn.o:dynamic.c:(.text.startup+0x14a)  
: undefined reference to `\_\_imp\_glfwGetWindowParam’  
C:\Users\roxor\AppData\Local\Temp\cc8hsorn.o:dynamic.c:(.text.startup+0x151)  
: undefined reference to `\_\_imp\_glfwSwapBuffers’  
C:\Users\roxor\AppData\Local\Temp\cc8hsorn.o:dynamic.c:(.text.startup+0x174)  
: undefined reference to `\_\_imp\_glfwTerminate’  
collect2: ld returned 1 exit status  
make: \*\*\* Error 1  
make: Leaving directory `/c/glfw64/tests’  
make: \*\*\* Error 2

Now this is the test for a program loading the dynamic link library. You might  
think that’s simply missing the necessary libs (.a and .dll) in the correct  
places, but do note at this very point I DID have all the necessary includes  
and libs (from an earlier GLFW make that was \*exactly\* the same as the  
above, same versions, same warnings, same output files) in the correct  
places:

- libglfwdll.a in \MinGW64\x86\_64-w64-mingw32\lib (next to libglu32.a,  
libopengl32.a)  
- glfw.h in \MinGW64\x86\_64-w64-mingw32\include\GL (next to gl.h, glaux.h,  
glu.h)  
- glfw.dll in \windows and \windows\system32 (next to opengl32.dll,  
glu32.dll)\*\*

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 31, 2012, 11:45am UTC](https://discourse.glfw.org/t/warns-amp-errors-building-glfw-dll-wit/233/2 "2012-05-31T11:45:00Z")

</div>

**anonymous** wrote on [Thursday, May 31, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/d6b73a2f/#d308):

Not sure if anyone will ever care to prepare GLFW for 64-bit Windows - after  
all it’s been only more than half a decade since 64-bit machines and OSes  
gained widespread use - but for all of the above, there have been a few  
helpful comments at Stackoverflow:

\<[http://stackoverflow.com/questions/10377930/building-glfw-with-mingw64-gcc-](http://stackoverflow.com/questions/10377930/building-glfw-with-mingw64-gcc-)  
entry-symbol-warnings-linker-errors/10805655\>

Point being is, applying those to the source base for future versions of the  
GLFW distribution might make building a 64-bit glfw.dll a lot less painful -  
or even succeed at the first attempt!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 3, 2012, 5:15pm UTC](https://discourse.glfw.org/t/warns-amp-errors-building-glfw-dll-wit/233/3 "2012-07-03T17:15:01Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, July 03, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/d6b73a2f/#cb62):

These issues have been fixed in GLFW 2.7.6, which will be released shortly.
