Я пытался установить флаги по-разному, перекомпиляйте библиотеку и многое другое.TARGET = game.exe
C_COMPILER = gcc
CPP_COMPILER = g++
INCLUDE_FOLDER = -Iinclude
LIB_FOLDER = -Llib
SRC = $(wildcard *.cpp)
OBJ = $(patsubst %.cpp, %.o, $(SRC))
FLAGS = $(INCLUDE_FOLDER) $(LIB_FOLDER) -lgdi32 -lglfw3 -lopengl32
game : $(OBJ)
$(CPP_COMPILER) glad.o $(OBJ) $(FLAGS) -o $(TARGET)
#glad.o : glad.c
# $(C_COMPILER) -c glad.c -o glad.o $(FLAGS)
%.o : %.cpp
$(CPP_COMPILER) -c $< $(FLAGS) -o $@
clean :
rm $(OBJ) $(TARGET)
< /code>
Я получил эту ошибку: < /p>
g++ -c main.cpp -Iinclude -Llib -lgdi32 -lglfw3 -lopengl32 -o main.o
g++ glad.o main.o -Iinclude -Llib -lgdi32 -lglfw3 -lopengl32 -o game.exe
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x172): undefined reference to `__imp_CreateDCW'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1aa): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1c8): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x228): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x299): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x2c5): undefined reference to `__imp_DeleteDC'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xc64): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xc7c): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x12d2): undefined reference to `__imp_CreateDCW'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x12f0): undefined reference to `__imp_GetDeviceGammaRamp'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1303): undefined reference to `__imp_DeleteDC'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x145e): undefined reference to `__imp_CreateDCW'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x147c): undefined reference to `__imp_SetDeviceGammaRamp'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x148f): undefined reference to `__imp_DeleteDC'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x237): undefined reference to `__imp_CreateDIBSection'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x2a5): undefined reference to `__imp_CreateBitmap'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x2d1): undefined reference to `__imp_DeleteObject'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x3d9): undefined reference to `__imp_DeleteObject'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x3e9): undefined reference to `__imp_DeleteObject'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0xc4e): undefined reference to `__imp_CreateRectRgn'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0xcb3): undefined reference to `__imp_DeleteObject'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xd9): undefined reference to `__imp_DescribePixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xd93): undefined reference to `__imp_DescribePixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x118b): undefined reference to `__imp_SwapBuffers'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x15be): undefined reference to `__imp_ChoosePixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x15d7): undefined reference to `__imp_SetPixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x1a30): undefined reference to `__imp_DescribePixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x1a73): undefined reference to `__imp_SetPixelFormat'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:15: game] Error 1
Подробнее здесь: https://stackoverflow.com/questions/796 ... g-makefile
Я получил ошибку после связывания библиотеки GLFW, используя Makefile [Duplicate] ⇐ C++
Программы на C++. Форум разработчиков
1746054538
Anonymous
Я пытался установить флаги по-разному, перекомпиляйте библиотеку и многое другое.TARGET = game.exe
C_COMPILER = gcc
CPP_COMPILER = g++
INCLUDE_FOLDER = -Iinclude
LIB_FOLDER = -Llib
SRC = $(wildcard *.cpp)
OBJ = $(patsubst %.cpp, %.o, $(SRC))
FLAGS = $(INCLUDE_FOLDER) $(LIB_FOLDER) -lgdi32 -lglfw3 -lopengl32
game : $(OBJ)
$(CPP_COMPILER) glad.o $(OBJ) $(FLAGS) -o $(TARGET)
#glad.o : glad.c
# $(C_COMPILER) -c glad.c -o glad.o $(FLAGS)
%.o : %.cpp
$(CPP_COMPILER) -c $< $(FLAGS) -o $@
clean :
rm $(OBJ) $(TARGET)
< /code>
Я получил эту ошибку: < /p>
g++ -c main.cpp -Iinclude -Llib -lgdi32 -lglfw3 -lopengl32 -o main.o
g++ glad.o main.o -Iinclude -Llib -lgdi32 -lglfw3 -lopengl32 -o game.exe
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x172): undefined reference to `__imp_CreateDCW'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1aa): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1c8): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x228): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x299): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x2c5): undefined reference to `__imp_DeleteDC'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xc64): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xc7c): undefined reference to `__imp_GetDeviceCaps'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x12d2): undefined reference to `__imp_CreateDCW'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x12f0): undefined reference to `__imp_GetDeviceGammaRamp'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1303): undefined reference to `__imp_DeleteDC'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x145e): undefined reference to `__imp_CreateDCW'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x147c): undefined reference to `__imp_SetDeviceGammaRamp'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x148f): undefined reference to `__imp_DeleteDC'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x237): undefined reference to `__imp_CreateDIBSection'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x2a5): undefined reference to `__imp_CreateBitmap'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x2d1): undefined reference to `__imp_DeleteObject'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x3d9): undefined reference to `__imp_DeleteObject'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x3e9): undefined reference to `__imp_DeleteObject'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0xc4e): undefined reference to `__imp_CreateRectRgn'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0xcb3): undefined reference to `__imp_DeleteObject'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xd9): undefined reference to `__imp_DescribePixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xd93): undefined reference to `__imp_DescribePixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x118b): undefined reference to `__imp_SwapBuffers'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x15be): undefined reference to `__imp_ChoosePixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x15d7): undefined reference to `__imp_SetPixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x1a30): undefined reference to `__imp_DescribePixelFormat'
C:\w64devkit\bin/ld.exe: lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x1a73): undefined reference to `__imp_SetPixelFormat'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:15: game] Error 1
Подробнее здесь: [url]https://stackoverflow.com/questions/79601042/i-got-error-after-linking-glfw-library-using-makefile[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия