Tom Ward

Turning off Thirdparty include warnings

Love it or hate it, compiler warnings are there to try and tell you that you’re doing something silly, and you should fix it even though it’s not the end of the world. The most annoying thing I’ve found recently is when you use someone else’s code and find that there’s loads of warnings. Things like boost and Qt can have loads of warnings, and as tempting as it is to fix them locally, it then becomes a bit of a nightmare when updating the library, as well as some being rather difficult to fix.

One useful thing that you can do on Linux or OSX/Mac with gcc is change the way you add include paths. Rather than doing this:

gcc -I #Some/Include/Path ...

you can do this

gcc -isystem #Some/Include/Path ...

and the gcc compiler will stop spewing out warnings for files within this include directory! Snazzy

The same can’t be said in Windows land and Visual Studio. As far as I know (PLEASE someone tell me otherwise!) the only way to do the same kind of thing is to use #pragma’s around the #include, as follows:

#pragma warning( push, 0 )
#include "Some/Include/Header.h"
#pragma warning( pop )

This sets the warning level to 0 whilst including the header, and then restores to whatever it was before. (FYI: this doesn’t turn off all warnings, as VS in their infinite wisdom don’t allow you to disable some, esp. linker warnings)

Really wish VS would add an equivalient -Isystem for the compiler, as I don’t really like having to put pragmas all over my code, and isn’t very cross-platform friendly…

Anyway, hopefully this helps get you back to the joys of warning free compiling, and get warnings as errors turned on!

Jailbroken iOS development with XCode4.2 and iOS5

Recently I’ve been having a tinker with iOS development, and was especially interested in doing something to do with camera capture and manipulation.

Unfortunately without signing up for a $99 Apple developer account you can’t deploy or debug your code on an iPhone device, and the iPhone/iPad simulator doesn’t emulate anything camera related. Not ideal. However with a little bit of tinkering, it is possible to enable deployment onto your jailbroken device, as well as debug to your heart’s content! So, here’s a step by step guide to doing just that:

NB: I’ve only tested these steps with an iPhone4 on iOS5 and using XCode4.2.

I also don’t take any responsibility for any issues you get following these steps, nd I should point out that this breaks the terms and agreements both in XCode and iOS

I should also say I took a lot of this from alexwhittemore’s awesome blog post. Hopefully I just made it a little easier and made sure it worked on Lion, XCode4.2 with iOS5…

read more

Incremental Linking and Embedding Manifests

Working on a project that needs to support multiple target platforms and therefore multiple development environments is always difficult. Inevitably the best approach is to use a platform agnostic build solution (such as Make, SCons, CMake etc) to wrap up how each development environment actually goes about building and linking the product.

However, this then means that you’re now given the responsibility of managing the manifest file, which you’re recommended to embed into your project’s output. There’s two approaches to do this. The first is to simply run mt.exe, passing in the manifest generated during the link stage.

read more

Creating Child Wordpress Themes

Wordpress is great, I’m a huge fan of how simple it is to install and get setup. However, once it is setup, getting a theme that works for you is a little more tricky. For me this meant that after a joyous 10min installation, I then spent the best part of a day firstly trying to find a theme I liked, and eventually giving up and simply customising the default twentyeleven theme that comes with Wordpress.

This was actually surprisingly easy even with my limited CSS and HTML experience using the joy that is Child Themes. Using child themes allow you to customise any theme without changing it directly, meaning you can get updates and fixes without affecting the customisations you’ve made, which is pretty cool

read more

My First Post

So here it is! A little place on the web for me to post things that I’ve learnt and wished a good article existed, as well as other bits and bobs that I find interesting.

And what better place to start than how I found setting up this little utopia, running on a brand spanking new install of Wordpress. Frankly, it’s awesome. Anything that takes less than 5minutes to install and be not only very feature rich, but also so intuitive that I’ve now setup another website using it, must have something going for it (also that it’s used by most major websites as well)

The only complaint I have is the lack of many out-of-the-box themes to choose from. Once you siphon off the themes that hurt my eyes, they either had no customisable features for things like company logos, or so inundated with options that I grew frustrated with it not looking like I wanted it to.

Luckily it’s relatively painless to customise a given theme using the concept of child themes, which is exactly what I’ve done here! Which leads me nicely onto my next post, in which I’ll explain exactly what I did.