0

I'm trying to compile an old AI project I found here. I am using Netbeans 7.1 I've installed cygwin and the appropriate packages, as I can compile all the Netbeans sample projects. I've put all the files into a project named "sweepers" and when I try to build it, I get this output:

"/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)

I've been googling these errors and come to the conclusion I am missing one or more libraries that have been included (this is just a guess though, as this is my first time compiling c++ or any kind of C outside of xCode on Mac.)

Does anyone know what I am doing wrong here? I feel like its extremely simple but I'm just missing a critical piece of information.

Thank you.

1 Answer 1

1

You're definitely missing some GDI libraries at linking time. Someone knowledgeable at cygwin will probably let you know how to fix that.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for confirming that. I found some post on a forum from a long time ago where someone recommended including gdi32 or something like that but I have no idea how to get these things...
@KerrekSB I don't really know what that means... right click the project, go to linker, then what?
ah, well I went into the cygwin/lib/w32api/ and found libgdi32.a, so I went to linker in project properties and put it there. That fixed the errors. Thanks guys.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.