I have just upgraded XCode 3.x to 4.0 and ran into following build error.
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
I tried juggling around this error but couldn't get rid of it. Does anyone know fix for this please?
Complete error message:
Ld
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/myApp.app/myApp
normal armv7 cd "/xcode -
svn/TheAppStudio/TheAppStudio" setenv
IPHONEOS_DEPLOYMENT_TARGET 4.2 setenv
PATH
"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2
-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
-L/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos
-F/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos
-filelist /Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp.LinkFileList
-dead_strip -all_load -ObjC -miphoneos-version-min=4.2 -framework Foundation -framework UIKit -framework
CoreGraphics -framework QuartzCore
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20.a
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20Core.a
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20Network.a
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20Style.a
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20UI.a
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20UICommon.a
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20UINavigator.a
-framework Security -framework SystemConfiguration -framework
MessageUI -framework AVFoundation
-framework MediaPlayer -framework CoreLocation -framework CoreLocation
-framework MapKit -framework CFNetwork -framework AudioToolbox -lz.1.2.3 -framework MobileCoreServices -lxml2 -o /Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/myApp.app/myApp
arm-apple-darwin10-gcc-4.2.1:
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20.a:
No such file or directory
arm-apple-darwin10-gcc-4.2.1:
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20Core.a:
No such file or directory
arm-apple-darwin10-gcc-4.2.1:
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20Network.a:
No such file or directory
arm-apple-darwin10-gcc-4.2.1:
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20Style.a:
No such file or directory
arm-apple-darwin10-gcc-4.2.1:
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20UI.a:
No such file or directory
arm-apple-darwin10-gcc-4.2.1:
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20UICommon.a:
No such file or directory
arm-apple-darwin10-gcc-4.2.1:
/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-ddoknnyqnanytlcpbqpazmjjqbpx/Build/Products/Debug-iphoneos/libThree20UINavigator.a:
No such file or directory Command
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2
failed with exit code 1
Thanks.
PS: I tried cleaning up the solution and also verified Library Search path is the same as another machine where it works fine.
I have sorted this out. The situation was littel bit weird. The three20 libraries base SDK was setup to iphonesimulator and hence, it was generating *.a files for simulator path ..../Debug-iphonesimulator but my project was trying to look them on .../Debug-iphoneos path. The three20 library wasn't allowing me to build for iPhone unless I had removed iphonesimulator from supported platform and changed base SDK to iphones. Rebuild all three20 projects individually and then it worked fine!!
If cleaning the target in Xcode didn't work, try just trashing the build directory that's in your DerivedData folder for that app.
Related
I'm having trouble getting Qt to statically link its libraries when cross compiling from my Linux machine to windows. I added this to my config to make compile statically.
win32:CONFIG += -static
And by looking at the output of make it seems to have passed the flags correctly (omitting object files to make it short)
i686-w64-mingw32-g++ -static -static-libstdc++ -static-libgcc -Wl,-subsystem,windows -mthreads [exe and object files] /usr/i686-w64-mingw32/lib/libQt5Widgets.dll.a -ldwmapi -luxtheme /usr/i686-w64-mingw32/lib/libQt5Gui.dll.a -lopengl32 -lgdi32 -lcomdlg32 -loleaut32 -limm32 -ljpeg -lpng -L/usr/i686-w64-mingw32/lib -lfreetype -lbz2 -lharfbuzz -lm -lintl -lglib-2.0 -lshlwapi -lpcre -lgraphite2 /usr/i686-w64-mingw32/lib/libQt5Core.dll.a -lz -lpcre2-16 -liconv -lversion -lnetapi32 -luserenv -lole32 -luuid -lwinmm -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 /usr/i686-w64-mingw32/lib/libglu32.a /usr/i686-w64-mingw32/lib/libopengl32.a /usr/i686-w64-mingw32/lib/libgdi32.a /usr/i686-w64-mingw32/lib/libuser32.a -lmingw32 /usr/i686-w64-mingw32/lib/libqt5main.a -lshell32
As you can see the static flags are being passed to the compiler correctly, however I tried running the resulting exe in both WINE, and on a windows machine but in both cases it tells me that it failed to find the Qt dlls. The wine error log had more info so that's the one im providing
0009:err:module:import_dll Library Qt5Core.dll (which is needed by L"Z:\\home\\zee\\mapper\\release\\mapper.exe") not found
0009:err:module:import_dll Library Qt5Gui.dll (which is needed by L"Z:\\home\\zee\\mapper\\release\\mapper.exe") not found
0009:err:module:import_dll Library Qt5Widgets.dll (which is needed by L"Z:\\home\\zee\\mapper\\release\\mapper.exe") not found
0009:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\zee\\mapper\\release\\mapper.exe" failed, status c0000135
I'm running on an Arch Linux machine with the latest qt5base aur package (5.13.1), and the latest mignw package (g++ 9.2.0)
Your compiler command line has both static and dynamic libraries. For instance: "/usr/i686-w64-mingw32/lib/libQt5Core.dll.a" is the import library for the dynamic "Qt5Core.dll". The right file to be linked in static mode would be "libQt5Core.a". Your problem looks similar to this report of the mingw project: https://github.com/msys2/MINGW-packages/issues/4970
I'm porting my Qt app to Linux for x86 architecture, and since the last official release for that platform is 5.5, I'm trying to do my own build of Qt 5.11.3. I want to use fontconfig to enable use of system fonts. My build platform is Centos 7.5, and I'm using a GCC toolchain which builds x86 binaries with -m32 switch.
The problem is, I can't get it to see the fontconfig library. I've installed it with the package fontconfig-devel-2.13.0-4.3.el7.i686
When running configure with the option -fontconfig, I get the following error message:
ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && features.system-freetype && libs.fontconfig' failed.
My understanding from this is that I have to use -system-freetype and can't use -qt-freetype, but when I try that (also with -feature-freetype), I get this message:
ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed.
The relevant messages in config.log are:
looking for library freetype
Trying source 0 (type pkgConfig) of library freetype ...
pkg-config use disabled globally.
=> source produced no result.
Trying source 1 (type freetype) of library freetype ...
+ cd /home/myuser/qt-build/config.tests/freetype && /home/myuser/qt-build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" 'LIBS += -lfreetype' /home/myuser/qt-build/config.tests/freetype
+ cd /home/myuser/qt-build/config.tests/freetype && MAKEFLAGS= /usr/bin/gmake
> g++ -c -m32 -pipe -O2 -std=gnu++11 -w -fPIC -I. -I/home/myuser/qt-everywhere-src-5.11.3/qtbase/mkspecs/linux-g++-32 -o main.o main.cpp
> main.cpp:2:22: fatal error: ft2build.h: No such file or directory
> #include <ft2build.h>
> ^
> compilation terminated.
> gmake: *** [main.o] Error 1
=> source failed verification.
test config.qtbase_gui.libraries.freetype FAILED
Now, I do also get this message:
WARNING: Cross compiling without sysroot. Disabling pkg-config
which I understand is the source of the "source 0" failure. I have however tried to point configure manually point it to the freetype include directory, by passing FREETYPE_INCDIR=/usr/include/freetype2 to configure; however, as can be seen in the log file, the value does not seem to be used when detecting freetype.
Am I missing a trick here, or are the configure scripts broken? And if it's the latter, is there a way to work around this?
EDIT: For completeness, the environment for running configure:
CFLAGS=-m32
CXXFLAGS=-m32 --std=c++1x
Configure flags:
-opensource
-xplatform linux-g++-32
-nomake tests -nomake examples -nomake tools
-prefix /home/myuser/qt_install/
-qpa xcb
-no-use-gold-linker
-icu ICU_PREFIX=/home/myuser/icu_install ICU_LIBS="-licui18n -licuuc -licudata"
-no-opengl
-fontconfig -feature-freetype -system-freetype FREETYPE_INCDIR=/usr/include/freetype2
Try using the Freetype library that is included inside Qt's sources: when running configure use the flag "-qt-freetype"
I've found it's possible to work around this by setting CPATH (and LIBRARY_PATH to point at a specific build of Freetype which it turned out I needed as well). It looks like the fact that FREETYPE_* variables are ignored when detecting the presence of Freetype is indeed a bug in the config scripts.
Has anyone experienced this and might have a work around:
g++ -arch i386 -o build/osx/runtime/libtideutils.dylib -m32 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -lstdc++ -mmacosx-version-min=10.7 -install_name libtideutils.dylib -dynamiclib build/osx/objs/libtideutils/utils/app_manifest.os build/osx/objs/libtideutils/utils/application.os build/osx/objs/libtideutils/utils/boot_utils.os build/osx/objs/libtideutils/utils/data_utils.os build/osx/objs/libtideutils/utils/environment_utils.os build/osx/objs/libtideutils/utils/file_utils.os build/osx/objs/libtideutils/utils/platform_utils.os build/osx/objs/libtideutils/utils/url_utils.os build/osx/objs/libtideutils/utils/poco/KDigestEngine.os build/osx/objs/libtideutils/utils/poco/KMD5Engine.os build/osx/objs/libtideutils/utils/osx/boot_utils_osx.os build/osx/objs/libtideutils/utils/osx/file_utils_osx.os build/osx/objs/libtideutils/utils/osx/osx_utilscons: * [build/osx/runtime/libtideutils.dylib] Resource temporarily unavailable
s.os build/osx/objs/libtideutils/utils/osx/platform_utils_osx.os build/osx/objs/libtideutils/utils/posix/file_utils_posix.os build/osx/objs/libtideutils/utils/posix/posix_utils.os -Lbuild/osx -Lthirdparty-osx-x86-v2/boost/lib -Lthirdparty-osx-x86-v2/poco/lib -lboost_system-mt -lboost_thread-mt -lPocoFoundation -lPocoNet -lPocoUtil -lPocoXML -lPocoZip -lPocoData -lPocoSQLite -framework Foundation -framework IOKit -framework Cocoa -framework SystemConfiguration -framework CoreServices
scons: building terminated because of errors.
Building with latest scons and current "develop" branch of tidesdk on 10.8.2. It was working before, but all of a sudden it has now started giving me the above error everytime.
We recommend that you build from TideSDK master. As the 'develop' name implies, this is the development branch that is not stable nor supported for users.
TideSDK is complex software and this branch is utilized by the SDK's developers that generally work in c++ and python. Significant and substantial changes are occurring in the software. If you are interested in contributing to the development of the SDK, please drop by #tidesdk on freenode.
I have MSYS installed and I am trying to compile Qt 4.8.0 as a set of static libraries on Windows 8. I've got the libraries built and unfortunately when building the Qt tools, I get this error:
$ g++ -Wl,-s -Wl,-subsystem,console -mthreads -o ../../../bin/uic3.exe object_s
cript.uic3.Release -L'd:/qt/lib' -L'd:/qt/lib' -lQt3Support -lQtSql -lQtXml -l
QtGui -lQtNetwork -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lms
img32 -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
-lssleay32 -llibeay32
d:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: final link
failed: Permission denied
collect2: ld returned 1 exit status
For some strange reason, I'm getting a weird error about permissions - but I've double-checked that g++ has write access to the folder in question. I've tried creating the file uic3.exe in the output folder and sure enough, g++ deletes it and tries to create the file but fails again.
So I tried running MSYS under an administrator account - still it refused to compile. There is plenty of disk space, so I doubt any sort of disk problem is to blame. I tried running g++ with the -v option to get some more details, but there was no further information provided.
What could cause this error?
Edit: I've tried writing the output file to different locations (by modifying the -o parameter) and it still reports the same error.
Anti-virus software could cause this, including Microsoft Security Essentials. Disable them!
And, make sure you open MSYS console with administrator priviledges.
I added FMDB to my project then added the frameworks libsqlite3.dylib and libsqlite3.0.dylib, but I still get the build error. If I remove the FMDB classes from my project then it builds just fine. What other things should I check?
Detailed info on the error:
Ld /Users/gmi/Library/Developer/Xcode/DerivedData/iNROMockUp5->gjmgpakyszrgwbbxnkdxehexacxm/Build/Products/Debug->iphonesimulator/iNROMockUp5.app/iNROMockUp5 normal i386
cd /iOSDev/Testing/iNROMockUp5
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH >"/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bi>n:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 >-isysroot >/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk ->L/Users/gmi/Library/Developer/Xcode/DerivedData/iNROMockUp5->gjmgpakyszrgwbbxnkdxehexacxm/Build/Products/Debug-iphonesimulator ->F/Users/gmi/Library/Developer/Xcode/DerivedData/iNROMockUp5->gjmgpakyszrgwbbxnkdxehexacxm/Build/Products/Debug-iphonesimulator -filelist >/Users/gmi/Library/Developer/Xcode/DerivedData/iNROMockUp5->gjmgpakyszrgwbbxnkdxehexacxm/Build/Intermediates/iNROMockUp5.build/Debug->iphonesimulator/iNROMockUp5.build/Objects-normal/i386/iNROMockUp5.LinkFileList -mmacosx->version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lsqlite3 -lsqlite3.0 -framework >MapKit -framework UIKit -framework Foundation -framework CoreGraphics -o >/Users/gmi/Library/Developer/Xcode/DerivedData/iNROMockUp5->gjmgpakyszrgwbbxnkdxehexacxm/Build/Products/Debug->iphonesimulator/iNROMockUp5.app/iNROMockUp5
ld: duplicate symbol _main in /Users/gmi/Library/Developer/Xcode/DerivedData/iNROMockUp5->gjmgpakyszrgwbbxnkdxehexacxm/Build/Intermediates/iNROMockUp5.build/Debug->iphonesimulator/iNROMockUp5.build/Objects-normal/i386/fmdb.o and >/Users/gmi/Library/Developer/Xcode/DerivedData/iNROMockUp5->gjmgpakyszrgwbbxnkdxehexacxm/Build/Intermediates/iNROMockUp5.build/Debug->iphonesimulator/iNROMockUp5.build/Objects-normal/i386/main.o for architecture i386
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed >with exit code 1
ld: duplicate symbol _main in /Users/gmi/Library/Developer/Xcode/DerivedData/iNROMockUp5->gjmgpakyszrgwbbxnkdxehexacxm/Build/Intermediates/iNROMockUp5.build/Debug->iphonesimulator/iNROMockUp5.build/Objects-normal/i386/fmdb.o and >/Users/gmi/Library/Developer/Xcode/DerivedData/iNROMockUp5->gjmgpakyszrgwbbxnkdxehexacxm/Build/Intermediates/iNROMockUp5.build/Debug->iphonesimulator/iNROMockUp5.build/Objects-normal/i386/main.o for architecture i386
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
Remove fmdb.m from your project and you will be fine.
Remove main.m from your project and you will be fine.