Note that there are some explanatory texts on larger screens.

plurals
  1. POUndefined referance to class
    primarykey
    data
    text
    <p>I know this has been asked a thousands times, but I'm stumped. I've been looking all over for that last 3 days without a result. I keep getting this error and I can't figure out why. I've added only the code that I have input / that matters. If I comment out my code the program compiles without a problem. What am I doing wrong???</p> <blockquote> <p>CMakeFiles/brewtarget.dir/MainWindow.cpp.o: In function MainWindow::MainWindow(QWidget*)': MainWindow.cpp:(.text+0xb145): undefined reference to yeastCellCounter::yeastCellCounter()'</p> </blockquote> <p><strong><code>CODE</code></strong></p> <p><strong>mainwindow.cpp</strong></p> <pre><code>#include "yeastcellcounter.h" // a whole lot of stuff between these... yeastCountDialog = new yeastCellCounter(); </code></pre> <p><strong>mainwindow.h</strong></p> <pre><code>class yeastCellCounter; // A whole log of stuff between these... yeastCellCounter *yeastCountDialog; </code></pre> <p><strong>yeascellcounter.cpp</strong></p> <pre><code>#include "yeastcellcounter.h" yeastCellCounter::yeastCellCounter(){} </code></pre> <p><strong>yeastcellcounter.h</strong></p> <pre><code>#ifndef YEASTCELLCOUNTER_H #define YEASTCELLCOUNTER_H class yeastCellCounter { public: yeastCellCounter(); }; #endif // YEASTCELLCOUNTER_H </code></pre> <p>This are the INCLUDE_DIRECTORIES directive in cmakelist.txt</p> <pre><code>SET(ROOTDIR "${CMAKE_CURRENT_SOURCE_DIR}") SET(SRCDIR "${ROOTDIR}/src") SET(UIDIR "${ROOTDIR}/ui") SET(DATADIR "${ROOTDIR}/data") SET(TRANSLATIONSDIR "${ROOTDIR}/translations") SET(WINDIR "${ROOTDIR}/win") INCLUDE_DIRECTORIES(${SRCDIR}) INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/src") # In case of out-of-source build. INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/QtDesignerPlugins") </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload