Сборка проекта C ++ в NetBeans и получение большого количества неопределенных ссылочных ошибок (нужно связать GDI?) - PullRequest
0 голосов
/ 08 января 2012

Я пытаюсь скомпилировать старый проект AI, который нашел здесь . Я использую Netbeans 7.1. Я установил Cygwin и соответствующие пакеты, так как могу скомпилировать все примеры проектов Netbeans. Я поместил все файлы в проект с именем «sweepers», и когда я пытаюсь его собрать, я получаю следующий вывод:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/sweepers.exe
make[2]: Entering directory `/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers'
mkdir -p dist/Debug/Cygwin-Windows
g++.exe     -o dist/Debug/Cygwin-Windows/sweepers build/Debug/Cygwin-Windows/_ext/1369961084/CMinesweeper.o build/Debug/Cygwin-Windows/_ext/1369961084/utils.o build/Debug/Cygwin-Windows/_ext/1369961084/C2DMatrix.o build/Debug/Cygwin-Windows/_ext/1369961084/CNeuralNet.o build/Debug/Cygwin-Windows/_ext/1369961084/main.o build/Debug/Cygwin-Windows/_ext/1369961084/CTimer.o build/Debug/Cygwin-Windows/_ext/1369961084/CGenAlg.o build/Debug/Cygwin-Windows/_ext/1369961084/CParams.o build/Debug/Cygwin-Windows/_ext/1369961084/CController.o -L/cygdrive/C/cygwin/lib -L/cygdrive/C/cygwin/lib/w32api 
build/Debug/Cygwin-Windows/_ext/1369961084/main.o: In function `_Z10WindowProcP6HWND__jjl':
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:76: undefined reference to `_CreateCompatibleDC@4'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:80: undefined reference to `_CreateCompatibleBitmap@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:85: undefined reference to `_SelectObject@8'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:136: undefined reference to `_SelectObject@8'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:140: undefined reference to `_CreateCompatibleBitmap@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:145: undefined reference to `_SelectObject@8'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:157: undefined reference to `_BitBlt@36'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:171: undefined reference to `_BitBlt@36'
make[2]: Leaving directory `/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:180: undefined reference to `_SelectObject@8'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:183: undefined reference to `_DeleteDC@4'
make[1]: Leaving directory `/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/main.cpp:184: undefined reference to `_DeleteObject@4'
build/Debug/Cygwin-Windows/_ext/1369961084/CController.o: In function `_ZN11CControllerC2EP6HWND__':
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:82: undefined reference to `_CreatePen@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:83: undefined reference to `_CreatePen@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:84: undefined reference to `_CreatePen@12'
build/Debug/Cygwin-Windows/_ext/1369961084/CController.o: In function `_ZN11CControllerC1EP6HWND__':
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:82: undefined reference to `_CreatePen@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:83: undefined reference to `_CreatePen@12'
build/Debug/Cygwin-Windows/_ext/1369961084/CController.o:/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:84: more undefined references to `_CreatePen@12' follow
build/Debug/Cygwin-Windows/_ext/1369961084/CController.o: In function `_ZN11CControllerD2Ev':
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:112: undefined reference to `_DeleteObject@4'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:113: undefined reference to `_DeleteObject@4'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:114: undefined reference to `_DeleteObject@4'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:115: undefined reference to `_DeleteObject@4'
build/Debug/Cygwin-Windows/_ext/1369961084/CController.o: In function `_ZN11CControllerD1Ev':
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:112: undefined reference to `_DeleteObject@4'
build/Debug/Cygwin-Windows/_ext/1369961084/CController.o:/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:113: more undefined references to `_DeleteObject@4' follow
build/Debug/Cygwin-Windows/_ext/1369961084/CController.o: In function `_ZN11CController6RenderEP5HDC__':
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:225: undefined reference to `_TextOutA@20'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:231: undefined reference to `_SelectObject@8'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:242: undefined reference to `_MoveToEx@16'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:246: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:249: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:254: undefined reference to `_SelectObject@8'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:261: undefined reference to `_SelectObject@8'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:271: undefined reference to `_MoveToEx@16'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:275: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:278: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:281: undefined reference to `_MoveToEx@16'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:285: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:288: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:290: undefined reference to `_MoveToEx@16'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:291: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:293: undefined reference to `_MoveToEx@16'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:297: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:303: undefined reference to `_SelectObject@8'
build/Debug/Cygwin-Windows/_ext/1369961084/CController.o: In function `_ZN11CController9PlotStatsEP5HDC__':
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:321: undefined reference to `_TextOutA@20'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:324: undefined reference to `_TextOutA@20'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:333: undefined reference to `_SelectObject@8'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:335: undefined reference to `_MoveToEx@16'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:339: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:347: undefined reference to `_SelectObject@8'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:349: undefined reference to `_MoveToEx@16'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:353: undefined reference to `_LineTo@12'
/cygdrive/f/Users/Jonathon/Documents/NetBeansProjects/sweepers/../../../Desktop/sweepers/CController.cpp:359: undefined reference to `_SelectObject@8'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/Cygwin-Windows/sweepers.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2


BUILD FAILED (exit value 2, total time: 1s)

Я погуглил эти ошибки и пришел к выводу, что мне не хватает одной или нескольких библиотек, которые были включены (это всего лишь предположение, поскольку я впервые компилирую c ++ или любой другой C вне xCode на Mac.)

Кто-нибудь знает, что я здесь не так делаю? Я чувствую, что это очень просто, но мне просто не хватает важной информации.

Спасибо.

1 Ответ

1 голос
/ 08 января 2012

Вам определенно не хватает некоторых библиотек GDI во время компоновки. Кто-то из знающих в Cygwin, вероятно, сообщит вам, как это исправить.

...