Hi Carlos,
Happy to know you've managed to solve this problem.
My advice is to *always* use automatically generated makefiles (UNIX/Linux) and project files (Windows) on all platforms. Use the MakefileGenerator script. If you want to use Eclipse, look carefully at the compilation and linking lines that MakefileGenerator creates and define all the macro definitions, compiler options and include directories in your Eclipse project. Personally, I don't use Eclipse anymore except when I am forced to perform an intensive debugging session. The entire PixInsight platform depends now on MakefileGenerator, from the Core application to all modules, third-party libraries and auxiliary applications.
For example, removing unimportant compiler options (generation of dependency files), this is the compilation line for the 64-bit version of the Sandbox module (the rest of this discussion applies to 32-bit compilations by changing the corresponding compiler options):
g++ -c -pipe -m64 -fPIC -D_REENTRANT -D__PCL_LINUX -I"$(PCLINCDIR)" -O2 -mtune=generic -mfpmath=sse -msse2 -minline-all-stringops -frename-registers -fgcse-after-reload -fpredictive-commoning -ftree-vectorize -ffast-math -fvisibility=hidden -fvisibility-inlines-hidden -fnon-call-exceptions -Wall -Wno-parentheses
From this line you know that the following macro definitions are mandatory:
_REENTRANT
__PCL_LINUX
You need also this include directory:
$(PCLINCDIR)
which requires the PCLINCDIR variable correctly exported in your environment (use your .bash_profile configuration file, more on this below).
The following compiler options are currently being used for all 64-bit modules with GCC:
* -fPIC
-O2
-mtune=generic
-mfpmath=sse
-msse2
-minline-all-stringops
-frename-registers
-fgcse-after-reload
-fpredictive-commoning
-ftree-vectorize
-ffast-math
* -fvisibility=hidden
* -fvisibility-inlines-hidden
* -fnon-call-exceptions
-Wall
-Wno-parentheses
Options marked with an asterisk are mandatory: without them, modules either won't load at all or will be unstable. Note that 32-bit modules don't use -fPIC on Linux (but they do on Mac OS X and FreeBSD).
Note that -ffast-math has some important implications. One of them is that your code is supposed to never allow propagation of non-numeric IEEE entities (NaN or infinities). If you for example try to compute the square root of a negative number, the result will not only be incorrect (NaN), but the behavior of your module will be unpredictable if you allow propagation of the resulting NaN outside your module. Another implication is that the standard classification functions isnan(), isfinite(), etc. will not work at all with -ffast-math. Starting with version 1.6.1, PCL provides replacements for these functions in pcl/Math.h: IsFinite(), IsNaN(), and IsInfinity(). These PCL classification functions will always work correctly irrespective of whether -ffast-math is used or not. You must always use these functions when you need to know for example if your code has produced a NaN, in order to replace it with a suitable value (usually zero).
To help you in setting a correct PI development environment, this is a copy of (the relevant part of) my .bash_profile file on my 64-bit laptop workstation (Fedora 13 x86_64):
export PCLDIR=$HOME/PixInsight
export PCLBINDIR32=$PCLDIR/dist/x86/PixInsight/bin
export PCLBINDIR64=$PCLDIR/dist/x86_64/PixInsight/bin
export PCLBINDIR=$PCLBINDIR64
export PCLLIBDIR32=$PCLDIR/lib/x86
export PCLLIBDIR64=$PCLDIR/lib/x86_64
export PCLLIBDIR=$PCLLIBDIR64
export PCLINCDIR=$PCLDIR/include
export PCLSRCDIR=$PCLDIR/src
export QTDIR32=/usr/lib/Qt-4.6.3
export QTDIR64=/usr/lib64/Qt-4.6.3
export QTDIR=$QTDIR64
export PATH=$PATH:$PCLDIR/bin:$QTDIR/bin:$PCLBINDIR
Hope this helps. Let me know if you need more info.