Cannot build Qt SDK from source on Mac OS X - macos

I've been trying to build the SDK statically on Mac OS X but I run into errors that don't make sense to me. Here is my configure command:
sh configure -static -opensource -universal
Then I build the framework using:
sudo make sub-src
The build process works well initially but after some time, I start getting errors like the ones below, there are hundred of these:
ranlib: for architecture: i386 file: /usr/local/Trolltech/Qt-4.7.1/lib/libQtScript.a(ARMAssembler.o) has no symbols
ranlib: for architecture: i386 file: /usr/local/Trolltech/Qt-4.7.1/lib/libQtScript.a(MacroAssemblerARM.o) has no symbols
Then after some time, the build process hits this command:
g++ -headerpad_max_install_names -Xarch_i386 -mmacosx-version-min=10.4 -Xarch_ppc -mmacosx-version-min=10.4 -arch i386 -arch ppc -all_load -o ../../../../bin/Assistant.app/Contents/MacOS/Assistant .obj/debug-static/fontpanel.o .obj/debug-static/aboutdialog.o .obj/debug-static/bookmarkdialog.o .obj/debug-static/bookmarkfiltermodel.o .obj/debug-static/bookmarkitem.o .obj/debug-static/bookmarkmanager.o .obj/debug-static/bookmarkmanagerwidget.o .obj/debug-static/bookmarkmodel.o .obj/debug-static/centralwidget.o .obj/debug-static/cmdlineparser.o .obj/debug-static/contentwindow.o .obj/debug-static/findwidget.o .obj/debug-static/filternamedialog.o .obj/debug-static/helpenginewrapper.o .obj/debug-static/helpviewer.o .obj/debug-static/indexwindow.o .obj/debug-static/installdialog.o .obj/debug-static/main.o .obj/debug-static/mainwindow.o .obj/debug-static/preferencesdialog.o .obj/debug-static/qtdocinstaller.o .obj/debug-static/remotecontrol.o .obj/debug-static/searchwidget.o .obj/debug-static/topicchooser.o .obj/debug-static/xbelsupport.o .obj/debug-static/collectionconfiguration.o .obj/debug-static/helpviewer_qtb.o .obj/debug-static/moc_fontpanel.o .obj/debug-static/moc_aboutdialog.o .obj/debug-static/moc_bookmarkdialog.o .obj/debug-static/moc_bookmarkfiltermodel.o .obj/debug-static/moc_bookmarkmanager.o .obj/debug-static/moc_bookmarkmanagerwidget.o .obj/debug-static/moc_bookmarkmodel.o .obj/debug-static/moc_centralwidget.o .obj/debug-static/moc_contentwindow.o .obj/debug-static/moc_findwidget.o .obj/debug-static/moc_filternamedialog.o .obj/debug-static/moc_helpenginewrapper.o .obj/debug-static/moc_indexwindow.o .obj/debug-static/moc_installdialog.o .obj/debug-static/moc_mainwindow.o .obj/debug-static/moc_preferencesdialog.o .obj/debug-static/moc_qtdocinstaller.o .obj/debug-static/moc_remotecontrol.o .obj/debug-static/moc_searchwidget.o .obj/debug-static/moc_topicchooser.o .obj/debug-static/moc_helpviewer_qtb.o .obj/debug-static/qrc_assistant.o .obj/debug-static/qrc_assistant_images.o -L/Users/laurent/.Trash/qt-src-4.7.1/lib -L/Users/laurent/.Trash/qt-src-4.7.1/plugins/sqldrivers -lQtHelp_debug -L/Users/laurent/.Trash/qt-src-4.7.1/lib -lQtCLucene_debug -L/usr/local/Trolltech/Qt-4.7.1/plugins/sqldrivers -lqsqlite_debug -lQtSql_debug -lQtXml_debug -lQtGui_debug -framework Carbon -framework AppKit -lQtNetwork_debug -framework SystemConfiguration -framework CoreFoundation -lQtCore_debug -lz -lm -framework ApplicationServices
which is followed by hundreds of these lines:
ld: warning: qt_noop() has different visibility (hidden) in /Users/laurent/.Trash/qt-src-4.7.1/lib/libQtHelp_debug.a(qhelpenginecore.o) and (default) in .obj/debug-static/fontpanel.o
ld: warning: QBool::operator void const*() consthas different visibility (hidden) in /Users/laurent/.Trash/qt-src-4.7.1/lib/libQtHelp_debug.a(qhelpenginecore.o) and (default) in .obj/debug-static/fontpanel.o
after that, I get many of these:
Undefined symbols for architecture ppc:
"QCLuceneStandardAnalyzer::QCLuceneStandardAnalyzer()", referenced from:
fulltextsearch::clucene::QHelpSearchIndexWriter::optimizeIndex() in libQtHelp_debug.a(qhelpsearchindexwriter_clucene.o)
fulltextsearch::clucene::QHelpSearchIndexWriter::run() in libQtHelp_debug.a(qhelpsearchindexwriter_clucene.o)
fulltextsearch::clucene::QHelpSearchIndexReaderClucene::boostSearchHits(QHelpEngineCore const&, QList >&, QList const&)in libQtHelp_debug.a(qhelpsearchindexreader_clucene.o)
fulltextsearch::clucene::QHelpSearchIndexReaderClucene::run() in libQtHelp_debug.a(qhelpsearchindexreader_clucene.o)
At that point, the build process stops with this error:
ld: symbol(s) not found for architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//cc5nBJvn.out (No such file or directory)
make[4]: *** [../../../../bin/Assistant.app/Contents/MacOS/Assistant] Error 1
make[3]: *** [sub-assistant-install_subtargets-ordered] Error 2
make[2]: *** [sub-tools-install_subtargets-ordered] Error 2
make[1]: *** [sub-assistant-install_subtargets-ordered] Error 2
make: *** [sub-tools-install_subtargets-ordered] Error 2
My config is Snow Leopard and I'm building from the source downloaded there:
http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.1.tar.gz
Can anybody see what could be the problem? I've been working on this for hours and can't figure it out, so I would really appreciate any advice.

