|
MinGW does not see the library |
Alexander Zhirov
Member #17,695
May 2020
|
I am trying to configure compilation of a project in NetBeans. 1cd 'C:\AllegroTest'
2C:\MinGW\msys\1.0\bin\make.exe -f Makefile CONF=Debug
3"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
4make.exe[1]: Entering directory `/c/AllegroTest'
5"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/allegrotest.exe
6make.exe[2]: Entering directory `/c/AllegroTest'
7mkdir -p dist/Debug/MinGW-Windows
8gcc -lallegro_dialog -lallegro_primitives -lallegro -o dist/Debug/MinGW-Windows/allegrotest build/Debug/MinGW-Windows/main.o
9c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lallegro_dialog
10c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lallegro_primitives
11c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lallegro
12collect2.exe: error: ld returned 1 exit status
13make.exe[2]: *** [dist/Debug/MinGW-Windows/allegrotest.exe] Error 1
14make.exe[2]: Leaving directory `/c/AllegroTest'
15make.exe[1]: *** [.build-conf] Error 2
16make.exe[1]: Leaving directory `/c/AllegroTest'
17make.exe": *** [.build-impl] Error 2
18
19СОБРАТЬ FAILED (значение выхода 2,, общее время: 940ms)
If i don't use keys -lallegro_dialog -lallegro_primitives -lallegro then 1cd 'C:\AllegroTest'
2C:\MinGW\msys\1.0\bin\make.exe -f Makefile CONF=Debug
3"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
4make.exe[1]: Entering directory `/c/AllegroTest'
5"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/allegrotest.exe
6make.exe[2]: Entering directory `/c/AllegroTest'
7mkdir -p dist/Debug/MinGW-Windows
8gcc -o dist/Debug/MinGW-Windows/allegrotest build/Debug/MinGW-Windows/main.o
9build/Debug/MinGW-Windows/main.o: In function `main':
10C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:23: undefined reference to `al_install_system'
11C:\Users\\Documents\NetBeansProjects\AllegroTest/main.c:25: undefined reference to `al_show_native_message_box'
12C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:30: undefined reference to `al_create_display'
13C:\Users\\Documents\NetBeansProjects\AllegroTest/main.c:34: undefined reference to `al_show_native_message_box'
14C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:39: undefined reference to `al_init_primitives_addon'
15C:\Users\\Documents\NetBeansProjects\AllegroTest/main.c:40: undefined reference to `al_install_keyboard'
16C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:42: undefined reference to `al_create_event_queue'
17C:\Users\\Documents\NetBeansProjects\AllegroTest/main.c:46: undefined reference to `al_show_native_message_box'
18C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:51: undefined reference to `al_get_keyboard_event_source'
19C:\Users\\Documents\NetBeansProjects\AllegroTest/main.c:51: undefined reference to `al_register_event_source'
20C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:52: undefined reference to `al_get_display_event_source'
21C:\Users\\Documents\NetBeansProjects\AllegroTest/main.c:52: undefined reference to `al_register_event_source'
22C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:57: undefined reference to `al_wait_for_event'
23C:\Users\\Documents\NetBeansProjects\AllegroTest/main.c:109: undefined reference to `al_map_rgb'
24C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:109: undefined reference to `al_draw_filled_rectangle'
25C:\Users\\Documents\NetBeansProjects\AllegroTest/main.c:110: undefined reference to `al_flip_display'
26C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:111: undefined reference to `al_map_rgb'
27C:\Users\\Documents\NetBeansProjects\AllegroTest/main.c:111: undefined reference to `al_clear_to_color'
28C:\Users\Администратор\Documents\NetBeansProjects\AllegroTest/main.c:114: undefined reference to `al_destroy_display'
29collect2.exe: error: ld returned 1 exit status
30make.exe[2]: *** [dist/Debug/MinGW-Windows/allegrotest.exe] Error 1
31make.exe[2]: Leaving directory `/c/AllegroTest'
32make.exe[1]: *** [.build-conf] Error 2
33make.exe[1]: Leaving directory `/c/AllegroTest'
34make.exe": *** [.build-impl] Error 2
35
36СОБРАТЬ FAILED (значение выхода 2,, общее время: 1s)
I have already copied bin to MinGW itself, but this did not work. I ask for help.:( |
Peter Hull
Member #1,136
March 2001
|
It is finding the headers OK (otherwise you would get compile errors when compiling .c to .o) but not the libraries. gcc -Lpath/to/allegro/libraries -lallegro_dialog -lallegro_primitives -lallegro -o dist/Debug/MinGW-Windows/allegrotest build/Debug/MinGW-Windows/main.o Can you show us what nbproject/Makefile-Debug.mk looks like? Also: the directory you put a red box around looks to be a 64-bit one, but your compiler is mingw32. Are you trying to link a 32-bit program with 64 bit libraries?
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
One problem is link order. You have to link after you compile your main .o file. Alexander Zhirov said: gcc -lallegro_dialog -lallegro_primitives -lallegro -o dist/Debug/MinGW-Windows/allegrotest build/Debug/MinGW-Windows/main.o -l goes after main.o in this case My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|