Panel użytkownika
Nazwa użytkownika:
Hasło:
Nie masz jeszcze konta?

linkowanie statyczne plików MinGW w CodeBlocks

Ostatnio zmodyfikowano 2022-10-17 17:08
Autor Wiadomość
AP1994
Temat założony przez niniejszego użytkownika
» 2022-09-25 16:17:23
Do tego że to literówka była jakoś doszedłem już rano, ale linkując
liballegro_monolith-debug-static.a lub liballegro_monolith-static.a dostaję błędy:

undefined reference to `__imp_timeBeginPeriod'
undefined reference to `__imp_timeEndPeriod'
undefined reference to `__imp_PathFindOnPathW'
undefined reference to `__imp_timeGetTime'
undefined reference to `__imp_GetStockObject'
undefined reference to `__imp_SelectObject'
95|undefined reference to `__imp_SetDCBrushColor'
97|undefined reference to `__imp_Rectangle'
i jeszcze kilka czy kilkanaście lini.
 

Kiedy linkuję liballegro_monolith-debug.dll.a lub liballegro_monolith.dll.a dostaje taki błąd:
 
 
R:\winlibs64-11.3.0ucrt\2604.gcc\gcc-12.2.0\build_mingw\x86_64-w64-mingw32\libgcc\..\..\..\libgcc\unwind-seh.c|347|multiple definition of `_Unwind_Resume'; ..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith.dll.a(allegro_monolith_5_2_dll_d001015.o):(.text+0x0): first defined here|

P-179657
AP1994
Temat założony przez niniejszego użytkownika
» 2022-09-25 17:14:07
P-179658
DejaVu
» 2022-09-25 17:51:42
Brakuje Ci po prostu kolejnych plików do zlinkowania. Googluj pojedynczo errory i będziesz znajdował czego Ci jeszcze brakuje.
P-179659
AP1994
Temat założony przez niniejszego użytkownika
» 2022-09-27 22:59:51
Łatwo powiedzieć Googluj. Miałem dzisiaj czas i poszukałem, pierwszego pliku Winmm.lib już nie umiałm zalinkować. Próbowałem:
-lGdi32 -lShlwapi -lWinmm niestety to było na nic, bo na komputerze nie miałem tych plików lib czy też a, a kiedy pobrałem Winmm.lib z internetu, linkowanie i tak nie działało.
P-179664
pekfos
» 2022-10-01 10:10:38
Wszystkie trzy biblioteki które podałeś powinny być dołączone do kompilatora. Oprócz błędów podaj też log z kompilacji. » KonfiguracjaPełne logi w Code::Blocks artykuł
P-179665
AP1994
Temat założony przez niniejszego użytkownika
» 2022-10-02 00:58:57
Skoro wszystkie trzy biblioteki powinny, być dołączone do kompilatora to teraz nie jestem pewien czy mam MinGW poprawnie zainstalowany, bo skoro te pliki miałbym w kompilatorze to chyba nie dostawałbym błędów.
Build log:

-------------- Build: Debug in platform game (compiler: GNU GCC Compiler)---------------

g++.exe -L"D:\moje programy\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib" -o "platform game\2022-10-01\platform game.exe" "platform game\2022-10-01 Debug\Collisions.o" "platform game\2022-10-01 Debug\default_creature.o" "platform game\2022-10-01 Debug\kontrolki.o" "platform game\2022-10-01 Debug\main.o" "platform game\2022-10-01 Debug\mapa.o" "platform game\2022-10-01 Debug\monster.o" "platform game\2022-10-01 Debug\player.o" "platform game\2022-10-01 Debug\Window.o"  "platform game\2022-10-01 Debug\resouce.res" -static-libstdc++ -static -lopengl32 -lglu32 -lGdi32 -lShlwapi -lWinmm  ..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(bitmap.c.obj): In function `_al_create_bitmap_params':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/bitmap.c:164: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(bitmap.c.obj): In function `al_get_bitmap_blend_color':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/bitmap.c:376: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(bitmap.c.obj): In function `al_get_separate_bitmap_blender':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/bitmap.c:401: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(bitmap.c.obj): In function `al_set_bitmap_blend_color':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/bitmap.c:437: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(bitmap.c.obj): In function `al_set_bitmap_blender':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/bitmap.c:449: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(bitmap.c.obj):C:/dev/allegro_winpkg/universal/build_msys_64/allegro/bitmap.c:461: more undefined references to `__imp__wassert' follow
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wsystem.c.obj): In function `win_initialize':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wsystem.c:197: undefined reference to `__imp_timeBeginPeriod'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wsystem.c.obj): In function `win_shutdown':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wsystem.c:217: undefined reference to `__imp__wassert'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wsystem.c:236: undefined reference to `__imp_timeEndPeriod'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wsystem.c:244: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wsystem.c.obj): In function `win_get_monitor_info':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wsystem.c:549: undefined reference to `__imp__wassert'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wsystem.c:550: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wsystem.c.obj): In function `_al_win_safe_load_library':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wsystem.c:887: undefined reference to `__imp_PathFindOnPathW'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wsystem.c.obj): In function `win_import_symbol':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wsystem.c:911: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wsystem.c.obj): In function `win_close_library':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wsystem.c:917: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wtime.c.obj): In function `low_res_current_time':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wtime.c:48: undefined reference to `__imp_timeGetTime'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wtime.c.obj): In function `_al_win_init_time':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wtime.c:101: undefined reference to `__imp_timeGetTime'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wtime.c.obj): In function `_al_win_init_timeout':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wtime.c:135: undefined reference to `__imp__wassert'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wtime.c:136: undefined reference to `__imp__wassert'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wtime.c:139: undefined reference to `__imp_timeGetTime'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wtime.c:142: undefined reference to `__imp_timeGetTime'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wwindow.c.obj): In function `clear_window':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:94: undefined reference to `__imp_GetStockObject'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:94: undefined reference to `__imp_SelectObject'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:95: undefined reference to `__imp_SetDCBrushColor'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:97: undefined reference to `__imp_Rectangle'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wwindow.c.obj): In function `window_callback':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:764: undefined reference to `__imp_CreateRectRgn'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:773: undefined reference to `__imp_GetRegionData'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:775: undefined reference to `__imp_GetRegionData'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:795: undefined reference to `__imp_DeleteObject'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wwindow.c.obj): In function `_al_win_set_display_flag':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:1256: undefined reference to `__imp__wassert'
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:1295: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wwindow.c.obj): In function `_al_win_wnd_call_proc':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:1371: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wwindow.c.obj): In function `_al_win_wnd_schedule_proc':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wwindow.c:1382: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wxthread.c.obj): In function `_al_thread_create':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wxthread.c:45: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wxthread.c.obj):C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wxthread.c:46: more undefined references to `__imp__wassert' follow
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(wxthread.c.obj): In function `_al_cond_timedwait':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/wxthread.c:356: undefined reference to `__imp_timeGetTime'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(d3d_disp.cpp.obj): In function `d3d_make_faux_fullscreen_stage_two':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/d3d_disp.cpp:734: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(d3d_disp.cpp.obj): In function `d3d_destroy_display_internals':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/d3d_disp.cpp:901: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(d3d_disp.cpp.obj): In function `d3d_create_display_helper':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/d3d_disp.cpp:1580: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(d3d_disp.cpp.obj): In function `d3d_create_display_internals':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/d3d_disp.cpp:1722: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(d3d_disp.cpp.obj): In function `d3d_create_display_locked':
C:/dev/allegro_winpkg/universal/build_msys_64/allegro/d3d_disp.cpp:1783: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(d3d_disp.cpp.obj):C:/dev/allegro_winpkg/universal/build_msys_64/allegro/d3d_disp.cpp:1794: more undefined references to `__imp__wassert' follow
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(ogl_shader.c.obj): In function `check_gl_error':
C:/dev/allegro_winpkg/universal/allegro/src/opengl/stdio.h:55: undefined reference to `__imp_glGetError'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(ogl_shader.c.obj): In function `glsl_attach_shader_source':
C:/dev/allegro_winpkg/universal/allegro/src/opengl/stdio.h:92: undefined reference to `__imp__wassert'
C:/dev/allegro_winpkg/universal/allegro/src/opengl/stdio.h:93: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(ogl_shader.c.obj): In function `glsl_use_shader':
C:/dev/allegro_winpkg/universal/allegro/src/opengl/stdio.h:209: undefined reference to `__imp_glGetError'
C:/dev/allegro_winpkg/universal/allegro/src/opengl/stdio.h:211: undefined reference to `__imp_glGetError'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(ogl_shader.c.obj): In function `glsl_set_shader_sampler':
C:/dev/allegro_winpkg/universal/allegro/src/opengl/stdio.h:284: undefined reference to `__imp_glBindTexture'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(ogl_shader.c.obj): In function `glsl_set_shader_int_vector':
C:/dev/allegro_winpkg/universal/allegro/src/opengl/stdio.h:372: undefined reference to `__imp__wassert'
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a(ogl_shader.c.obj): In function `glsl_set_shader_float_vector':
C:/dev/allegro_winpkg/universal/allegro/src/opengl/stdio.h:406: undefined reference to `__imp__wassert'
Process terminated with status 1 (0 minute(s), 1 second(s))
50 error(s), 0 warning(s) (0 minute(s), 1 second(s))
P-179672
pekfos
» 2022-10-02 01:35:01
-lopengl32 -lglu32 -lGdi32 -lShlwapi -lWinmm  ..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a
Kolejność bibliotek w GCC ma znaczenie i w tym wypadku jest błędna. Allegro powinno być przed bibliotekami których potrzebuje.

Brak __imp__wassert może wynikać z tego że build Allegro oczekuje dynamicznej wersji biblioteki standardowej, a tu linkujesz statyczną. Dla potwierdzenia zobacz co będzie jak na moment usuniesz te opcje linkera.
P-179673
AP1994
Temat założony przez niniejszego użytkownika
» 2022-10-02 11:55:57
Allegro powinno być przed bibliotekami których potrzebuje
, ale czy mógłbym, prosić przykład jak to miałoby wyglądać. Próbowałem tak, ale nie zadziałało:
..\..\biblioteki\allegro-x86_64-w64-mingw32-gcc-12.1.0-posix-seh-static-5.2.8.0\lib\liballegro_monolith-debug-static.a -lopengl32 -lglu32 -lGdi32 -lShlwapi -lWinmm

P-179674
1 « 2 » 3 4 5 6
Poprzednia strona Strona 2 z 6 Następna strona