0

I am compiling a program using CMake with several external libraries: Qt, OMP and Boost. However recently adding fields to a class declaration in a header file results in an instant segfault when running the compiled program. This seems similar to the problem discussed here and here and just as discussed there, cleaning the build directory and recompiling does work, but unlike both of them I am not using QMake but CMake so there is no explicit dependency_dir.

I am not sure what is causing this problem and how to fix it. A temporary fix is to simply keep cleaning the build directory after changing the header, but it's not really solving the core problem.

To make extra clear what happens:

    vector<double> _doubletTranslationLong;       
    // This work fine

    vector<double>   _doubletTranslationLong2; 
    // if this (or anything else) is added in the header, the program 
    // compiles fine but crashes instantly for the same input that worked 
    // earlier until a clean build is done.
Community
  • 1
  • 1
fjafjan
  • 84
  • 1
  • 6
  • CMake is supposed to correctly handle this stuff for you. It might be that you have run into a bug. See also [this question](http://stackoverflow.com/questions/7461000/handling-header-files-dependencies-with-cmake). – ComicSansMS May 23 '14 at 09:32
  • You should post an excerpt of your CMake file in order to understand how your compilation process is configured. – piwi May 23 '14 at 09:41
  • Could you please show your cmake file? – László Papp May 23 '14 at 20:20

0 Answers0