How to UnRAR files on Ubuntu

Linux-Ubuntu comes with native zip file support (zip and unzip). Good. Unfortunately, uncompressing RAR files (or unrar-ing files) is not handled by Ubuntu. But it’s not a big problem: just install the unrar package and you’re ok. To install unrar, start a terminal and type the following command:
Continue reading “How to UnRAR files on Ubuntu”

offsetof macro in C

I just discovered this macro available in C: offsetof. Here is an simple example:

  char a;
  int b;
  char c;
} example;
struct example s1;
unsigned int offset;
offset = (unsigned int)(&(((example *)(0))->b));

Thanks to offsetof (in the header stddef.h), the last line can be rewritten in:

unsigned int offset;
offset = offsetof(example, b);


FreeImage: Erreur de Compilation Sous Ubuntu 10.10

La compilation de la librairie FreeImage 3.14.1 sous Ubuntu 10.10 gènère cette erreur:

In file included from Source/OpenEXR/IlmImf/ImfChromaticities.h:47,
from Source/OpenEXR/./IlmImf/ImfChromaticities.cpp:43:
Source/OpenEXR/Imath/ImathMatrix.h: In constructor ‘Imath::Matrix44::Matrix44() [with T = float]’:
Source/OpenEXR/./IlmImf/ImfChromaticities.cpp:110: instantiated from here
Source/OpenEXR/Imath/ImathMatrix.h:1813: error: ‘memset’ was not declared in this scope

Continue reading “FreeImage: Erreur de Compilation Sous Ubuntu 10.10”