You are not logged in.

1

Friday, April 20th 2012, 2:24am

Custom Widget Problem

I've created a (container) custom widget using QT Creator -> New File or Project -> Other -> Qt Custom Designer Widget. After building, I copy the .so file (I'm using Ubuntu) to /usr/lib/qt4/plugins/designer and the plugin header file to both /usr/include and usr/include/qt4. Everything goes perfectly in designer...I can find my widget in the widgets panel and add it to my form. But when I try to build I get this error:


collect2: ld returned 1 exit status

The Compile output shows this:


mainwindow.cpp:(.text._ZN13Ui_MainWindow7setupUiEP11QMainWindow[Ui_MainWindow::setupUi(QMainWindow*)]+0x1382): undefined reference to `RDF_TempProbe_Widget::RDF_TempProbe_Widget(QWidget*)'

RDF_TempProbe_Widget is my custom widget. I've seen many threads discussing this problem but thus far have not been able to resolve it. Any ideas?

Thanks,
Rich

2

Tuesday, May 1st 2012, 1:33am

I still have not resolved this....any help out there?

Thanks,
Rich

Junior

Professional

  • "Junior" is male

Posts: 1,622

Location: San Antonio, TX USA

Occupation: Senior Secure Systems Engineer

  • Send private message

3

Thursday, May 10th 2012, 3:46pm

Rich - The undefined reference would lead me to check the .so linkage. You might want to do an ldd on the .so you copied and ensure all the link refs are still good within the shared lib itself. If the case, then add your lib path references to LD_LIBRARY_PATH for resolving correctly (or Ubuntu global method for resolving lib paths).

Just a thought.