Menu ▾ ▴

#1 compile error

open
nobody
None
5
2006-01-13
2006-01-13
Anonymous
No

When trying to compile SNPmatic on a Linux machine
(specifically Ubuntu Linux 5.1, kernel 2.6.12, gcc 4.01),
and after setting the appropriate Makefile variables to
point to the Affymetrix File SDK, I get the following
error:

../lib/FileHandler/Normalization.cpp: In member
function ‘float CSketchNormalization::GetFactor(const
int&, const float&)’:
../lib/FileHandler/Normalization.cpp:74: error: ‘ceil’
was not declared in this scope
make: *** [../lib/FileHandler/Normalization.o] Error 1

Tracing back to the relevant file in Normalization.cpp,
here is the problem line:

int col = static_cast<int>(ceil(Intensity/m_nBinSize))

The syntax looks ok to me, any thoughts on how to fix
this? Thanks, Finny Kuruvilla (kuruvilla at molbio dot
mgh dot harvard.edu).

Discussion

  • Simon Cawley

    Simon Cawley - 2006-01-14

    Logged In: YES
    user_id=1407936

    Hi Finny,

    I can't replicate that error on my system (linux 2.4.20
    kernel & gcc 3.2) but I suspect that it may be alleviated by
    adding "#include <math.h>" in lib/FileHandler/Normalization.h

    -Simon

     
  • Nobody/Anonymous

    Logged In: NO

    Yes Simon, you are right. That does fix the problem.
    Thanks, Finny

     
  • Hin-Tak Leung

    Hin-Tak Leung - 2006-01-23

    Logged In: YES
    user_id=506848

    Hmm, the correct C++ way to do it is insert
    "#include <cmath>" rather than "#include <math.h".
    In addition to that, "using namespace std;" is needed in
    both of these two files (because you were using std::ceil
    and std::log10 without the std:: in front).

    lib/FileHandler/Normalization.cpp
    lib/FileHandler/FileHandler.cpp

    GCC 4.x probably have much stricter C++ sematic checks.

    gcc --version
    gcc (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8)

    Hi Simon, this is Hin-Tak from WTCCC/CIMR.

     

Log in to post a comment.