Creating GLFW with MinGW64 gcc - warnings about I / O characters and linker errors

This is a fairly new version of Win7 with a 64-bit version of Win7 with the latest MinGW64 in the clean (recently extracted) GLFW 2.7.5 source directory, which invokes the make win32-msys command . P>

[A] Creating libs

# 1 - Warning about 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 [-Wint-to-pointer-cast]

# 2 - Warning about 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 [-Wint-to-pointer-cast]

But the corresponding output files are created in. \ lib \ win32: glfw.dll, libglfwdll.a and libglfw.a. However, I worry that this could be messed up, since it is impossible for me to contact them through gcc later - the same problem as the last in this post, described below.

[B] Building Examples

# 3 - Warning about triangle.exe, pong3d.exe, splitview.exe, mipmaps.exe, gears.exe, boing.exe, wave.exe, heightmap.exe:

c:/mingw64/x86_64-w64-mingw32/bin/ld.exe: warning: cannot find entry symbol _mainCRTStartup; defaulting to 0000000000401000

Not so, however, for listmodes.exe, mthello.exe, mtbench.exe and particle.exe, which build perfectly. In fact, these 4 are the only ones who work properly here, the rest immediately exit immediately without exits or errors (naturally, since there is no valid entry point for them).

[C] Building tests

  • Warning about .exe file, dynamic.exe:

    c:/mingw64/x86_64-w64-mingw32/bin/ld.exe: warning: cannot find entry symbol _mainCRTStartup; defaulting to 0000000000401000
    

defaults.exe. dynamic.exe :

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[1]: *** [dynamic.exe] Error 1
make[1]: Leaving directory `/c/glfw64/tests'
make: *** [win32-msys] Error 2

DLL. , libs (.a .dll) , , libs ( GLFW , , , , ) :

  • libglfwdll.a \MinGW64\x86_64-w64-mingw32\lib ( libglu32.a, libopengl32.a)
  • glfw.h \MinGW64\x86_64-w64-mingw32\include\GL ( gl.h, glaux.h, glu.h)
  • glfw.dll \windows \windows\system32 ( opengl32.dll, glu32.dll)
+3
3

A , , . B C GLFW. , . , GLFW, . 2.7.6. GLFW Subversion repository.

C , , - .

32- .def __stdcall , 64-. , GCC .def .

DLL. __stdcall ( ) .def( -Wl,--output-def,file.def), ( --kill-at) DLL. .def dlltool .

, , Stdcall DLL- MSVC MinGW, , , .

+3

. glfw-2.7.5\tests\Makefile.win32.mingw: 12

SOLIB     = ../lib/win32/libglfwdll.a

SOLIB     = ../lib/win32/glfw.dll
+3

I ran into the same problem, and while investigating errors and warnings, I found a fix for the warning β€œI cannot find the input character error”:

In the examples /Makefile.win32.msys and tests / Makefile.win32.msys, change the line

WINDOWS = -mwindows -e _mainCRTStartup

to

WINDOWS = -mwindows

Kabie fix helps with dynamic layout error

I am not 100% sure that this is the right solution, because I do not fully understand the reason for the alternative entry point name in the first place, but at least the tests seem to work and the examples are executed.

+2
source

All Articles