PDA

View Full Version : Configuring QT4 with STL Compatibility



shynthriir
December 5th, 2009, 03:06 AM
Attempting to use functions fromStdString and toStdString, but according to the QT4 docs:

"This constructor is only available if Qt is configured with STL compatibility enabled."

I've looked through the docs and searched a bit online, but can't find out HOW to enable STL compatibility.

haTem
December 5th, 2009, 09:35 AM
I think it is done by passing the appropriate configure flag while compiling qt4. Based on some searching, it looks like you can either pass -stl or -no-stl to ./configure.

What operating system/packages are you using? I believe STL compatibility has been enabled on pretty much everything I've used qt4 on.

shynthriir
December 5th, 2009, 12:06 PM
Ubuntu 9.10
g++ 4.4.1
QMake 2.01a
QT4 4.5.2

Tried doing just ./configure and just configure with the -stl tag along with each, but in first case, that implies I have an executable to run in my current directory, so if that's the case, where must I run that command. Second, if the ./ doesn't need to be there, then it should be a program or something, which it doesn't seem to be either.

haTem
December 5th, 2009, 08:55 PM
Ubuntu 9.10 has STL compatibility enabled for qt4, it works on my system. What errors do you get when you try to use fromStdString and toStdString?

STL compatibility has to be enabled while compiling the qt4 library itself, not from your individual project's directory. So you would have to rebuild the packages supplied by Ubuntu to enable it. However, I'm using the exact same packages (on Ubuntu 9.10) and STL compatibility is enabled, so this is most likely not your problem.