简体   繁体   English

核心图配置错误

[英]Core-plot configuration error

I am trying to use core-plot and I followed the instruction from the following project page to use it. 我正在尝试使用core-plot,并且按照以下项目页面上的说明进行操作。

http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications , which is http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications ,即

You can install the SDK with a standard Mac installer package, or by hand. 您可以使用标准Mac安装程序包或手动安装SDK。 Here is how you install by hand. 这是手工安装的方法。

  1. Copy the CorePlotSDK directory to ~/Library/SDKs/ 将CorePlotSDK目录复制到〜/ Library / SDKs /

  2. Add to your project's .PCH file: 添加到项目的.PCH文件中:

    #import < CorePlot/CorePlot.h > #import <CorePlot / CorePlot.h>

  3. Open Project -> Edit Project Settings and for All Configurations: 打开项目->编辑项目设置,然后对于所有配置:

3a. 3A。 Add to Additional SDKS: $HOME/Library/SDKs/CorePlotSDK/${PLATFORM_NAME}.sdk 添加到其他SDK中:$ HOME / Library / SDKs / CorePlotSDK / $ {PLATFORM_NAME} .sdk

3b. 3B。 Add to Other Linker Flags: -ObjC -all_load -lCorePlot 添加到其他链接器标志:-ObjC -all_load -lCorePlot

  1. Add the QuartzCore framework to the project. 将QuartzCore框架添加到项目中。

  2. Add a CPGraph to your application. 将CPGraph添加到您的应用程序。

I went with the SDK install options: I installed it with Mac installer Package, it got installed in the following location /Library/SDKs/iphoneos.sdk and /Library/SDKs/iphonesimulator.sdk 我使用了SDK安装选项:我使用Mac安装程序Package进行安装,它安装在以下位置/Library/SDKs/iphoneos.sdk和/Library/SDKs/iphonesimulator.sdk

Then i did step 2 as mentioned. 然后我按照步骤2进行操作。

For 3a i added /Library/SDKs/iphonesimulator.sdk 对于3a,我添加了/Library/SDKs/iphonesimulator.sdk

Then i did 3b and then 4. 然后我做了3b然后4。

After that I tried to do a build and see how does it works and i get the following errors: 之后,我尝试进行构建,并查看其工作原理,并出现以下错误:

:1:0 :1:1: warning: "__IPHONE_OS_VERSION_MIN_REQUIRED" redefined :1:0:1:1:警告:“ __ IPHONE_OS_VERSION_MIN_REQUIRED”已重新定义

:1:0 :1:1: warning: this is the location of the previous definition :1:0:1:1:警告:这是先前定义的位置

/var/folders/+r/+rBG+BziF1OqK12XNyw1ak+++TM/-Caches-/com.apple.Xcode.502/CompositeSDKs/iphonesimulator-iPhoneSimulator4.1-cztutytisanvsqaptkdkpoyyctln/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:0 /var/folders/+r/+rBG+BziF1OqK12XNyw1ak+++TM/-Caches-/com.apple.Xcode.502/CompositeSDKs/iphonesimulator-iPhoneSimulator4.1-cztutytisanvsqaptkdkpoyyctln/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250: error: syntax error before '^' token /var/folders/+r/+rBG+BziF1OqK12XNyw1ak+++TM/-Caches-/com.apple.Xcode.502/CompositeSDKs/iphonesimulator-iPhoneSimulator4.1-cztutytisanvsqaptkdkpoyyctln/System/Library/Frameworks/UIKit.framework/Headers /UIView.h:250:0 /var/folders/+r/+rBG+BziF1OqK12XNyw1ak+++TM/-Caches-/com.apple.Xcode.502/CompositeSDKs/iphonesimulator-iPhoneSimulator4.1-cztutytisanvsqaptkdkpoyyctln/System/Library /Frameworks/UIKit.framework/Headers/UIView.h:250:错误:“ ^”令牌之前的语法错误

/var/folders/+r/+rBG+BziF1OqK12XNyw1ak+++TM/-Caches-/com.apple.Xcode.502/CompositeSDKs/iphonesimulator-iPhoneSimulator4.1-cztutytisanvsqaptkdkpoyyctln/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:0 /var/folders/+r/+rBG+BziF1OqK12XNyw1ak+++TM/-Caches-/com.apple.Xcode.502/CompositeSDKs/iphonesimulator-iPhoneSimulator4.1-cztutytisanvsqaptkdkpoyyctln/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250: error: 'type name' declared as function returning a function /var/folders/+r/+rBG+BziF1OqK12XNyw1ak+++TM/-Caches-/com.apple.Xcode.502/CompositeSDKs/iphonesimulator-iPhoneSimulator4.1-cztutytisanvsqaptkdkpoyyctln/System/Library/Frameworks/UIKit.framework/Headers /UIView.h:250:0 /var/folders/+r/+rBG+BziF1OqK12XNyw1ak+++TM/-Caches-/com.apple.Xcode.502/CompositeSDKs/iphonesimulator-iPhoneSimulator4.1-cztutytisanvsqaptkdkpoyyctln/System/Library /Frameworks/UIKit.framework/Headers/UIView.h:250:错误:“类型名称”声明为返回函数的函数

