-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/5/10 8:17 PM, Paul Cantalupo wrote:
> Hello,
> 
> I'm running Fink 0.29.15 on a MacBook Pro Snow Leopard. I tried running
> my first Qt3 program (Helloworld) and I'm getting the following linker
> error "ld: warning: in /sw/lib/libqt-mt.dylib, file was built for i386
> which is not the architecture being linked (x86_64)". What does this
> mean and how do I fix it? Why wouldn't Fink have compiled Qt3 properly
> during install?
> 
> Here is the complete output from 'make':
> 
> Orion:~/src pgc92$ make
> g++-4.2
> -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
> -prebind -o helloworld hello.o    -L/sw/lib -L/sw/lib/qt3/lib
> -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
> ld: warning: in /sw/lib/libqt-mt.dylib, file was built for i386 which is
> not the architecture being linked (x86_64)
> Undefined symbols:
>   "QGList::write(QDataStream&, void*) const", referenced from:
>       vtable for QGListin hello.o
>   "QApplication::QApplication(int&, char**)", referenced from:
>       _main in hello.o
>   "QGList::~QGList()", referenced from:
>       vtable for QGListin hello.o
>   "QString::shared_null", referenced from:
>       _main in hello.o
>       _main in hello.o
>   "QStringData::deleteSelf()", referenced from:
>       _main in hello.o
>       _main in hello.o
>   "QGList::~QGList()", referenced from:
>       vtable for QGListin hello.o
>   "typeinfo for QPtrCollection", referenced from:
>       typeinfo for QGListin hello.o
>   "QLabel::QLabel(QString const&, QWidget*, char const*, unsigned int)",
> referenced from:
>       _main in hello.o
>   "QGList::read(QDataStream&, void*&)", referenced from:
>       vtable for QGListin hello.o
>   "QGList::compareItems(void*, void*)", referenced from:
>       vtable for QGListin hello.o
>   "QPtrCollection::newItem(void*)", referenced from:
>       vtable for QGListin hello.o
>   "QApplication::exec()", referenced from:
>       _main in hello.o
>   "QApplication::~QApplication()", referenced from:
>       _main in hello.o
>       _main in hello.o
>   "QGList::clear()", referenced from:
>       vtable for QGListin hello.o
>   "QString::QString(char const*)", referenced from:
>       _main in hello.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> make: *** [helloworld] Error 1
> 
> 
> 
> Thank you for your help,
> 
> Paul
> 
> 
> 
> 
> Paul Cantalupo
> Research Specialist/Systems Programmer
> University of Pittsburgh
> 
> 

There's nothing wrong with your Fink setup.  I'm assuming that what's
going on is that your Fink is 32-bit (you didn't specify).  Apple's
compilers on Snow Leopard build as 64-bit by default, so your test
example is expecting to link to 64-bit libraries.

The fix is mentioned in

http://www.finkproject.org/faq/usage-general.php?phpLang=en#compile-myself

specifically,

export PATH=/sw/var/lib/fink/path-prefix-10.6:$PATH

which puts special scripts that wrap the compilers with
architecture-appropriate flags at the head of the PATH.  That way your
"gcc42" will know to build as 32-bit.
- -- 
Alexander Hansen, Ph.D.
Fink User Liaison
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzUoXkACgkQB8UpO3rKjQ9IagCgjjCBp0o5DYlUE4l2Iigj5xcb
NO4An1GJKf+xNEAN/7RQ18Gld7HNIi49
=uDjl
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Fink-beginners mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.beginners

Reply via email to