"Undefined reference to"
-
Hi !!
I got a problem on one of my code :)
I use this line :m_module.insert(std::pair<QString, AbstractGUIModule*>("Source Video", new VideoModule(DLTCommSetup::DEFAULT_DLT_ADDRESS_GND, QString().number(DLTCommSetup::DEFAULT_RTSP_PORT), DLTCommSetup::DEFAULT_RTSP_MEDIA, VERBOSE8MODULES, parent())));
I got the error : "Undefined reference to 'DLTCommSetup::DEFAULT_DLT_ADDRESS_GND' "
in my header DLTCommSetup :
static constexpr char DEFAULT_ADDRESS_GND[13]="192.168.x.xx"
So it is well defined here, if needed here is my VideoModule constructor :
VideoModule::VideoModule(QString ip, QString port, QString media, bool verbose, QObject* interface_qml) : AbstractGUIModule("Source Video", verbose, interface_qml), m_video_state(VideoState::OFF), m_current_mode(Mode::GROUND), m_video_packet_flag(false), m_media_player("VideoPlayer")
I dont understand where the "undefined reference" comes from :/
Thanks for help :D -
It's okey, I found my problem ! I called the wrong module where my function is, that caused (I dont know why) that error
Qt Magic !
Thx for your help :) -
Hi
Make sure you don't have cyclic includes.
That can also give undefined errors. -
Ichecked and it is okey, any cyclic include in my project :/
-
Hi,
Did you declare
DEFAULT_ADDRESS_GND
as part of your class or is it floating in the header file ? -
Hey !
It is in my public part :class DLTCommSetup { public: DLTCommSetup(); .... ... static constexpr char DEFAULT_ADDRESS_GND[13]="192.168.x.xx"
-
I got the error : "Undefined reference to 'DLTCommSetup::DEFAULT_DLT_ADDRESS_GND' "
static constexpr char DEFAULT_ADDRESS_GND[13]="192.168.x.xx"
Maybe it's just me not understanding, but how is
DEFAULT_ADDRESS_GND
"So it is well defined here" supposed to relate to/help/avoid the undefined reference onDLTCommSetup::DEFAULT_DLT_ADDRESS_GND
? -
@JonB
hehe, its more like you have a good eye :)
Not the same name. -
Well that's the point ^^
I change it thank you... but still the same error (I made a copy/paste sooo we're sure it is the same name now). But the problem still here with the same error message :/ (I cleaned up the project and ran qmake before builded it again -
It's okey, I found my problem ! I called the wrong module where my function is, that caused (I dont know why) that error
Qt Magic !
Thx for your help :)
9/10