Your problem:
ld: symbol(s) not found for architecture ppc
If you build for 10.6, AFAIK PPC is not supported. If you want to build for PPC, then you'll probably need to build for a different target version of OS X - 10.4 or 10.5.

Related

ld linking problem on Mac M1 arm64 architecture, using GNU11 compilers gcc, gfortran

I'm building a set of libraries on Mac M1 (arm64 architecture), Big Sur and use GNU11 compilers (gcc, gfortran, g++), as well as openmpi 4.1.2 for multi-processing. All is done as a command-line using a Terminal.app, which is running as Apple native, and NOT using Rosetta Translation. The steps taken: 1) GCC, g++, gfortran are installed using "brew install gcc#11", then symbolic links created in /opt/homebrew/bin/ for gcc -> gcc-11, g++ -> g++-11 ; 2) openmpi 4.1.2 installed, with mpicc based on gcc, mpixx based on g++, and mpifort/mpif90 based on gfortran; 3) command-line tools installed as "xcode-select --install".
Getting the problem with finally linking of the libraries:
...
/Users/Natalie/openmpi/bin/mpifort -L/opt/homebrew/opt/openssl#3/lib -fallow-argument-mismatch -fallow-invalid-boz -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -mmacosx-version-min=11.6 CMakeFiles/cmTC_9a888.dir/testFortranCompiler.f.o -o cmTC_9a888
Undefined symbols for architecture arm64:
"_sgemm_", referenced from:
_MAIN__ in testFortranCompiler.f.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make[1]: *** [cmTC_9a888] Error 1
make: *** [cmTC_9a888/fast] Error 2 ```

Gtk: build Gtk libs in Mavericks (Apple Mac OS) by compiling source code

I would like to use Gtk libs in a mac laptop. Its operation system is Mavericks. For my program, I don't care about Mac look and feel. For compiling my program, I don't like graphical interface but prefer to gcc and make command line tools (Linux style). Therefore, I don't want to install Gtk libs by installing Xcode (a monster taking too much space) plus port Gtk by macport. I prefer to compile source code to install Gtk libs. Followed are my steps.
Build gcc and make by installing Xcode command line tools commandlinetoolsosx10.9forxcode6.2.dmg from Apple Developer Website.
Build X development environment by installing XQuartz-2.7.8.dmg since X11 doesn't ship with Mac OS any more.
Download Gtk source packages and all its dependencies. I would install the packages in the order followed.
zlib-1.2.8 -> pkg-config-0.29 -> jpegsrc.v9a.tar.gz -> libpng-1.6.18 -> tiff-4.0.6 -> libiconv-1.14 -> gettext-0.19.6 -> freetype-2.6 -> fontconfig-2.11.94 -> libffi-3.2.1 -> pixman-0.33.4 -> cairo-1.14.4 -> glib-2.47.1 -> pango-1.38.1 -> atk-2.18.0 -> gdk-pixbuf-2.33.1 -> gtk+-2.24.28
Build environment variables for compilation.
GTK_DIR="$HOME/gtk"
CPPFLAGS="-I$GTK_DIR/include"
LDFLAGS="-L$GTK_DIR/lib"
PKG_CONFIG_PATH="$GTK_DIR/lib/pkgconfig"
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH
LD_LIBRARY_PATH="$GTK_DIR/lib"
PATH="$GTK_DIR/bin:$PATH"
export LD_LIBRARY_PATH PATH
The compilation for package pkg-config-0.29
LDFLAGS="-framework CoreFoundation -framework Carbon"
./configure --with-internal-glib --prefix=$GTK_DIR
make
make install
The compilation for package gtk+-2.24.28
CPPFLAGS="-I$GTK_DIR/include -I$GTK_DIR/include/cairo -I$GTK_DIR/include/gdk-pixbuf-2.0 -I$GTK_DIR/include/pango-1.0 -I$GTK_DIR/include/atk-1.0 -I$GTK_DIR/include/freetype2 -I$GTK_DIR/include/gio-unix-2.0 -I$GTK_DIR/include/glib-2.0 -I$GTK_DIR/lib/glib-2.0/include"
LD_LIBRARY_PATH="$GTK_DIR/lib"
./configure --prefix=$GTK_DIR
make
make install
The compilation for other packages
LD_LIBRARY_PATH="$GTK_DIR/lib"
./configure --prefix=$GTK_DIR
make
make install
The compilation for all packages except the last one gtk+-2.24.28 made it. The error when compiling gtk+-2.24.28 is
/bin/sh ../../libtool --tag=CC --mode=link gcc -g -O2 -Wall -export-dynamic -framework CoreFoundation -framework Carbon -L/Users/wu/gtk/lib -o builder builder.o ../../gdk/libgdk-x11-2.0.la ../../gtk/libgtk-x11-2.0.la -L/usr/X11/lib -lXrender -lX11 -lm
libtool: link: gcc -g -O2 -Wall -o .libs/builder builder.o -L/Users/wu/gtk/lib ../../gdk/.libs/libgdk-x11-2.0.dylib -L/usr/X11/lib ../../gtk/.libs/libgtk-x11-2.0.dylib /Users/wu/Downloads/gtk/src/gtk+-2.24.28/gdk/.libs/libgdk-x11-2.0.dylib -lXinerama /Users/wu/gtk/lib/libpangocairo-1.0.dylib /Users/wu/gtk/lib/libpango-1.0.dylib /Users/wu/gtk/lib/libgthread-2.0.dylib /Users/wu/gtk/lib/libgdk_pixbuf-2.0.dylib /Users/wu/gtk/lib/libgio-2.0.dylib -lresolv /Users/wu/gtk/lib/libgobject-2.0.dylib /Users/wu/gtk/lib/libffi.dylib /Users/wu/gtk/lib/libcairo.dylib /Users/wu/gtk/lib/libpixman-1.dylib /Users/wu/gtk/lib/libfontconfig.dylib -lexpat /Users/wu/gtk/lib/libfreetype.dylib -lbz2 /Users/wu/gtk/lib/libpng16.dylib -lz -lSM -lICE -lXext /Users/wu/gtk/lib/libgmodule-2.0.dylib /Users/wu/gtk/lib/libglib-2.0.dylib /Users/wu/gtk/lib/libintl.dylib /Users/wu/gtk/lib/libiconv.dylib -lc -lXrender -lX11 -lm -pthread -framework ApplicationServices -framework Carbon -framework CoreFoundation
clang: warning: argument unused during compilation: '-pthread'
Undefined symbols for architecture x86_64:
"_atk_object_ref_relation_set", referenced from:
_test_widget in builder.o
"_atk_relation_get_relation_type", referenced from:
_test_widget in builder.o
"_atk_relation_get_type", referenced from:
_test_widget in builder.o
"_atk_relation_set_get_n_relations", referenced from:
_test_widget in builder.o
"_atk_relation_set_get_relation", referenced from:
_test_widget in builder.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [builder] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
The error is a linking error about Undefined symbols for architecture x86_64. I googled the error and the suggestion is to set the right architecture in Xcode GUI. But it doesn't help since I don't have Xode GUI at all in laptop.
I also tried CC="gcc -arch i386", neither did it work. And I tried LDFLAGS="-framework CoreFoundation -framework Carbon -L$GTK_DIR/lib", neither did it work. For the last two try, I only recompiled the packages from cairo-1.14.4 to gtk+-2.24.28, not all the packages.
Any clues? Please help. Thank you.
Edit: using atk-2.20 solved the problem.
I was trying to do the same; adding -latk-1.0 to the LDFLAGS fixed the problem. It seems that the autotools/gcc/whatever is missing some lib/include flags. I have no idea why this is, but adding them in manually when calling ./configure works fine.
I think in this case that the complaint about the architecture is just a red herring.

How can I get the RInside example sandboxed_server to work on OS X Yosemite?

I'm having trouble getting the sandboxed_server example from RInside/examples/sandboxed_server working on xcode. I have OS X Yosemite 10.10.1.
I get the following error:
clang++ server/rinsideserver.o common/binarystream.o datatypes/bar.o datatypes/foo.o example_server.o -F/Library/Frameworks/R.framework/.. -framework R -llzma -lz -licucore -lm -liconv -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/Library/Frameworks/R.framework/Resources/lib -lRlapack /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RInside/lib/libRInside.a -o example_server
Undefined symbols for architecture x86_64:
"RInside::set_callbacks(Callbacks*)", referenced from:
_main in example_server.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [example_server] Error 1
Command /usr/bin/make failed with exit code 2
I have not been able to get any example that uses callbacks to work. Examples (from standard examples) that don't use callbacks do work.
I've uncommented #define RINSIDE_CALLBACKS in RInsideConfig.h. I've reinstalled the source files through R/CRAN from source- as was suggested on another post.
I did modify the code in sandboxed_server to get CLOCK_MONOTONIC to work on mac- but nothing other than that.
I'd really like to get this example working. Any help would be greatly appreciated!

Using SDL with xCode 4.5

I know there are several questions regarding this. I have looked through them all but still haven't found an answer.
I'm trying to use SDL with xCode on my Mac. I'm using xCode 4.5
I followed this tutorial exactly, twice! I even tried a second tutorial which was basically the same and it still didnt compile.
When i compile i get this error:
Ld /Users/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Products/Debug/SDL_SetUp normal x86_64
cd "/Users/shardy/Desktop/shardy/C++ Programs/GlutApps/SDL_SetUp"
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Products/Debug -F/Users/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Products/Debug -F/Library/Frameworks -filelist /Users/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Intermediates/SDL_SetUp.build/Debug/SDL_SetUp.build/Objects-normal/x86_64/SDL_SetUp.LinkFileList -mmacosx-version-min=10.7 -stdlib=libc++ -framework SDL -framework Cocoa -o /Users/shardy/Library/Developer/Xcode/DerivedData/SDL_SetUp-efqnmqdzqqtkktbodsopeytuwjxt/Build/Products/Debug/SDL_SetUp
Undefined symbols for architecture x86_64:
"_main", referenced from:
start in crt1.10.6.o
(maybe you meant: _SDL_main)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Followed by:
"_main", referenced from:
Start in crt1.10.6.o
(maybe you meant:_SDL_main)
Symbol(s) not found for architecture x86_64
Linker command failed with exit code 1 (use -v to see invocation)
I was originally using xCode 4.3 and it wouldnt compile, so i updated to xCode to 4.5 thinking maybe xCode was causing issues and tried everything again, but unfortunately, still did not compile...
I am not experienced enough to know how to fix this and i am out of relatable threads to read...
Thanks.

Openssl Mach-O linker error for architecture i386 and armv7

I am trying to implement openssl code I found into my project but I get these linker errors that aren't going away. I checked that the frameworks are properly linked and even included the library and header search paths manually using ../lib and ../include. Despite this the error goes away when I get rid of the Openssl function or any function calls such as EVP_OpenUpdate or EVP_OpenInit. This only if I create and then call the function from my ViewController.h file for some reason.
Here is the log of the error:
Ld /Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos/LineaSSL.app/LineaSSL normal armv7
cd /Users/User/Documents/LineaSSL
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
/iPhoneOS5.1.sdk -L/Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos -L/Users/User/Documents/LineaSSL/../../Desktop/x2on-OpenSSL-for-iPhone-a095890/OpenSSL-for-iOS/lib -L/Users/User/Documents/LineaSSL/../../Downloads/DTDevices-iOS_2012-06-15_v1/Library -L/Users/User/Documents/LineaSSL/OpenSSL-for-iOS/lib -L/Users/User/Documents/LineaSSL/lib -F/Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos -Finclude -Finclude/openssl -filelist /Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Intermediates/LineaSSL.build/Debug-iphoneos/LineaSSL.build/Objects-normal/armv7/LineaSSL.LinkFileList -dead_strip -miphoneos-version-min=4.0 -lcrypto -lssl -framework CoreGraphics -framework ExternalAccessory -framework Foundation -framework UIKit -ldtdev -o /Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos/LineaSSL.app/LineaSSL
ld: warning: ignoring file /Users/User/Desktop/x2on-OpenSSL-for-iPhone-a095890/OpenSSL-for-iOS/lib/libcrypto.a, file was built for archive which is not the architecture being linked (armv7)
ld: warning: ignoring file /Users/User/Desktop/x2on-OpenSSL-for-iPhone-a095890/OpenSSL-for-iOS/lib/libssl.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
"_rsa_open3", referenced from:
-[ViewController barcodeData:isotype:] in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please let me know what I should do in regards to this error.
Thanks in advance.
I had to rebuild the entire project from scratch in order to get it to work. I don't know why I had to do such a thing though.

Resources