-   Programming (
-   -   undefined reference to... (

dimah 12-22-2006 02:00 AM

undefined reference to...
Hello, i wrote a QT program from one site and after compiling I got a message:

.obj/moc_form1.o(.gnu.linkonce.r._ZTV5Form1+0x1cc): undefined reference to `Form1::setDir(QString const&)'
.obj/moc_form1.o(.gnu.linkonce.r._ZTV5Form1+0x1d0): undefined reference to `Form1::itemHighlighted(int)'
.obj/moc_form1.o(.gnu.linkonce.r._ZTV5Form1+0x1d4): undefined reference to `Form1::itemSelected(int)'
collect2: ld returned 1 exit status

What is it and what is the way i should to use?

Wim Sturkenboom 12-23-2006 02:26 AM

It's a linker error indicating that the functions can not be found. Either the functions are Qt functions in which case you have to link libraries or you have written them yourself (or were supposed to download some more files) and you have not compiled/linked the files that contain these functions.

I'm not familiar with Qt, so can not for sure say what's wrong.

dimah 12-25-2006 03:34 AM

So, now it works. Thank you. But i have another problem now:
Program works ok, when it starts reading files, says that:

QTextBrowser: cannot decode /data/home/tig/Script_library/scripts/

Wim Sturkenboom 12-27-2006 09:57 AM

As said, I' don't know Qt. Read the documentation for the QTextBrowser widget (i.e. ).

My guess from above doc is that you probably have to tell it how to interprete files with extension 'sh' using the mimesourcefactory. But I might be completely wrong.

All times are GMT -5. The time now is 01:59 PM.