Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, August 2007
Mac/Qt 4.3/Xcode - undefined symbols - QString::fromAscii_helper


Message 1 in thread

Hello folks,

First off, I'm new to this list and I'm looking forward to useful
discussions on this list. :)

Today I downloaded and compiled Qt 4.3 (open source edition) on my
MacBook running Mac OS X 10.4.10. Qt compiles fine and everything
looks normal to the point where I want to compile a little test app I
wrote.

I took the chat example that comes with Qt to see if the problem is
specific to my code/project. The chat example causes the same problem.

I used qmake -spec macx-xcode to create a Xcode project file, which
allows me to compile/debug and run my code in Apple's IDE.

Compiling from console by using qmake and make works fine. The app
builds and runs.

An attempt to compile the very same code from Xcode brings up the following:
---
Ld /Users/bbense/Desktop/chat/build/Debug/chat.app/Contents/MacOS/chat
normal i386
    mkdir /Users/bbense/Desktop/chat/build/Debug/chat.app/Contents/MacOS
    cd /Users/bbense/Desktop/chat
    /usr/bin/g++-4.0 -o
/Users/bbense/Desktop/chat/build/Debug/chat.app/Contents/MacOS/chat
-L/Users/bbense/Desktop/chat/build/Debug
-L/usr/local/Trolltech/Qt-4.3.0/lib -L/System/Library/Frameworks
-F/Users/bbense/Desktop/chat/build/Debug -filelist
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/chat.LinkFileList
-framework QtGui -framework Carbon -framework QuickTime -framework
QtNetwork -framework QtCore -framework ApplicationServices -arch i386
-prebind -Wl,-Y,1455 -headerpad_max_install_names
-L/usr/local/Trolltech/Qt-4.3.0/lib -lz -lm
/usr/bin/ld: warning prebinding disabled because dependent library:
QtGui.framework/Versions/4.0/QtGui is not prebound
/usr/bin/ld: Undefined symbols:
QMessageBox::information(QWidget*, QString const&, QString const&,
QFlags<QMessageBox::StandardButton>, QMessageBox::StandardButton)
qHash(QHostAddress const&)
QString::fromAscii_helper(char const*, int)
QListData::detach2()
QApplication::QApplication(int&, char**, int)
QNetworkInterface::allInterfaces()
QNetworkInterface::QNetworkInterface(QNetworkInterface const&)
QNetworkInterface::~QNetworkInterface()
QNetworkAddressEntry::QNetworkAddressEntry(QNetworkAddressEntry const&)
QNetworkAddressEntry::~QNetworkAddressEntry()
QNetworkInterface::addressEntries() const
QNetworkAddressEntry::ip() const
QNetworkAddressEntry::broadcast() const
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/chatdialog.o
reference to undefined QMessageBox::information(QWidget*, QString
const&, QString const&, QFlags<QMessageBox::StandardButton>,
QMessageBox::StandardButton)
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/client.o
reference to undefined qHash(QHostAddress const&)
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/client.o
reference to undefined QString::fromAscii_helper(char const*, int)
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/client.o
reference to undefined QListData::detach2()
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/connection.o
reference to undefined QString::fromAscii_helper(char const*, int)
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/main.o
reference to undefined QApplication::QApplication(int&, char**, int)
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined QNetworkInterface::allInterfaces()
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined
QNetworkInterface::QNetworkInterface(QNetworkInterface const&)
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined QNetworkInterface::~QNetworkInterface()
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined
QNetworkAddressEntry::QNetworkAddressEntry(QNetworkAddressEntry
const&)
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined QNetworkAddressEntry::~QNetworkAddressEntry()
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined QString::fromAscii_helper(char const*, int)
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined QListData::detach2()
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined QNetworkInterface::addressEntries() const
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined QNetworkAddressEntry::ip() const
/Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/Objects-normal/i386/peermanager.o
reference to undefined QNetworkAddressEntry::broadcast() const
collect2: ld returned 1 exit status
---

Has someone seen this or something similar before? Any help would be
highly appreciated. :)

-- 
 [ signature omitted ] 

Message 2 in thread

I can't find any indication in the command shown, that the linking  
command include
the directory containing the Qt frameworks in the framework search  
paths:
  -F/usr/local/Trolltech/Qt-4.3.0/lib
This indicates an error in your qmake project file.
On 6 aug 2007, at 14.30, Bastian Bense wrote:

