C++

Qt and GCC 4.7.0 -std=c++0x

Posted by on February 6, 2012 at 4:08 pm

Another bump. Switching to gcc 4.7.0 and trying to compile my qt code with -std=c++0x, fails legendary. The error message is intuitive like ever. It says something like: error: inconsistent user-defined literal suffixes ‘_FILE_’ and ‘QTOSTRING’ in string literal According to this https://bugreports.qt-project.org/browse/QTBUG-22847?focusedCommentId=168644&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel According to this, here is the solution, at least until we get [...]

GCC 4.7.0 on Ubuntu 10.10

Posted by on January 20, 2012 at 1:57 pm

I needed to have gcc 4.6+ on my laptop to compile some c++11 code, which my gcc 4.4.4 from synaptic wasn’t able to handle. Yes, yes ‘update your ubuntu’ is the default warcry in such situations, but I didn’t want that to happen, not yet. So I needed a second gcc in my system. This [...]

Amiga C Book accompanying floppy – “Grafik in C”

Posted by on July 3, 2011 at 7:59 am

What a wonderful, inspiring weekend, spent writing some C in Cygnus Editor. Few months ago a coder from my demo group from the nineties found his Amiga 1200 with a fully functional and kicking hard disk. In one of its deeply nested, completely deprived of any systematical approach, ‘drawers’ (that’s how folders were called on [...]

Qmake and targets (pre-building dependencies)

Posted by on November 14, 2010 at 8:07 pm

When using qmake as your build system, if you have a project which depends on a, e.g. external_library.a, you will need to set it up so that it can rebuild the library automatically, whenever the external library changes. In Visual studio this is easily done via its GUI, project properties, dependencies section, but when it [...]

Dirty debug output in DeSmuMe

Posted by on October 10, 2010 at 10:47 am

Looking for a printf replacement when coding NDS homebrew? Okay, (i)printf is nice, most of the time, but sometimes (actually quite often) you just can’t use it, be it for reasons like you’ve exhausted all video memory locations, or you need both screens, if you are coding something more complex than a simple effect, or [...]

Crossplatform QueryPerformanceTimer

Posted by on September 26, 2010 at 10:25 am

Here is a simple way to get high precision timer on both Linux and Windows (can’t remember where I saw parts of this code, but I hope wrapping it up and spreading it won’t make the author angry) : cross_platform_timer.h cross_platform_timer.cpp I added few helper wrappers to make the life easier, you can get current [...]

error: ‘glActiveTextureARB’ was not declared in this scope

Posted by on September 23, 2010 at 9:31 am

If this happens to you, you most likely have NVidia gfx card, and the set up has poked the gl.h. To remedy this without having to reinstall anything, just add this to your code, before calling #include : #define GL_GLEXT_PROTOTYPES 1 #include <GL/gl.h> For some reason th glActiveTextureARB prototype is under #ifdef GL_GLEXT_PROTOTYPES section. Adding [...]

Wrap numbers around power of 2 borders

Posted by on September 3, 2010 at 10:29 pm

I was working yesterday on some texture sampler, and recalled a simple thingy that was a great help back in the 90′s, which I completely forgot in recent years. If you have a counter, sampler or whatever that has to get wrapped around e.g. 256, 512 or any other power of two, you can use [...]

My darkish Komodo and QT Creator color schemes

Posted by on July 17, 2010 at 4:43 pm

You can download my Komodo and Qt Creator ‘dark’ themes from: http://www.modmancer.com/downloads/dev_blog/dew_dark.ksf http://www.modmancer.com/downloads/dev_blog/dew_dark.xml For Komodo: copy the Komodo theme to your ~/.komodoide/5.2/schemes folder. For Qt Creator 2.0: copy the Qt Creator theme to your ~/.config/Nokia/qtcreator/styles folder.