aflux / neutrino

A light, expandable and full featured image analysis tool for research
10 stars 1 forks source link

colormap static load #2

Closed aflux closed 10 years ago

aflux commented 10 years ago

static colormaps should be staticly written as

unsigned char * p = "\x01\x02\x03\x04...";

instead of

p[0] = 0x01; p[1] = 0x02; p[2] = 0x03; ...

iltommi commented 10 years ago

This is only possible in c++0x (which is still unavaible in the basic g++ os osx)

this doesn't compile on osx (you need a decent compiler)

include

unsigned char * allocateandfill (int n) { unsigned char *p=new unsigned char[n] {'\x01','\x02'}; return p; }

int main () { int n=100; unsigned char *p=allocateandfill(n); for (int i=0;i<n;i++) { std::cerr << i << "\t" << (int)p[i] << std::endl; } }

iltommi commented 10 years ago

ok it seems to be possible using macports, but you have to do this: sudo port select --list gcc sudo port select --set gcc mp-gcc48

and -std=c++11 flag should be turned on

iltommi commented 10 years ago

In fact qmake wants to build with system gcc... so you need to hack the neutrino.pri to force new compiler and this break the compilation (probably because QT is built upon gcc4.2)

and add these to neutrino.pri to tackle the default qmake definitions

QMAKE_CC = gcc QMAKE_CXX = g++ QMAKE_LINK = $$QMAKE_CXX QMAKE_LINK_SHLIB = $$QMAKE_CXX

worth the candle?

iltommi commented 10 years ago

done with memcpy