Saturday, July 25, 2009

Forget GLUT

Use GLFW. GLUT is old and it's a dead project. GLFW is newer, looks like it might still be maintained by someone, and Code:Blocks' GLFW project template worked right off the bat.

Wednesday, July 22, 2009

Getting GLUT Working With Code::Blocks in Windows (Vista)

Look at my last post to see the status of things when I last beat my head against this problem.
I couldn't find anything useful to help me with finding "-lGL" in Windows, I really don't think that even makes sense. So, I decided to try creating a new GLUT project in Code::Blocks, maybe there was something wrong with my current project. Afterall, I'd started it in Code:Blocks for Linux and then just opened up that project file on my Windows machine.
I ran into the same problem that had caused me to start working under Linux in the first place. I couldn't get Code::Blocks to see my GLUT libraries, and thus I couldn't even create the project. On the second page of the GLUT project creation wizard I kept one or another of a few different errors, all complaining about the directory I was giving in the input for "Please select GLUT's location:".
First off, it's the binary version that you want if you follow these instructions.
The trouble stems from the fact that the GLUT zip file that you download does not have the dierctory structure expected by the IDE. The same is true for MS VC++; in fact I found the solution in a tutorial which uses MS VC++. That's a video tutorial, and the helpful part starts around 1m:40s into it. To fix it, create the following directory structure and place your files within it as shown:
GLUT
include
GL
glut.h
lib
glut.def
glut32.dll
glut32.lib
README-win32.txt
It doesn't matter where you put this, and you can name that top level "GLUT" directory whatever you want. Obviously the README file doesn't actually matter. Once this has been done, copy the full path to the GLUT (or whatever you name it) directory into the input in the Code::Blocks project creation wizard and then click 'Next >'. It should let you advance to the next step. So, now it's finally working for me. Before I copy in all the code I wrote in Linux I hit F9 once to make sure all is well in this new, empty project.
FAIL.
GL\glut.h|50|error: redeclaration of C++ built-in type `short'
GL\glut.h|58|warning: ignoring #pragma comment
GL\glut.h|66|warning: ignoring #pragma comment
GL\glut.h|67|warning: ignoring #pragma comment

Goddamnit! There are some hits on the Googelz for this. Did you know GLUT hasn't been maintained since 1999? Great kuugley mooglee, I hate this shit.
Guess I'll work on this again tomorrow.

SetUp Code::Blocks in Windows (Vista)

I've had trouble getting Code::Blocks to compile my project in Windows (Vista to be specific). Here's what it took for me to get it working properly.
First install Code::Blocks using the Windows/binary version of the installer, the one with MinGW included. For me this resulted in a functional installation the IDE, but it threw the following error whenever I hit F9 to build and run.

"MyProject - Debug" uses an invalid compiler. Skipping...

MinGW was not missing, but Code::Blocks doesn't yet know where it is (even though it was the Code::Blocks installer that set it up in the first place!). Here's the fix:
goto the 'Settings' menu
click 'Compiler and debugger...'
click 'Global compiler settings' in the column of icons on the left side
click the 'Toolchain executables' tab
note that the path to "Compiler's installation directory" is 'C:\MinGW' (at least for me it was)
click the 'Auto-detect' button next to that input

Hopefully that will succeed in finding your MinGW installation directory for you. It was when I did it. That was enough to allow me to build and run a console application, the default "Hello World!" that the IDE provides whenever you create a new console application project.

Next, I closed that project and opened up my openGL/GLUT project. This is the one for which I'd been setting up Code::Blocks in the first place. Hitting F9 still didn't result in a happily running GLUT window like Code::Blocks had been giving me on my Linux machine. The next problem?

ld.exe cannot find -lGL
=== Build finished: 1 errors, 0 warnings ==

This error I'd already seen, just one night before on my Linux machine. The solution to that problem can be found in my previous post, "cannot find -lGL". That's all I can take tonight, I'll have to continue this unnecessary torment tomorrow.

Monday, July 20, 2009

cannot find -lGL

I was working on my tank game in Code::Blocks and suddenly it started throwing this error whenever I tried to build. Turns out it's an error from 'ld', the GNU linker, and means that it can't find the openGL library: libGL.so. I looked in /usr/lib/ and found 'libGL.so.1', so I copied that to 'libGL.so'. That was it, all fixed.
Still no clue how that happened. I'd been happily building mere minutes beforehand.

Sunday, September 16, 2007

Kitchen Chandelier


I finally installed this chandelier type thingie that I bought at Costco for $55.
Now, what do I do for the other side of the kitchen?

Tuesday, March 27, 2007

Washer Closet - Tiling the Floor

Washer Closet - Tile Floor
1st night: shopping, cutting Durock, and cutting tiles.
2nd night: mortar, and setting tiles
3rd night: grout
Lessons:
Never leave your trowel outside when rain clouds are overhead. Cheap tools rust fast.
A carton of grout needs 26oz of water. This means that half a carton of grout needs 13oz of water, not 23oz. Retard.
Tile nippers suck on their own. To get a straight line, where you want it, tile must be deeply scored to make the break with hand held nibblers.

Update: 3 weeks later and it's all done