> Hello folks,
>
> First off, I'm new to this list and I'm looking forward to useful
> discussions on this list. :)
>
> Today I downloaded and compiled Qt 4.3 (open source edition) on my
> MacBook running Mac OS X 10.4.10. Qt compiles fine and everything
> looks normal to the point where I want to compile a little test app I
> wrote.
>
> I took the chat example that comes with Qt to see if the problem is
> specific to my code/project. The chat example causes the same problem.
>
> I used qmake -spec macx-xcode to create a Xcode project file, which
> allows me to compile/debug and run my code in Apple's IDE.
>
> Compiling from console by using qmake and make works fine. The app
> builds and runs.
>
> An attempt to compile the very same code from Xcode brings up the  
> following:
> ---
> Ld /Users/bbense/Desktop/chat/build/Debug/chat.app/Contents/MacOS/chat
> normal i386
>     mkdir /Users/bbense/Desktop/chat/build/Debug/chat.app/Contents/ 
> MacOS
>     cd /Users/bbense/Desktop/chat
>     /usr/bin/g++-4.0 -o
> /Users/bbense/Desktop/chat/build/Debug/chat.app/Contents/MacOS/chat
> -L/Users/bbense/Desktop/chat/build/Debug
> -L/usr/local/Trolltech/Qt-4.3.0/lib -L/System/Library/Frameworks
> -F/Users/bbense/Desktop/chat/build/Debug -filelist
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/chat.LinkFileList
> -framework QtGui -framework Carbon -framework QuickTime -framework
> QtNetwork -framework QtCore -framework ApplicationServices -arch i386
> -prebind -Wl,-Y,1455 -headerpad_max_install_names
> -L/usr/local/Trolltech/Qt-4.3.0/lib -lz -lm
> /usr/bin/ld: warning prebinding disabled because dependent library:
> QtGui.framework/Versions/4.0/QtGui is not prebound
> /usr/bin/ld: Undefined symbols:
> QMessageBox::information(QWidget*, QString const&, QString const&,
> QFlags<QMessageBox::StandardButton>, QMessageBox::StandardButton)
> qHash(QHostAddress const&)
> QString::fromAscii_helper(char const*, int)
> QListData::detach2()
> QApplication::QApplication(int&, char**, int)
> QNetworkInterface::allInterfaces()
> QNetworkInterface::QNetworkInterface(QNetworkInterface const&)
> QNetworkInterface::~QNetworkInterface()
> QNetworkAddressEntry::QNetworkAddressEntry(QNetworkAddressEntry  
> const&)
> QNetworkAddressEntry::~QNetworkAddressEntry()
> QNetworkInterface::addressEntries() const
> QNetworkAddressEntry::ip() const
> QNetworkAddressEntry::broadcast() const
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/chatdialog.o
> reference to undefined QMessageBox::information(QWidget*, QString
> const&, QString const&, QFlags<QMessageBox::StandardButton>,
> QMessageBox::StandardButton)
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/client.o
> reference to undefined qHash(QHostAddress const&)
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/client.o
> reference to undefined QString::fromAscii_helper(char const*, int)
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/client.o
> reference to undefined QListData::detach2()
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/connection.o
> reference to undefined QString::fromAscii_helper(char const*, int)
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/main.o
> reference to undefined QApplication::QApplication(int&, char**, int)
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined QNetworkInterface::allInterfaces()
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined
> QNetworkInterface::QNetworkInterface(QNetworkInterface const&)
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined QNetworkInterface::~QNetworkInterface()
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined
> QNetworkAddressEntry::QNetworkAddressEntry(QNetworkAddressEntry
> const&)
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined QNetworkAddressEntry::~QNetworkAddressEntry()
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined QString::fromAscii_helper(char const*, int)
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined QListData::detach2()
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined QNetworkInterface::addressEntries() const
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined QNetworkAddressEntry::ip() const
> /Users/bbense/Desktop/chat/build/chat.build/Debug/chat.build/ 
> Objects-normal/i386/peermanager.o
> reference to undefined QNetworkAddressEntry::broadcast() const
> collect2: ld returned 1 exit status
> ---
>
> Has someone seen this or something similar before? Any help would be
> highly appreciated. :)
>
> -- 
> Best regards,
> Bastian Bense
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>

-----------------------------------------------------
An astronomer to a colleague:
-I can't understsnad how you can go to the brothel as often as you  
do. Not only is it a filthy habit, but it must cost a lot of money too.
-Thats no problem. I've got a big government grant for the study of  
black holes.
Tommy Nordgren
tommy.nordgren@xxxxxxxxx



--
 [ signature omitted ] 

Message 3 in thread

Hello again,

this is weird because "qmake" and "make" compile and link the app just
fine. I'd guess that the .xcodeproj file that is generated by "qmake
-spec macx-xcode" is probably buggy and does not contain a needed
configuration parameter.

I'll look into this and see if I can solve this by myself. Any tips or
hints would be helpful, though. :)



2007/8/7, Tommy Nordgren <tommy.nordgren@xxxxxxxxx>:
> I can't find any indication in the command shown, that the linking
> command include
> the directory containing the Qt frameworks in the framework search
> paths:
>   -F/usr/local/Trolltech/Qt-4.3.0/lib
> This indicates an error in your qmake project file.
> On 6 aug 2007, at 14.30, Bastian Bense wrote:

-- 
 [ signature omitted ] 

Message 4 in thread

After installation, do you change the .profile and give in the PATH 
variable?
Bastian Bense wrote:
> Hello again,
>
> this is weird because "qmake" and "make" compile and link the app just
> fine. I'd guess that the .xcodeproj file that is generated by "qmake
> -spec macx-xcode" is probably buggy and does not contain a needed
> configuration parameter.
>
> I'll look into this and see if I can solve this by myself. Any tips or
> hints would be helpful, though. :)
>
>
>
> 2007/8/7, Tommy Nordgren <tommy.nordgren@xxxxxxxxx>:
>   
>> I can't find any indication in the command shown, that the linking
>> command include
>> the directory containing the Qt frameworks in the framework search
>> paths:
>>   -F/usr/local/Trolltech/Qt-4.3.0/lib
>> This indicates an error in your qmake project file.
>> On 6 aug 2007, at 14.30, Bastian Bense wrote:
>>     
>
>   


--
 [ signature omitted ] 

Message 5 in thread

It looks like I found the problem to this whole error thing.

The fact is that the linker is called differently from Xcode compared
to make. After some experimenting I went into Xcode's target settings
and removed "/usr/local/Trolltech/Qt-4.3.1/lib" from 'Library Search
Paths', then put that into 'Framework Search Paths'.

It seems as if there is a bug in the latest qmake spec for Qt 4.3.0
and 4.3.1 that causes this to get messed up. I opened a few older
.xcodeproj files and those have the search path settings filled out
correctly.

Is this a bug or something I have set up incorrectly?


Thanks in advance!

PS: When I compare the two mkspecs for Qt 4.2 and Qt 4.3 I see lots of
changes. I guess something went wrong at Trolltech when someone
updated the specfile...


-- 
 [ signature omitted ]