MinGW Toolchain is Missing

As part of my system rebuild I installed the latest Eclipse and CDT and tried to create a new C++ project. Even though I had MinGW set up and working, the MinGW toolchain was missing from Eclipse’s list of available toolchains. It seems I needed to add the MINGW_HOME environment variable pointing to the location where MinGW is installed (e.g. C:MinGW) so CDT could find it.]]>

Eclipse CDT Debugger Stops at main()

I’ve run into two separate versions of this issue. Basically, when debugging an application with CDT the application automatically breaks at the entry point to main(). The first version is easy to fix. Open the Debug Configurations dialog for the project, select the Debugger tab and uncheck the “Stop on startup at:” checkbox. The second version is a little less obvious and is usually accompanied by an uninformative stack trace similar to this:

Thread [1] (Suspended)
7 ntdll!RtlFindSetBits() 0x7768fc02
6 ntdll!RtlFindSetBits() 0x7768fc02
5 ntdll!TpReleaseCleanupGroupMembers() 0x776abd90
4 <symbol is not available> 0x00000050
3 <symbol is not available> 0xffffffff
2 <symbol is not available> 0x0028ef30
1  0x00000000

The not so obvious solution to this is to again, go to the project Debug Configuration dialog, select the Debugger tab, select the Shared Libraries tab and uncheck the “Load shared library symbols automatically” checkbox. https://www.eclipse.org/forums/index.php/m/493210/


MinGW problem with WLOOP in DirectMusic

Building a small DirectX application with MinGW I ran into this error (again):

C:/DXSDK/include/dmdls.h:81: error: declaration of `WLOOP _DMUS_REGION::WLOOP[1]'
C:/DXSDK/include/dls1.h:264: error: changes meaning of `WLOOP' from `typedef struct _rloop WLOOP'

I encountered this a few years ago (and completely forgot about it… almost). It took me a while to dig up the forum post where I had originally posted the solution to this problem. I’m bringing it back here so I can find it more easily. WLOOP is typedef’ed in dls1.h as:

typedef struct _rloop {
    ULONG cbSize;
    ULONG ulType; /* Loop Type */
    ULONG ulStart; /* Start of loop in samples */
    ULONG ulLength; /* Length of loop in samples */

The WLOOP type is used in a struct in dmdls.h:

typedef struct _DMUS_REGION
    RGNRANGE RangeKey;
    RGNRANGE RangeVelocity;
    USHORT fusOptions;
    USHORT usKeyGroup;
    ULONG ulRegionArtIdx;
    ULONG ulNextRegionIdx; /* If zero no more regions */
    ULONG ulFirstExtCkIdx;
    WAVELINK WaveLink;

It seems MinGW doesn’t like the member variable with the same name as its type. I changed the definition of the WLOOP member variable to use the actual type rather than the typedef’ed alias:

typedef struct _DMUS_REGION
    // WLOOP WLOOP[1];
    struct _rloop WLOOP[1];

Hope this helps.]]>

3D Stereo on Linux with nVidia QuadroFX

So, a while back I had set up a Linux machine with an older QuadroFX video card to do some 3D stereo programming. The nVidia Linux drivers installed without a problem and everything seemed to be working. Except for the stereo part. Trying some test applications this is what I found:

With glxgears I’d get:

$ glxgears -stereo Error: couldn’t get an RGB, Double-buffered, Stereo visual With https://astronomy.swin.edu.au/~pbourke/opengl/stereogl/pulsar.c:

$ ./pulsar -s
ERROR: Internal error <Visual with necessary capabilities not found> in function fgOpenWindow

Poking around the internet turned up little about this problem. However, from /usr/share/doc/NVIDIA_GLX-1.0/README.txt I found this little tid-bit: Workstation overlays, stereo visuals, and the unified back buffer (UBB) are incompatible with Composite. These features will be automatically disabled when Composite is detected. Simply running: “nvidia-xconfig --no-composite” fixed it. Looks like it added the following to xorg.conf:

Section "Extensions"
    Option         "Composite" "Disable"

Hopefully this helps anyone else with this problem… ]]>

Broken JDK 7 Installer

Ok, how broken is this? I recently rebuilt my development machine and ran into this goodie while reloading my software development tools. I needed the Java JDK so, like any normal person, I went to Oracle’s website and downloaded the shiny new JDK 7 and Java EE 6 bundle. After running the downloaded installer I am confronted by this gem:

Error: Could not find the required version of the Java(TM) 2 Runtime Environment in'(null)'.

Huh? So doing some googling I see one suggestion that the download might have been incomplete so I download it again. No good. I found a post on Stack Overflow from someone trying to uninstall Java EE 6. The “fix” for that problem is that the uninstaller is written in Java so it needs a Java VM to run. Seriously? Yeah, so I try it. I install the basic Java 6 Runtime and hey! All fixed! Um, Oracle… You know that the JDK comes with its own runtime right? Now I have 2 runtimes installed… Your bundle installer couldn’t install its required runtime before launching the JDK installer? Even if you couldn’t be bothered to do something like that, how about a more descriptive message instead of your buggy “couldn’t find it in ‘(null)'” crap? I mean, I’m expecting the runtime to be included in the bundle so this tells me nothing about needing it to be already installed. It just looks like I got a corrupted download or just crap software.

Update 10/20/12

Ok, so it’s been a year since this original post and Oracle still hasn’t fixed anything. Not only that, I discovered a new issue, probably what one commenter below had run into but I didn’t see it at the time. I got a shiny new laptop the other day. 64-bit with Windows 7 Professional. So, setting up my tools I initially tried to install the JDK deliberately without first installing the runtime just to see if this issue has actually been fixed. It hasn’t. What I did discover is just as WTF worthy as the above problem. Since I got a hot new 64-bit computer, let’s install the 64-bit JDK. Ok cool. I run the installer and it didn’t work as I expected. So, I download the Java 7 runtime. Still doesn’t work. Ok, I used the Java 6 runtime before so I try that. Nope. WTF? Ok, I’m trying the 64-bit runtimes, surely they should work. I download the 32-bit Java 7 runtime. And it works! Seriously? WTF? So, you can’t install the 64-bit JDK with the 64-bit Java runtime? The 64-bit JDK installer only works with the 32-bit runtime. Not only is this not documented anywhere on Oracle’s website the error message presented is still the same worthless uninformative message.