Re: Building ObjC and C++ fails on 10.2
Re: Building ObjC and C++ fails on 10.2
- Subject: Re: Building ObjC and C++ fails on 10.2
- From: Benjamin Golinvaux <email@hidden>
- Date: Mon, 2 Sep 2002 14:21:59 +0200
hi john
i had lots of trouble converting our project (to 10.2 with gcc 3.1)
which uses a lot of .CPP, .MM and .M files
but now i'm happy. it works better than before. here's what i've done :
I have created GlobalPrecomp.h
In this file, I include every system header + our own headers (the ones
that do not change often). The trick is to put objc only (.MM and .M) in
#ifdef __OBJC__ blocks, and C++ only headers (.CPP and .MM) in
#ifdef __cplusplus blocks.
(for example, I have Cocoa.h, Carbon.h, QuickTime.h, iostream etc in
this header)
1) I choose this file to be the prefix header
2) I click on 'precompile it'
3) in gcc settings, i choose "use PFE"
4) i'm not using any special flag like -cpp-precomp
And now it is really fast (more than 800% speed increase wrt not using
precomps)
Hope this helps
Benjamin
On Friday, August 30, 2002, at 09:18 PM, John Nairn wrote:
After upgrading to 10.2, I can no longer build one of my projects that
mixes ObjC and C++. The project has both Obj C files (.m) and mixed
files (.mm). The extra compiler flags are "-cpp-precomp". It fails in
both GCC 2.95 and 3.1. The only error messages is "Build Failed (see
log for details)." Here is the build log which is failing to find a
file i do not recognize?
CompileCplusplus
/Users/jnairn/Programming/Cocoa_Projects/ScienceCocoa/build/
ScienceCocoa.build/Microcracking.build/Objects-normal/ppc/
CommandDocument.o
cc1objplus: CommandDocument.mii: No such file or directory
/usr/bin/g++3 -c
-F/Users/jnairn/Programming/Cocoa_Projects/ScienceCocoa/build
-I/Users/jnairn/Programming/Cocoa_Projects/ScienceCocoa/build/include
-IGeneric "-arch" "ppc" "-fno-common" "-fpascal-strings" "-O0"
"-Wmost" "-Wno-four-char-constants" "-Wno-unknown-pragmas"
"-cpp-precomp" "-pipe" "-fmessage-length=0" "-mdynamic-no-pic" "-g"
"-precomp-trustfile"
"/Users/jnairn/Programming/Cocoa_Projects/ScienceCocoa/build/
ScienceCocoa.build/Microcracking.build/TrustedPrecomps.txt"
"-Wp,-header-mapfile,/Users/jnairn/Programming/Cocoa_Projects/
ScienceCocoa/build/ScienceCocoa.build/Microcracking.build/
ScienceCocoa.hmap" Generic/CommandDocument.mm -o
/Users/jnairn/Programming/Cocoa_Projects/ScienceCocoa/build/
ScienceCocoa.build/Microcracking.build/Objects-normal/ppc/
CommandDocument.o
...failed CompileCplusplus
/Users/jnairn/Programming/Cocoa_Projects/ScienceCocoa/build/
ScienceCocoa.build/Microcracking.build/Objects-normal/ppc/
CommandDocument.o ...
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.