P
P
Pavel K2015-09-17 18:33:26
Qt
Pavel K, 2015-09-17 18:33:26

Qt. How to understand why undefined reference to a class?

Greetings!
I don’t even know how to describe it, but I’ll try:
There are several classes that are large enough in one project,
these classes are in a separate folder (for convenience, I distribute the classes into folders)
As usual, I include productItem.h in the
header

#ifndef PRODUCTITEM_H
#define PRODUCTITEM_H
.....
#include "productitemrelatives.h"
#include "productitemmetavaluesmodel.h"

class ProductItem : public WBaseItem
.......

Qt generates
productitem.cpp:233 on build: error: undefined reference to `ProductItemRelatives::saveRelatives()
' for any use of ProductItemRelatives or ProductItemMetaValuesModel
The project was rebuilt, qmake was launched, moc files were deleted, pro.user was deleted, still the same error.
At the same time, the compilation in line passes the norms, in Windows there are such delights.
Qt 5.5, mingw
Tell me where to look?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
LittleFatNinja, 2015-09-17
@LittleFatNinja

in ProductItemRelativesexactly there статическийsaveRelatives?

V
Vitaly Petrov, 2015-09-18
@vitaly_KF

Please provide a declaration of the ProductItemRelatives class and show how you call its methods from other code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question