This appears 20 times. 这出现了20次。 and it points all to UIView.h 它全部指向UIView.h

There are same question in the stackoverflow and people suggested to change the compiler to 4.2 and for lot of people it worked, but for me the compiler was always set to 4.2 and still I get the same error. 在stackoverflow中存在相同的问题,人们建议将编译器更改为4.2,并且对于很多人来说,它都可以工作,但是对我来说,编译器始终设置为4.2,但仍然遇到相同的错误。

On 3a if do /Library/SDKs/iphoneos.sdk 在3a上执行/Library/SDKs/iphoneos.sdk

I get the following error 我收到以下错误

error: Composite SDK failed: The base SDK uses platform 'iphonesimulator', but an additional SDK uses platform 'iphoneos'. 错误:复合SDK失败:基本SDK使用平台“ iphonesimulator”,但其他SDK使用平台“ iphoneos”。 All SDKs must use the same platform (PLATFORM_NAME). 所有SDK必须使用相同的平台(PLATFORM_NAME)。

Please help 请帮忙

Finally, I have figured out the solution for this error: 最后,我找到了解决此错误的方法:

Thanks to the developer on core-plot project and sebastien.leduc a google code user for their help. 感谢核心地块项目的开发人员和sebastien.leduc一位Google代码用户的帮助。

I am using CorePlotInstaller_0.2.2.zip, and one important steps that is missing on the installation guide is you have to use LLVM GCC 4.2 and not GCC 4.2. 我正在使用CorePlotInstaller_0.2.2.zip,安装指南中缺少的一个重要步骤是您必须使用LLVM GCC 4.2而不是GCC 4.2。

The other important steps which was little confused me was 3a. 使我感到困惑的其他重要步骤是3a。

Add to Additional SDKS: $HOME/Library/SDKs/CorePlotSDK/${PLATFORM_NAME}.sdk 添加到其他SDK中:$ HOME / Library / SDKs / CorePlotSDK / $ {PLATFORM_NAME} .sdk

Here you have to literally add the above line, I was changing the ${PLATFORM_NAME} with iphoneos or iphonesimulator, but no we don't have to do that. 在这里,您必须从字面上添加上面的行,我正在使用iphoneos或iphonesimulator更改$ {PLATFORM_NAME},但不,我们不必这样做。

One last thing if you don't find the sdk on the following path $HOME/Library/SDKs/CorePlotSDK 最后一件事,如果您在以下路径$ HOME / Library / SDKs / CorePlotSDK上找不到sdk

Check out /Library/SDKs/CorePlotSDK. 检出/ Library / SDK / CorePlotSDK。

I hope this will help people, it took me about a week to figure out with the help of all the people who came forward to help. 我希望这将对人们有所帮助,我花了大约一个星期的时间在所有前来帮助的人们的帮助下弄清楚了。

I just posted a new version of the Core Plot installer that should resolve this issue. 我刚刚发布了Core Plot安装程序的新版本,该版本应该可以解决此问题。 You can download it from http://code.google.com/p/core-plot/downloads/list . 您可以从http://code.google.com/p/core-plot/downloads/list下载。

You can choose to install Core Plot for all users or just your account. 您可以选择为所有用户或仅为您的帐户安装Core Plot。 If you install for all users, change the Additional SDKs path from $HOME/Library/SDKs/CorePlotSDK/${PLATFORM_NAME}.sdk to /Library/SDKs/CorePlotSDK/${PLATFORM_NAME}.sdk . 如果您为所有用户安装,请将其他SDK路径从$HOME/Library/SDKs/CorePlotSDK/${PLATFORM_NAME}.sdk/Library/SDKs/CorePlotSDK/${PLATFORM_NAME}.sdk

I integrated core-plot into my application yesterday so it's fresh on my mind. 昨天我将核心图集成到了我的应用程序中,因此在我心中是新鲜的。 I tried installing the SDK the same way you are and hit the same error. 我尝试以与您相同的方式安装SDK,并遇到相同的错误。 Comments in the google-group recommended NOT going this route, so I went back and installed the source code. google-group中的评论建议不要采用此方法,因此我回过头安装了源代码。

I ended up using the tutorial HERE for the basic steps and sample code. 我最终在这里使用了教程以获取基本步骤和示例代码。 The code doesn't work anymore, but all the broken parts are answered in the comments (including a complete reposting of the code which works on the latest version). 该代码不再起作用,但是所有损坏的部分均在注释中得到答复(包括对最新版本的代码进行完整的重新发布)。

Some stumbling points were that the "-ObjC" and "-all_load" flags were both needed, and when I added the header path the "search recursively" option wasn't checked off. 一些绊脚石是,都需要“ -ObjC”和“ -all_load”标志,并且当我添加标题路径时,未选中“递归搜索”选项。 Both these questions and many more are answered in the comments. 这些问题以及更多问题都将在评论中得到解答。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM