I'm having trouble with using non-member functions in Qt. For example, here is the lines in my mainwindow.h
generated from Qt creator template:
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
void print_something_v2() {
qInfo() << "I'm out of the main window!" << "\n";
}
}
QT_END_NAMESPACE
then I get the compiler error multiple definition of Ui::print_something_v2();
but things would work fine if I put the function as a member function of any class. Does Qt forbid using non-member functions? This is causing trouble for me when I'm trying to import some other libraries that are not written for Qt because they always contain some non-member functions.