QtCreator problem?

Sebastian Kügler sebas at kde.org
Tue Jan 26 07:01:24 PST 2016


On Tuesday, January 26, 2016 04:16:05 PM Willem Ferguson wrote:
> I am working with the subsurface project loaded into QtCreator. I 
> created a new class, the files (.cpp, .h) of which exists in the 
> directory: desktop-widgets. When I refer to this class from within the 
> Subsurface C++ code, I get an error: "Undefined reference" to the 
> constructor and method of the new class. Obviously the new class is 
> instantiated inside the Subsurface code.
> 
> I notice two things:
> 
> a) Attached image shows QtCreator side bar with File system at the top 
> and with the recognised classes below. As file manager, it sees the .cpp 
> and .h files ("downloadmanager.cpp & downloadmanager.h) but the class 
> does not appear in the class view panel below.
> 
> b) If I look in the Subsurface.cbp file, the new class has also not been 
> added there after QtCreator initially created the .cbp file.
> 
> I am convinced this is something basic and simple that I have not 
> managed to understand.

I'm not familiar with QtCreator, but you need to add downloadmanager.cpp to 
the top-level CMakeLists.txt along with other .cpp files. Where exactly 
depends on where it's used, mobile app, desktop app or both.
-- 
sebas

http://www.kde.org | http://vizZzion.org


More information about the subsurface mailing list