如何在eclipse cdt环境下 导入一个含makefile的工程文件
来源:互联网 发布:淘宝密码怎么修改 编辑:程序博客网 时间:2024/04/30 04:53
原文
Tutorial: Importing an existing project
The following tutorial takes you though the process of importing a 'legacy' application using the CDT.
Step 1: You want to create a single project that will reflect all of the components for the existing source tree.
- Select File > New > Project.
- For this tutorial, expand C/C++ and select C++ project.
The New Project wizard displays. Click here to see an illustration (displayed in a separate window). - In the Project name field, type a name for the project.
- Ensure that the Use default location option is not selected because here we will specify where the resources reside in the file system, in a location other than your workspace.
We assume this directory location already exists, and contains e.g. source files and makefile. If it does not exist, it will be created.In this example, we will use an existing
hello.cpp
and its existinghello.mak
makefile, located in the directoryc:\brandon
.Click here to see an illustration (displayed in a separate window).
- In the Location field, specify the path to the existing files for your project.
- From the Project types list, expand Makefile Project and select Empty Project..
- To have sample source and a makefile created in your existing directory, select Hello World C++ Project
- Make sure a toolchain is selected.
- Click Next.
- (Optional) On the Select Configurations page, select only the configurations you want created. Configurations display for each toolchain selected on the previous page of the wizard.
- Click Finish to close the dialog box.
You will see the new project in the Project Explorer view. In addition, new 'dot' files have been created in your legacy project's root directory, these are CDT project files.
- (Optional) To see these "hidden" files, open the view menu on the Project explorer view, and select "Customize View."
The view menu is activated via the small downward-pointing triangle in the upper right of the toolbar of the view.Click here to see an illustration (displayed in a separate window).
- In the Available Customizations window, on the Filters tab, uncheck ".* resources."
Click here to see an illustration (displayed in a separate window).
- The formerly hidden 'dot' files are now shown in the Project Explorer.
Click here to see an illustration (displayed in a separate window).
- Hit OK to close the dialog.
- (Optional) To see these "hidden" files, open the view menu on the Project explorer view, and select "Customize View."
Step 2: You are now ready to build your project.
- To build your project, select Project > Build Project.
You can also hit the hammer icon on the toolbar to build the selected project.
- You may see an error e.g.
"make: *** no rule to make target 'all'.
This is because, in our case, we didn't tell it where the makefile is, or its name.
- Open the project properties (right mouse on project name in the Project Explorer view and select Properties at the bottom on the context menu).
- On the C/C++ Build Page, on its Builder Settings tab, uncheck
Use default build command
and change themake
command tomake -f hello.mak
since our makefile is not named the defaultmakefile
.Click here to see an illustration (displayed in a separate window).
- Click OK to close the Project Properties window.
- Your project will probably rebuild. If not you can force a build via Project > Build Project or use the hammer icon .
After the project build completes, the results display in the Console view and new objects, such as binaries and includes, show in the Project Explorer view.
Click here to see an illustration (displayed in a separate window).
- Review the results to ensure that there are no errors.
To change indexer settings, bring up the Indexer page in the Project Properties.Click here to see an illustration (displayed in a separate window).
Step 3: You are now ready to run your application.
- To run your application within the C/C++ Perspective, click Run > Run Configurations...
The Run Configurations dialog displays.
- To create a run configuration, select C/C++ Application and click the New icon.
- Give your run configuration a name by entering a new name in the Name field at the top.
- On the Main tab, select the project by clicking Browse opposite the Project field.
- From the Project Selection window, select the project and click OK.
- Select the new C/C++ Application you want to execute by clicking Search.
In our case it didn't find the file because it's in a nonstandard location. Use the Browse button to select the executable. In our case also it's a nonstandard name,
hello.e
because that's what our makefilehello.mak
built.Click here to see an illustration (displayed in a separate window).
- If you see the error
[Debugger]: No debugger available
, select the Debugger tab and choose a valid debugger for your platform (e.g. gdb/mi).
- If you see the error
- Click Run to save the run configuration and run it.
Click here to see an illustration (displayed in a separate window).
The application runs in the Console view. The Console also shows which application it is currently running in the title bar. You can configure the view to display different elements, such as user input elements using different colors.
- 如何在eclipse cdt环境下 导入一个含makefile的工程文件
- Eclipse CDT 导入 Makefile 构建的 C/C++ 工程
- Eclipse导入makefile的工程
- linux eclipse c++ 导入一个含有makefile的工程
- Cygwin GCC 的 Makefile 工程在 Eclipse CDT 中配置符号与路径自动发现方法
- Cygwin GCC 的 Makefile 工程在 Eclipse CDT 中配置符号与路径自动发现方法
- Cygwin GCC 的 Makefile 工程在 Eclipse CDT 中配置符号与路径自动发现方法
- Cygwin GCC 的 Makefile 工程在 Eclipse CDT 中配置符号与路径自动发现方法
- eclipse cdt 导入c ++ 工程并建立头头文件 索引
- Eclipse CDT 导入现有工程但不copy文件
- Eclipse CDT生成Makefile文件
- eclipse导入Makefile工程
- Eclipse导入makefile工程
- Eclipse CDT Hello World工程makefile分析
- Eclipse CDT Hello World工程makefile分析
- 将已有makefile的工程导入到eclipse
- 在eclipse环境下搭建一个axis2工程
- 在eclipse环境下搭建一个axis2工程
- 马赫带现象
- zoj 3862 Intersection(枚举)
- 超实用的JavaScript技巧及最佳实践(下)
- 198 House Robber
- http知识点
- 如何在eclipse cdt环境下 导入一个含makefile的工程文件
- Mybatis的几点小结
- iOS中block介绍(三)揭开神秘面纱(上)
- 数据结构关于AOV与AOE网的区别
- 感受亮度与光强,及马赫带效应
- 摘-学习网络编程方法
- github之别名
- caffe安装遇到的问题总结
- 角度和弧度的转换