我怎么能编译库的源路径链接到Eclipse中不同的位置? [英] How can I link the source path of a compiled library to a different location in Eclipse?

查看:578
本文介绍了我怎么能编译库的源路径链接到Eclipse中不同的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了MSP430-gcc编译器和相关工具的使用Eclipse做一些开源的MSP430开发在家里。我正在开发一个年龄稍大的MacBook Pro的运行OS X Lion的安装和使用的MacPorts的工具。我运行Eclipse 3.7.2与CDT和GCC交叉编译器支持插件。我有一个简单的空的main()撰文指出,编译和链接就好了。

I've installed the msp430-gcc compiler and associated tools to do some open-source msp430 development at home using Eclipse. I'm developing on a slightly older Macbook Pro running OS X Lion and installed the tools using MacPorts. I'm running Eclipse 3.7.2 with the CDT and GCC Cross Compiler Support plug-ins. I have a simple empty main() written that compiles and links just fine.

精灵解析器让我查看ELF二进制只是一个组件除外精细的内容;当我尝试在crt0.s中启动code的内容,它给了我一个空白文件。当我点击ELF,在Eclipse窗口显示底部的文件名栏的crt0.s中组件<$c$c>\"/opt/local/var/macports/build/_Volumes_work_mports_dports_cross_msp430-gcc/msp430-gcc/work/gcc-4.6.3/gcc/config/msp430/crt0.S\".这是有道理的,因为我的MacPorts的安装MSP430-GCC的。 crt0.s中存档至 /opt/local/lib/gcc/msp430/4.6.3/libcrt0.a我的机器上。

The ELF parser lets me view the contents of the ELF binary just fine with the exception of one component; when I try to view the contents of the startup code in crt0.S, it gives me a blank file. When I click on the crt0.S component of the ELF, the filename bar at the bottom of the Eclipse window shows "/opt/local/var/macports/build/_Volumes_work_mports_dports_cross_msp430-gcc/msp430-gcc/work/gcc-4.6.3/gcc/config/msp430/crt0.S". This makes sense because of my MacPorts install of msp430-gcc. crt0.S is archived into /opt/local/lib/gcc/msp430/4.6.3/libcrt0.a on my machine.

我希望能够做的是告诉Eclipse去别处寻找了,当我建立与MSP430-gcc工具时自动链接库的源文件。这将presumably包括 /opt/local/lib/gcc/msp430/4.6.3 / 的一切。我开始通过下载源MSPGCC-20120406(在我的MacPorts版本安装)和应用GCC补丁文件到一个空目录树。这创造了的gcc /配置/ MSP430 目录,其中包括 crt0.s中 crt0ivtbl。小号文件。

What I want to be able to do is tell Eclipse to look elsewhere for the source files for the libraries that are automatically linked when I build with the msp430-gcc toolchain. This would presumably include everything in /opt/local/lib/gcc/msp430/4.6.3/. I started by downloading the source for mspgcc-20120406 (the version in my MacPorts install) and applying the gcc patchfile to an empty directory tree. This created the gcc/config/msp430 directory, including the crt0.S and crt0ivtbl.S files.

我有没有运气办成告诉Eclipse在来看看〜/开发商/ MSPGCC-20120406 / GCC-4.6.3 /配置/ MSP430 / 而不是路径是在已建 libcrt0.a 。我试图玩弄的项目preferences-&GT;路径和Symbols-&GT;源位置窗口,但没有多少运气。我搜索通过这个网站,并在谷歌和最接近我想出了WAS <一个href=\"http://stackoverflow.com/questions/6784543/how-to-attach-source-to-the-libraries-on-eclipse-cdt\">this问题但它没有闻之类的正确答案。

What I have had no luck accomplishing is telling Eclipse to look in ~/Developer/mspgcc-20120406/gcc-4.6.3/config/msp430/ instead of the path that's in the already-built libcrt0.a. I tried playing around with the Project Preferences->Paths and Symbols->Source Location window, but didn't have much luck. I searched through this website and on Google and the closest thing I came up with was this question but it doesn't "smell" like the right answer.

我想避免涉及移动库源到我的项目解决方案。我宁愿有一个解决方案,将多个项目的工作。

I would like to avoid solutions that involve moving the library source into my project. I'd rather have a solution that will work for multiple projects.

所有帮助是极大的AP preciated!先谢谢了。

All help is greatly appreciated! Thanks in advance.

推荐答案

尝试,并检查了Eclipse的 链接的资源 可以帮助您声明外部目录从这里Eclipse项目中。

Try and check if the Eclipse linked resource could help you declare that external directory from within your Eclipse project here.

链接资源是存储在位置在文件系统中的项目的位置之外的文件和文件夹。这些特殊的资源可用于文件和文件夹添加到项目中,由于某种原因必须在项目之外保存在某个地方。例如,链接文件夹可用于存储从源文件建立单独的输出。

Linked resources are files and folders that are stored in locations in the file system outside of the project's location. These special resources can be used to add files and folders to your project that for some reason must be stored in a certain place outside of your project. For example, a linked folder can be used to store build output separately from your source files.

我觉得有趣,你如何定义链接的资源:

I find interesting how you can define that linked resource:

链接的资源目标路径既可以定义为绝对路径,或相对路径变量

Linked resource target paths can be either defined as absolute paths, or relative to a path variable.

既然你可以把它定义相对于(例如)你的Eclipse的项目位置 PROJECT_LOC ,然后你可以设置你的方式资源,该资源不会两个环境之间切换。

Since you can define it relative to (for instance) your Eclipse project location PROJECT_LOC, you can then setup your resource in a way which won't change between two environments.

这篇关于我怎么能编译库的源路径链接到Eclipse中不同的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