Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

macos - Integrating gcc 4.8 with Xcode 4.x

I am trying to use OpenMP in a objective-c++ program.
Unfortunately llvm-gcc 4.2 seems to have serious bug when working with OpenMP. According to my researches, the best solution should be using gcc 4.8 instead.

I already downloaded a prebuilt version of gcc 4.8. My question is: how can I integrate the new compiler with Xcode, so that I can select it directly in Build Settings from Xcode?
Alternatively, is there an easy way I can compile my project with gcc4.8? I have different files and a .xib, I really do not want to compile all of them by hand.

I'm using MacOS 10.8.3 and Xcode 4.5.1 (though I think the procedure should be the same for all Xcode 4.x).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In Xcode, in your project, select the project (the root of the files, with the blue icon). In the view that opens, select the project again, then select the tab "Build Settings".

Search here the entry "Compiler for C/C++/Objective-C (there is a search box above the table view). Edit the value and set a custom path (by selecting "Other…") to the gcc you downloaded.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...