Sunday, 18 January 2015

SDL and Eclipse

Thought I'd share this in case anyone else has the same problem:

In Eclipse CDT I had the strange problem where the project would run in debug mode in eclipse, and normally from a terminal, but not when using "run" from eclipse.

In this one particular case, SDL failed with "no available video device."

The solution is to add the DISPLAY environment variable to your run configuration. I have no idea why this isn't needed to launch a debug session as well:

Note: in older versions of Eclipse, this option can be found in Properties -> Run/Debug Settings. Select the configuration and then "Edit..."

A window similar to the above screenshot will come up where you can add the environment variable. Remember to do it for all configurations.

No comments:

Post a Comment