May 8, 2012

whoops whoops
Lab Rat
2 posts

build 32bit-only with qt 4.8.1 and xcode-4.3.2

 

I have a project that won’t build for x86_64. The reason is that the code casts pointers to 32bit integers, which works in 32bit mode but not in 64bit mode, so I get the error “uint32 loses precision”, so I am limited to compile in 32bit only, as I can’t patch the code.

My build system is osx 10.7 (lion), with xcode 4.3.2, and qt-4.8.1 built from source with arches i386 and x86_64.

No matter how I modify my project file, after running: qmake *.pro, the resulting Makefile contains the bad words: -arch x86_64 -Xarch_x86_64

I have tried the following:

  1. QT += network
  2. QT -= gui
  3. CONFIG += release thread static rtti link_prl
  4. macx {
  5.         CONFIG -= x86_64 ppc64
  6.         CONFIG += x86
  7.         ARCHES -= x86_64
  8.         ARCHES += i386
  9.         DEFINES += NO_KEY_T_DEFINED
  10.         LIBS += -framework CoreFoundation
  11.         DESTDIR = ../../../MY/ProgramFiles/MyApp.app/Contents/Resources/Data/
  12. }

I have used lipo -arch <qt archive paths> to verify they contain i386 and x86_64

[EDIT: code formatting, please wrap in @-tags, Volker]

2 replies

May 8, 2012

sierdzio sierdzio
Area 51 Engineer
2341 posts

Have you tried compiling Qt with -arch x86 only? I did that and get clean 32 bit builds.

 Signature 

(Z(:^

May 9, 2012

whoops whoops
Lab Rat
2 posts

I tried compiling Qt with -arch x86 only. That worked. I used the resulting qt to build a project with ARCH i386. But I was not able to run the resulting APP on lion. I haven’t figured that out yet. But my initial question still stands, What do I feed a .pro, for: qmake my.pro to create a Makefile that only builds i386 targets.

 
  ‹‹ Qt 3.2.1 Embedded: Redefinition of ‘const QString& device’ Error      [SOLVED] (Beginner) Help for Installation of Qt 4.8.1 ››

You must log in to post a reply. Not a member yet? Register here!