游戏clean thethe building blockss怎么玩

403 Forbidden
You have accessed a RESTRICTED AREA!
Unauthorized access is prohibited.
Any attempts of break-in will be logged and reported.Access denied | linux.die.net used Cloudflare to restrict access
Please enable cookies.
What happened?
The owner of this website (linux.die.net) has banned your access based on your browser's signature (416ddf0-ua98).Uncommon GoodsBuy Now
moving--truck
moving--dolly
moving--house
moving--cal
Created with Sketch.
moving--apt当前位置:&&技术问答>
各位大虾来帮帮忙啊!
&&&&来源:&互联网& 发布时间:
&&&&本文导语:&
系统:LINUX7.3
在原有的基础上添加一快新的硬盘,对硬盘进行新的分区并挂上,然后重新启动,系统提示::
fsck,ext3Could this be a zero-longth partition?
:Attempt to read block from filesystem resulted in short read while tr...
系统:LINUX7.3
在原有的基础上添加一快新的硬盘,对硬盘进行新的分区并挂上,然后重新启动,系统提示::
fsck,ext3Could this be a zero-longth partition?
:Attempt to read block from filesystem resulted in short read while tring to open /dev/sdb1.
/boot: clean , 46/12048 files ,
/home : clean , 165/1300480 files , 8505 blocks
/usr : clean , 8 files , 3684 blocks
/var: clean , 407/6624 files , 041 bloks
An error occunred during the file system check .
Dropping you to a shell , the system will reboot
when you leave the shell :
Give root password for maintenance
(or type Control-D for normal startup);
这时你可以输入root密码进入shell,修改/etc/fstab文件,把你的 /boot,home,/usr,/var,还有 / 都重新指定一下,最重要的是/boot和/一定要正确,然后重启。
这个问题应该是你增加硬盘导致的,使原来的分区顺序改变了。
楼上的正解!
建议用LABEL或UUID 来标识分区, 用/dev/sda1来标识会出这样的错误,
您可能感兴趣的文章:
本站(WWW.169IT.COM)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。本站(WWW.169IT.COM)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
相关文章推荐
特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!
(C)9IT.COM,E-mail:www_169it_com#163.com(请将#改为@)This version of this document is no longer maintained.
For the latest documentation, see
In this chapter:
The C/C++ perspective is where you develop and
build your projects. As indicated in the
chapter, a project
is a container for organizing and storing your files.
Besides writing code and building your projects, you may
also debug and analyze your programs from the C/C++ perspective.
You'll find complete documentation on the C/C++
perspective, including several tutorials to help you get
started, in the core Eclipse platform documentation set (Help--&Help Contents--&C/C++ Development User Guide.)
The views in the C/C++ perspective are driven primarily by selections you make in the C/C++ editor and the C/C++ Project Explorer view. The Project Explorer view is configured specifically for C and C++ development.
For more information about the Navigator view, see the Workbench User Guide:
For information about the Navigator view:
See these sections in the Workbench User Guide:
Toolbar and icons
Concepts--&Views--&Navigator view
Right-click context menu
Reference--&User interface information--&Views and editors--&Navigator View
To create and run your first program, you'll use two major
facilities within the IDE:
wizards — for quickly creating a new project
launch configurations — for setting up how your
program should run
After you've used these features of the IDE for the first time, you'll be able to
create, build, and run your programs very quickly. For details about wizards and launch configurations, see the
chapters in this guide.
The Project Explorer view in the C/C++ perspective is perhaps the most important view in the IDE because
you can use it to control your projects. The selections you
make in the Project Explorer view greatly affect what
information the other views show.
The Project Explorer view gives a “virtual” or
filtered presentation of all the executables, source, and
shared objects that comprise your project. You can set
filters for the types of files you want shown in this view. For information about how to set filters, see “.”
The Project Explorer view has many of the same features as the
Navigator view, but it is configured specifically for
C and C++ development. At first glance, the two views may seem
identical, but the Project Explorer view:
presents the project's executables as if they reside in
a subdirectory called Binaries
for a library project, presents the project's libraries
as if they reside in subdirectory called Archives
hides certain files
includes Build Project and related commands in its right-click menu, if auto-build is disabled
gives an outline of C/C++ source files and binary files
To open files and show them in the editor area:
In the Project Explorer view, double-click the file to open.
If you aren't working on a project but would like to keep it in the IDE,
you can close it:
In the Project Explorer, right-click your project, and then select Close Project.
To open a closed project:
In the Project Explorer, right-click your project, and then select Open Project.
The project opens — you can see it in the C/C++ Project Explorer view.
To hide certain files from the Project Explorer view:
In the Project Explorer view, click the menu
dropdown button ().
Select Customize View… and click the Filters tab. The Available Customizations dialog appears:
On the Filters tab, select the types of files you want
to hide. For example, if you select Package declarations, then all
files that indicate the package to which the compilation unit belongs won't appear in the Project Explorer view.
Click OK. The Project Explorer view automatically refreshes itself and shows only those files you haven't filtered.
The Project Explorer view shows you an outline of the C/C++ source and header files in a project:
Project Explorer view: outline source and header files for a project.
You can also use the Outline view to see the
structure of your projects. (For more information about the Outline view, see the
section in this chapter.)
The Project view shows you the outlines of binary files as well.
You can examine the structure of executables or object files
to see the elements that you defined or used in the file,
as well as implicitly used elements, such as
malloc(), _init(), and errno:
Project Explorer view: outline source and executable for a project.
To fully understand the use of projects in the IDE (how to set up projects, what types of projects to choose, and how to organize projects to perform effective builds from IDE, and command line), you need to be aware of the following:
The QNX Momentics IDE is based on the open source Eclipse platform and the open source CDT project, which provide the essential portion of the functionality for projects and builds. The IDE uses the concept of a workspace that is a user-specific, writable directory on the local host. Note that this directory itself should never be included as part of a revision control system shared between users, nor should it be located on a shared drive (unless you're certain there will only ever be one user that uses it).
The IDE uses the concept of a project, which is a container for source and binaries, together with some configuration files that is usually located in the workspace. This project can be shared between users using a version control system. Projects they cannot contain one another. However, there is a concept of a working set that lets you filter and group projects if you have too many of them in a workspace. There is also special QNX Container project which allows you to control/build sets of projects at the same time.
When you select a location for your workspace, as well as the names for your projects, be aware that these names can
make doesn't like directory and file names that contain spaces and non-standard characters. The IDE might acc however, the build wouldn't work with such these names.
A project isn't a virtual container that contains arbitrary files and directories. You need to have a directory in the file system that contains the project root (source and build output), and use the same directory to contain the project metadata. If you want to separate project metadata from the source directories, you'll have to use folder links. You have an option to include the project inside your workspace, or outside the workspace. You can determine how to create t you can check out the top level from one location and subdirectories from another location, and you can also use OS soft links, or some other means to create it.
The QNX IDE supports these project types:
A Makefile project would work for any project that has a Makefile (by default). A Makefile project can launch anything as an external builder in any folder. The IDE starts
make, and after make exits, the IDE refreshes the workspace to see what was created. You can change the make command and/or run specific make targets, but IDE has no control over what make is doing.
Since the IDE doesn't know what's being built, it would have problems parsing source files (which it does internally to allow navigation, code completion, syntax highlighting, code generation, and refactoring). Therefore, if you use a Makefile project, you have to modify the Indexer (the internal parser) to point it to the missing Includes, as well as what Defines your parser uses for conditional compilation. The process of determining this is called Discovery, and it can be controlled using Discovery Options.
If you know what includes and defines you want to use, it's easier to specify them directly (Project--&Properties--&C/C++ General--&Path and Settings).
A QNX project is a special kind of Makefile project with additional control over the make. To use a QNX project, you also have to use QNX recursive Makefiles. QNX recursive Makefiles are conventions for creating Makefiles that use specific variables and layout. This lets the IDE parse the Makefile, and to provide the GUI with control over the Makefile options and build variants. typically, a single QNX project is good enough to build one binary/library for several variants, such as x86 and PPC in the debug, release, and profiling modes.
A managed project is CDT-specific project that doesn't use Makefiles, and all of the build settings are controlled by the GUI. The problem associated with this project type is its inability to perform a build of the project from command line (although, it is possible in simple cases with some additional setup files, or you can use a Makefile generator). In addition, there are restrictions on what you build and how, particularly if you use special steps in the build that involves other tools.
Lets consider scenarios that can occur when you are creating a project for the first time (compared to checking out an existing project, see “.)” When creating a new IDE project, you have to determine what you'd like to do:
Option #1: This is a new project and you want to create all of the source in the IDE
Option #2: The source and structure currently exist in the file system, and you want to “attach” an IDE project to it
Option #3: The project source and structure already exists in version control
To create a project for the first time:
Option #1: For a new project, select one of the project types described above (use File--&New…, and then select C Project or C++ project to obtain the appropriate wizard. Determine the type of project you want to create:
For a QNX Project, select QNX C Project (or for C++, select QNX C++ project), click Next, select the build variant(s) (i.e. for x86, Debug and Release), and then click Finish.
For a Makefile, select C Project (or for C++, select C++ Project), click Next, select Makefile on the left, select a QNX Toolchain on the right, and then click Finish.
For a managed project, select C Project (or "C++ Project" for c++). Select one the projects types or templates on the left, except Makefile. Pick QNX Toolchain on the right. Click Finish.
Option #2: To attach to an existing folder, select one of the project types described above for your project, open the corresponding wizard as described in the steps for Option #1, but don't proceed further. The first page of the wizard presents you with the option to use a default location or to select one yourself. Uncheck "Use default location". Select location of you existing project using "Browse" button. Follow the wizard as in #1. Alternatively you create project in default location but later attach other directory using link folders. See Example 4 below.
Option #3: If you want to check out source from version control, select one of the project types described above for your project. If the entire project is in one directory in your version control system, you can use the Check Out As… option from SVN or CVS plugins to perform the checkout. Use Check out as a project configured using New Project Wizard option, and then select the wizard for the project type you require. For a QNX project, make sure that you deselect the Generate default file and Generate Makefiles option.
If you want to perform a partial checkout of the source, see “.”
In this example, we'll use SVN and describe the procedure to create a project by checking out the source from several folder locations in your version control system. For example, you have a folder in SVN called my_big_project, and this folder contains 100 subfolders (where each of them represent a different binary). If the my_big_project folder has a Makefile and some other common folders, such as public_includes that you need in order to compile your subfolder my_binary, you'd have to follow these steps:
Follow the instructions to check out a folder (my_big_project) as a new project, and then deselect the option Checkout recursively (SVN can' it has to check out the entire folder).
Locate the my_binary subfolder in SVN, right click, select Find--&Check Out As…, and then select the option Check out as folder into existing project.
Click Next.
Select the previously created project.
Click Finish.
Optional: If you require any other subfolders, repeat steps 1 through 3.
Switch to the C/C++ Perspective.
If you checked out more than one project that shares an SVN folder as its project root, you can't commit the .project file back into SVN. You would need to add it to the SVN ignorefile to prevent it from showing up as a changed resource.
Now, when you create a project, you may want to share the settings so that the next person can easily check it out as a project. If given project root matches with exactly one folder in source control system, you may commit the project metadata files back into source control (.project and .cproject). If your project is attached to version control but you don't want it to be committed, you have to add those files into “ignore” list.
QNX projects share most of their options in Makefiles itself, however, some options (such as the current build variants) are user-specific (i.e. not in the project metadata). You can make them shared by enabling Share project properties on the Main tab for the QNX project properties.
The IDE integration with source control (CVS and SVN) can detect the presence of the project metadata in the repository, or checkout existing projects. You have an option to search recursively and checkout all existing projects from a selected folder, or choose a specific project. You can also create a special file, called Team Project Set (.psf), which contains a set of projects that you want everyone to check out. Team sets can be located in the source control repository, and the IDE will recognize them (and should be able to check out all specified projects automatically).
If you don't want to build using the IDE, but you want to use the debugger, the System Profiler, or if you want to find memory corruption, you can create a simple project in IDE to use by any of these tools. To configure this type of project, follow these steps:
Create an empty Makefile project.
Copy or link sources into the project. To create a link, create a new directory in the project, and in the new directory dialog, click Advanced and select Link to folder.
Copy or link any binaries and library into the project.
Create a launch configuration for the selected tool.
If you want the source navigation and sources aren't in the same location where they were compiled, you need to enable Source Path Lookup (edit the Source tab for the launch configuration to provide a lookup).
For more details, see in “” below.
In the IDE, you can set build properties for the following types of projects:
You can modify the build properties for a QNX project using Project Properties (right-click on a project in the Project Explorer view and select Properties), or by modifying the Makefile. If you manually modify a Makefile, you might make it unrecognizable by the IDE and it won't be able to properly update in the future.
Some of the Project Properties that you can set for a QNX project are:
Add extra libraries and a library path (from the Linker tab, select Extra Libraries from dropdown list)
Add extra includes (from the Compiler tab, select Extra Include from dropdown list)
Define macro variables for the entire project
Define macro and includes for one file (click Advanced, and select a file from the left)
Select additional platforms to build for (Build Variants tab)
Create another build variant (such as Profiling)
Change the make variable (from the Make Builder tab, override the Build Command, i.e. make DEBUG=1)
Add custom compiler and linker options
Change the name of the output binary or library
You can modify the build properties for managed projects using Project Properties (right-click on a project in the Project Explorer view and select Properties). Some of the Project Properties that you can set for a managed project are:
Add extra libraries and library paths (select C/C++ Build--&Settings--&QCC Linker--&Libraries)
Change the output options, such as adding Debug, or the Optimize or Instrumentation options (C/C++ Build--&Settings--&QCC Compiler--&Output Control). Some options require you to make the change in both the compiler and the linker.
Add custom linker or compiler options
Add another build variant (build configuration) (Manage Configuration... button in any page of C/C++ Build)
To set individual files option use same Properties but on the file/folder.
To exclude a file from a build, select a file, right-click and then select Exclude from build. To include a folder into the build, it has to be a source folder, or you click on a folder, select Properties, and then deselect the Exclude from build option on the C/C++ Build page. You can use Internal Build or External Make build with the make generation (select C/C++ Build--&Tool Chain Editor--&Current Builder).
For a Makefile project, you can change the location where the build starts from, and the make arguments (as well as the command to launch make itself). In addition, you can change the environment variables for the make invocation in the environment subcategory of the C/C++ Build options. If you're using QNX naming conventions for make variables, the same variable can be changed automatically from the Settings tab. If they are defined in make itself, environment variables can't override them
unless you use make -e. For all of the other options, you set them in your Makefile.
To perform a simple build for an active configuration, select one or more projects, right-click and then select Build Project. To clean project(s) before you build, right-click on a project and then select Clean Project.
For QNX and Makefile projects, you can create and build specific make targets using the context menu for the selected project.
For a managed project, you can change the active default configuration and build using the Build Configurations menu. When you perform a build for managed project, you can also set a global preference to build a single configuration, or all of them at once.
A container project is a specific complex quasi-hierarchical project that lets you combine a set of projects in order to quickly switch between different build configurations. The root of the container project is always a container, and the container's children are configurations. A configuration is a set of projects of various types (including other containers). Each member of the configuration has two important attributes specific for the container environment: the target and the variant. These are very generic attributes, and their interpretation is completely defined by a particular configuration member. For example, for a QNX C project, the target is a build target (such as build, clean, and variant, which for an x86 platform, can be something like x86/release, x86/debug). To build any desirable configuration, select a container configuration from the dropdown menu. For a managed project, you can use working sets to build them together.
To build one or more projects in the IDE workspace from the command line, use the following command:
mkbuild -ws &workspace& [options]
mkbuild [-project] &full_project_path&
mkbuild -ws &workspace& -projects &project1,project2& [options]
&project& is the project name for one of project types supported by the IDE: Makefile project, QNX project, Managed project, and Container project.
-stopOnError — stop on the first compile error. This option is not valid for a full workspace build.
-targets &target1[,target2...]& — the make targets (build, clean, rebuild or the custom make target)
-variant &variant& — the build variant (see below)
For a Managed project, the variant is the same as the configuration. If it's not assigned, the default will be used.
For a QNX project, the variant is either “All”, “Enabled”, or platform/type (i.e. x86/release).
For a container project, the variant is any defined container configuration. Note that a container project doesn' only use the variant.
For a workspace, the variant isn't used. The default variant for each project will be used.
For multiple projects, the defined variant for each project is used (the project must understand the variant).
No spaces are allowed for project names, as well as in the list of projects or targets.
Environment — QDE=&path& can be used to override the default IDE installation location ($QNX_HOST/usr/qde).
If a project doesn't support a target, the default target would be built. By default, for make projects, no make targets have to
be created from the UI in order to use named targets.
To build a default target and variant for the project projectA:
mkbuild /home/user/workspace/projectA
To build all projects in a specified workspace:
mkbuild -ws /home/user/workspace
To build using another IDE installation:
&QDE=/home/user/IDE4.6 mkbuild ...
To build the projectA and projectB projects with clean, all targets, and the x86 variant/configuration:
mkbuild -ws /home/user/workspace -projects projectA,projectB -target clean,all -variant x86
To configure an automated build,
you have to use make. If you're using a managed project, you have to use Gnu Make Build, which generates the Makefiles for you. If the projects don't have any dependencies, you only have to run make in a root directory (or other appropriate directory). If you want to build several projects, you have to create an external Makefile that references all subprojects.
For example, if your local C++ source files have the following structure:
If you work in a directory called mydir, you can run make. Running the make command will collect the libraries from the other parts of the filesystem, and obtain the includes (including the local ones from the mydir directory).
To create a project:
In the Project Navigator, select File--&New--&C++ Project.
Specify a name, such as mydir (or any name your choose).
Deselect the option Use default project location.
From the filesystem, browse to select the directory you just created (i.e. mydir).
Select Makefile--&Empty Project.
Select a QNX Toolchain.
Click Finish.
Select a new project, right-click and then select Properties.
In the Properties dialog, select C/C++ General--&Paths and Symbols.
Select GNU C++, and then add a Directory(/source/a/inc) as your include path.
this is a required step for the internal parser(for code navigation, refactoring, syntax highlighting, and so on).
If you know the default macro that make used to build the source, include the macro here (i.e. if you compiled using qcc -DDEBUG foo.c, include the DEBUG macro).
Run the Build Project command.
If the Makefile isn't in the root (the Makefile is in the out directory), and this is the build directory, configure the build using the following steps:
Create a project (same as “”).
Right-click and select Properties.
Expand C/C++ Build.
For the Build directory, type ${workspace_loc:/mydir/out}.
If the Makefile is in the root (the Makefile is in the out directory), and this is the build directory, configure the build using the following steps (it's the same steps as Example 1, but your out directory is outside of mydir):
Create a project (same as “”).
Select the project, and then select New--&Folder.
In the Folder dialog, click Advanced.
Select Link the folder in the file system.
Select an output folder that's outside of the project mydir.
Click Finish.
If the source code is in directory A, the output binaries are in directory B, and the extra includes are in directory C, all of the directories have a common root, D (i.e. D/x/y/z/A, D/x/C, and D/w/C).
If you want a project by itself, with it's metadata located in another location (and you also want to share it if possible), do the following:
Create a C++ Empty makefile project.
In the Project dialog, use the default project location (in the workspace). For example, let's name it Project4.
Click Finish.
To create link folders for A, B, and C:
For the project, select New--&Folder.
Click Advanced, and then select Link the folder in the file system.
Select Variables….
Add a new variable called ROOT_DIR, and then select its path in the filesystem to directory D.
In the dialog, click Extend…, and then select the subdirectory called A.
You should see a path something like ROOT_DIR/x/y/z/A in the path.
Click Finish.
Repeat the procedure for the B output directory (you don't need to create ROOT_DIR again, just click Extend…).
Optional: Repeat the procedure for the extra include directory called C. This step is required so that the project setting can ke however, if you're not going to share this project, this step can be omited).
Now you can add extra include folder. In the Properties dialog, expand C/C++ General--&Paths and Symbols, select GNU C++, and then click Workspace… to add the directory called C as the include search path (i.e. /Project4/C).
Now if the make file is in folder A (source folder), you'll need to instruct the IDE to run make from that location.
Open Properties dialog for the selected project, and then click on C/C++ Build.
For the build directory, type ${workspace_loc:/Project4/A}.
Now, the Build Project and Clean Project you'll see your binaries in Binary container, and your includes in Includes container. Open a source file and verify that the Include navigation works (double-click on the external include in Outline view to navigate to that location).
In earlier versions of the IDE, there were two different project types: Managed make, which automatically generated a Makefile, and Standard make, which required a Makefile in order to be built. Now, you select a project type, and that determines the build system to use.
You can continue to create a make project using the C or C++ wizard. For instructions about how to create this type of project, see “.”
If you're creating an application from scratch, you'll
probably want to create a QNX C Project or QNX C++ Project,
which relies on the QNX recursive Makefile hierarchy to
support multiple CPU targets. For more information about the QNX recursive Makefile hierarchy, see the
chapter in the Neutrino Programmer's Guide.
If you want to import an existing project, see
in the Managing Source Code chapter in this guide.
Use the New Project wizard whenever you want to create a new
project in the IDE.
To create a simple “hello world” type of program:
In the C/C++ perspective, click the
New C/C++ Project button in the toolbar:
(You can use the dropdown menu to create different types of C/C++ projects.)
The New Project wizard appears.
There are actually several ways to open the New Project wizard. For details about the wizards, see the
chapter in this guide.
Name your project, and then select the type. For detailed information about each of the Project Types see “” in the Getting Started chapter.
Although the wizard allows it, don't use any of the following characters in your project name:
| ! $ ( " ) & ` : ; \ ' * ? [ ] # ~ = % & & { }
Using these characters in a project name will cause problems later.
Select a required toolchain from the Toolchain list.
Click Next.
Select the types of platforms and configurations you want to deploy for this project.
Optional: Click Advanced Settings to edit the project's properties.
Expand C/C++ Build and select Settings.
Click the Binary Parsers tab.
Select a parser.
Select the Build Variants tab.
If you want to build both debug and release variants of your program, select the build variant that matches your target type.
If you don't want to build both debug and release variants, expand the item for your target type and disable Debug or Release.
If you have the Memory Analysis tool or Application Profiler tool (or both) selected for your configuration, you can set only one the debug or release variants when you create a project.For a managed project, to make a change to your existing variant(s), you'll need to select File--&Clean and then build again, or perform a clean before you make the change to the target variant(s).
Click Finish.
The IDE creates your new project in your workspace. Your new project is displayed in the Project Explorer view, and in the Navigator view. If a message box prompts you to change perspectives, click Yes.
For information about converting existing projects, see “” and “.”
You can continue to create a typical make project using the C or C++ wizard:
Select File--&New--&Project, select either C--&C Project or C++--&C++ Project, and click Next.
In the Project name field, type a name for your project.
In the Project Types area, expand Makefile and select Empty project.
In the Toolchain list, select QNX QCC.
Do one of the following:
Click Finish.
Click Next, click Advanced settings, then select your C/C++ Build and build target properties, and any other options. Click Finish when complete.
The result is an empty make project, which is similar to the Set QNX Environment action in previous IDE releases.
After you create your project, if you right-click on the project, select Properties and from the menu on the left expand C/C++ Build--&Settings, for the Runtime field on the General Settings tab, the Default setting refers to C++ Dinkum with exceptions.
To create a Makefile that can be launched outside the IDE:
In the Target Navigator, select a project, right-click, and then select Properties.
On the left, select C/C++ Build.
On the right, verify that the Generate Makefiles automatically and the options Expand Env. Variable Refs in Makefiles in the group Makefile generation are selected.
On the left, expand C/C++ Build, and select Tool chain editor.
In the Current builder list, select the external make builder.
Specify any other desirable options for properties on the other panels.
The IDE generates a number of .mk files, and a top-level Makefile for each processed configuration (the last one in the configuration folder). You can process this Makefile from command line using the make utility:
make -f [configuration]/makefile [target]
Every time any configuration is changed, updated, or deleted, you need to refresh the make infrastructure either by regenerating the Makefiles, or changing the existing files manually.
Managed make projects provide full IDE graphical control and configuration, and they take advantage of the Eclipse framework (i.e. the incremental compiles, links, and so on).
For additional information, see “” and “.”
The C/C++ search features use an index of symbols (from the source code in your projects, and from external header files) to find the locations of declarations and references. By default, the indexer is set to Fast, which means that it provides fastest indexing capabilities (for declarations and cross reference information). This is the recommended indexer.
To specify an indexer type for a project, open the project's Properties dialog,
and then select C/C++ Indexer from the list on the left.
To specify an indexer type as the default indexer for new projects, choose
Window--&Preferences…, expand
C/C++ in the list on the left, and then choose Indexer.
In either case, you have the following choices:
Full indexer (complete parse)
Parses your project in the same manner that a
compiler does. It starts at each compilation unit and parses that file
and all files that it includes. This provides the most accurate index
information. For large projects using complex C++ code, this indexer
can slow down the IDE.
Fast indexer (recommended)
Similar to the Full indexer, except it parses each
header file included in a project only once. For example, if a header
file is included by two compilation units, the parsing of the second
unit reuses the results of parsing the first unit. This is
similar to how precompiled headers work. The indexing of large
projects using the Fast indexer uses fewer resources than the Full
indexer, but the resulting index isn't quite as accurate.
No indexer (search features will not work correctly)
Disables indexing completely.
This also disables much of the search functionality.
In this section…
After you've created a project, you'll want to
build it. Note that the IDE uses the same
make utility and Makefiles that are used on the
command line.
The IDE can build projects automatically (i.e. whenever you
change your source), or let you build them manually. When you
do manual builds, you can also decide on the scope of the
When you right-click on a project and select Build Project, there is a particular scenario where the C/C++ perspective will ignore the Build Project command. For example, if you build a make project and then modify and build the project outside the IDE for a library that it needs to link against, when you attempt to select Build Project in the IDE, it won't reissue the make all for the project. The IDE ignores the explicit user-specified build request for this particular scenario.
The IDE uses a number of terms to describe the scope of the build:
Build Project
Build only the components affected by modified files in
that particular project (i.e. make all).
Clean Project
Delete all the built components (i.e. .o,
.so, .exe, and so on) without
building anything (i.e. make clean).
Build the project from scratch (i.e. make clean all).
You can watch a build's progress and see output from the
build command in the Console view. If a build generates any
errors or warnings, you can see them in the Problems view.
By default, the IDE builds your project only when you tell it to, but it can also build your project automatically every time you change a file or other resource in any way (e.g. delete, copy, save, etc.). This feature is optimal when you have reasonably sized projects that are small in size, or not too many projects open at the same time. However, for best performance with very large projects, or if you have many open projects, you will want to leave the autobuild feature disabled.
To enable the autobuild feature:
From the main menu, select Window--&Preferences.
In the left pane, expand General and select Workspace.
In the right pane, enable the Build automatically option.
Click OK to save and apply your preferences.
The IDE builds your projects only when you change a file or other resource.
QNX C/C++ projects have their own autobuild setting. To set the autobuild feature for QNX C/C++ projects:
Right-click a QNX C/C++ project, then choose Properties from the menu.
On the left, select QNX C/C++ Project, and then select the Make Builder tab:
Enable the Build on resource save (Auto Build) option in
the Workbench Build Behavior area.
Click OK to close the project properties dialog and
return to the Workbench.
The IDE lets you manually choose to build all your open
projects. Depending on the number of projects, the size of
the projects, and the number of target platforms, this
could take a significant amount of time.
To build all currently open projects in the IDE:
From the main menu, select Project--&Build All.
To rebuild all projects, you should clean the projects first, and then run a build:
From the main menu, select Project--&Clean….
The IDE shows the Clean dialog:
Select the projects you want cleaned.
Select the Start a build immediately box to enable the option.
To build selected projects:
In the Project Explorer view, right-click a project and select
Build Project.
To clean selected projects:
In the Project Explorer view, right-click a project and select
Clean Project.
The IDE automatically saves all your changed
resources before you do a manual build.
To turn off this feature:
From the main menu, select
Window--&Preferences.
In the left pane, expand General, and then select
Workspace.
In the right pane, disable the Save automatically before
build option.
Click OK to save and apply your preferences.
The IDE no longer saves your resources before it builds your project.
You can instruct the IDE to build certain projects before
others. If a given project refers to another project,
the IDE builds that project first.
Setting the build order doesn't necessarily cause the IDE to
rebuild all projects that depend on a given project. You
must rebuild all projects to ensure that all dependencies
are resolved.
To manually configure the project build order:
From the main menu, select Window--&Preferences.
In the left pane, expand General, expand Workspace,
and select Build Order.
Disable the Use default build order option.
Select a project from the list, then click the Up
or Down buttons to position the project where you
want it to appear in the build order list.
When you're done, click Apply, then
In this section, the term “targets” refers to
operations that the make command executes during a
build, not to target machines.
A make target is an action called by
the make utility to perform a build-related task.
For example, QNX Makefiles support a target named
clean, which you invoke as
make clean. The IDE lets you set up your own
make targets (e.g. myMakeStuff). You
can also use a make target to pass options such
as CPULIST=x86, which causes the make
utility to build only for x86. Of course, such an option
would work only if it's already defined in the Makefile.
To add your own custom make target to the C/C++ Project Explorer view's right-click menu:
In the Project Explorer view, right-click a
project and select Create Make Target….
Type the name of your make target (e.g. myMakeStuff).
Click Create.
You'll see your target option listed in the Build Targets
dialog, which appears when you select the Build Make
Target… item from the right-click menu of the C/C++
Project Explorer view. Your targets also appear in the Make Targets
To build your project with a custom make target:
In the Project Explorer view, right-click a
In the context menu, select the Build Make
Target… item. The Build Targets dialog appears.
Select your custom target, then click Build.
To remove a make target:
Open the Make Targets view
(Window--&Show View--&Make
Targets). Expand your project to see your make targets.
Right-click the target you want to remove, and then select Delete Make Target.
Adding a helpful “use” message to your application lets people receive an instant online reminder for command-line arguments and basic usage
simply by typing use&app_name.
Usage messages are plain text files, typically named
app_name.use, which are located in the root of your
application's project directory. For example, if you had the
nodetime project open, its usage message might be in
nodetime.use.
This convention lets the recursive
Makefile system automatically find your usage message
For information about writing usage messages, see
in the Utilities Reference.
To add a usage message to your application when using a QNX C/C++
In the Project Explorer view,
open your project's common.mk file.
specifies common options used for building all of your active
Locate the USEFILE entry.
If your usage message is in
app_name.use, where app_name
is your executable name, add a # character at the start
of the USEFILE line.
This lets the recursive
Makefile system automatically pick up your usage
If your usage message is in a file with a different name, or you
want to explicitly specify your usage message's file name, change
the USAGE line as follows:
USAGE=$(PROJECT_ROOT)/usage_message.use
where usage_message.use is the name of the file
containing your usage message.
This also assumes that your usage
message file is in the root of the project directory.
usage message file is located in another directory, include it
instead of $(PROJECT_ROOT).
Build your project as usual to include the usage message.
To add a usage message to your application when using a Standard C/C++
In the Project Explorer,
open your project's Makefile.
Find the rule you use to link your application's various
.o files into the final executable.
Add the following command to the rule after the link command:
usemsg&$@&usage_message.use
where usage_message.use is the name of the file
containing your usage message.
Build your project as usual to include the usage message.
Before running an application, you must prepare your target.
If it isn't already prepared, you must do so now. For information about configuring your target, see the
chapter in this guide.
After you build a project, you're ready to run it. The
IDE lets you run or debug your executables on
a remote QNX Neutrino target machine. (For a description of
remote targets, see the
To run or debug your program, you must create both of the following:
a QNX Target System Project, which specifies
how the IDE communica once you've
created a QNX Target System Project, you can reuse it for
every program that runs on that particular target.
a launch configuration, which describes how the
program you'll need to set this up only
once for that particular program.
For a complete description of how to create a QNX Target
System Project, see the
chapter in this guide.
For a complete description of the Launch
Configurations dialog and its available options, see
chapter in this guide.
To create a QNX Target System Project:
From the menu, select File--&New--&Other….
In the list, expand QNX.
Select QNX Target System Project.
Click Next.
Type a name for your target.
Type your target's hostname or IP address.
When you update the Target properties from the Attributes pane, your changes won't be updated if you modify the Hostname or IP address, and then click Apply. You must click OK to confirm the changes and close the properties window for the changes to take effect.
Click Finish.
You'll see your new QNX Target System Project in the Navigator view.
To create a launch configuration so you can run your project:
Make sure you build your project first before you create a
launch configuration for it. See “” above.
In the Project Explorer view, expand the Binaries folder.
Right-click on your project's executable file.
Select Run As--&C/C++ QNX Application.
In the Name field, give your launch configuration a name.
In the Target Options section, select your target.
Click the Run button.
Your program runs, and the IDE shows its output (if any) in the Console view.
To delete a project:
In the Project Explorer view, right-click a project and
select Delete from the context menu. The IDE
then prompts you to confirm the deletion.
Decide whether you want to delete only the project
framework, or the project and its contents as well.
When you delete a project in the IDE, any launch
configurations for that project aren't deleted.
This feature lets you delete and recreate a project without
also having to repeat that operation for any corresponding
launch configurations you may have created.
For more on launch configurations, see the
chapter in this guide.
In this section…
The C/C++ editor is where you write and modify your
code. As you work in the editor, the IDE dynamically updates
many of the other views (even if you haven't saved your
The C/C++ editor has a gray border on each side.
The marker bar might contain icons
that indicate errors or other problems detected by the IDE,
as well as icons for any bookmarks, breakpoints, or tasks
(from the Tasks view). The icons in the left margin
correspond to the line of code.
The C/C++ editor.
The border on the right margin shows red and
yellow bars that correspond to the errors and warnings from
the Problems view. Unlike the left margin, the right
margin shows the icons for the entire length of the file.
The Content Assist feature can help you finish the names of
functions if they're long or if you can't remember the exact
To use Content Assist:
In the C/C++ editor, type one or two letters of a
function's name.
Press Ctrl-Space, or right-click near the cursor and select Content
Assist. A menu with the available functions appears:
You can do one of the following:
Continue typing. The list shortens.
Scroll with the up and down arrows. Press Enter to select the function.
Scroll with your mouse. Double-click a function to insert it.
Close the Content Assist window by pressing Esc.
The IDE includes another code-completion feature that can insert
a template for predefined code structures, such as an empty
do-while structure. If you've already used the
Content Assist feature, you may have already noticed the
co you access it the same way.
To use code templates:
As with Content Assist, start typing, then press
Ctrl-Space, or right-click near the cursor and select Content
Any code templates that match the letters
you've typed show at the top of the list:
The IDE lets you enable as many of these templates as
you require, edit them as you see fit, create your own
templates, and so on.
To edit a template or add one of your own:
From the main menu, select Window--&Preferences.
In the left pane, select
C/C++--&Editor--&Templates.
To edit a template, select it, and then click Edit.
To add your own template, click New. A dialog for adding new
templates is displayed:
In the Name field, type a name for this code template.
In the Pattern field, type the code used to form the template. Click Insert Variables to insert variables into the template code.
Click OK when finished.
To insert the appropriate #include directive for any documented QNX Neutrino function:
In the C/C++ editor, double-click the function name, but
don't highlight the parentheses, or any leading tabs or
Right-click and select Source--&Add Include. The IDE automatically adds the #include statement to
the top of the file, if it isn't already there.
The IDE's hover help feature gives you the synopsis for a function while
you're coding.
To use hover help:
In the C/C++ editor, hold your pointer over a function.
You'll see a text box showing the function's summary and
synopsis information:
Hover help in the C/C++ editor.
You can easily add comments using either the C or C++ style,
even to large sections of code. You can add two forward slash characters (//) at the beginning of lines to comment
out large sections, even when they have other comment characters, such as /* */.
When you remove comments from lines, the editor removes the leading
// characters from all lines that have them, so
be careful not to accidentally uncomment sections. Also, the
editor can comment or remove comments from selected lines
— if you highlight a partial line, the editor
comments out the entire line, not just the highlighted
To comment or remove comments from a block of code:
In the C/C++ editor, highlight a section of code to comment or remove comments. For a single line, position your cursor anywhere on
that line.
Right-click and select Comment or Uncomment.
In the C/C++ editor, you can:
change the font
set the background color
show line numbers
set color identifiers in the source code according to their role (e.g. typedefs, functions, variables, and fields)
make code being excluded by conditional compilation be displayed on a gray background
collapse and expand blocks of comments and preprocessor branches in C and C++ files in addition to functions, structures, and so on
set a configurable code formatter with four predefined styles
set typing assistance options, such as the closing of brackets, smart paste, and more
configure context highlighting and change how the Code Assist feature works
control many other visual aspects of the C/C++ editor
You can do all this using C/C++ Editor or Text Editors preference dialogs:
C/C++ editor: Preferences.
To change fonts, background color, or to show line numbers:
Open the Text Editor preferences dialog by
selecting Window--&Preferences.
In the left pane, select General--&Editors--&Text Editors.
On the page, you can select Colors and Fonts at the bottom, or select other options, such as Appearance color options and Show line numbers.
To change syntax highlighting, convert tabs into spaces, and change the
folding options, open the C/C++ editor preferences dialog:
Select Window--&Preferences.
In the left pane, select C/C++--&Editor.
To set Content Assist options, open the Content Assist preferences dialog:
Select Window--&Preferences.
In the left pane, select C/C++--&Editor--&Content Assist.
You can use a different text editor than the one
that's included with the IDE, but you'll lose
the integration of the various views and
perspectives. For example, within the C/C++ editor, you can
set breakpoints and then see them in the Breakpoints view,
or put “to-do” markers on particular lines and
see them in the Tasks view, or obtain hover help as you pause
your cursor over a function name in your code, and so on.
If you want to use other editors, you can do so either externally, or within the IDE.
You can edit your code with an editor started externally from the
IDE (e.g. from the command line). When you're done editing,
you'll have to synchronize the IDE with the changes.
To synchronize the IDE with the changes you've made using an
external editor outside of the IDE:
In the Project Explorer view, right-click the tree pane and
select Refresh. The IDE is updated to
reflect any changes you've made (such as creating new
You can specify file associations that determine the editor you
want to use for each file type. For example, you can instruct
the IDE to use an external program such as WordPad to edit
all .h files. After you set that preference,
you can double-click a file in the Project Explorer view, and
the IDE automatically opens the file in your selected
If you have multiple associations for the same file extension,
the IDE always opens the same editor, which is marked as the default
in the list of editors for this extension, but other associations continue to be available.
To open a file in an alternative editor, right-click on the file you want
to open, select
Open with--&My editor, and then choose the editor.
This change means that you are also changing the default editor for this extension.
If the IDE doesn't have an association set for a certain
file type, it uses the host OS defaults. For example, on a
Windows host, if you double-click a .doc
file, Word or WordPad is automatically launched and opens the
For more information about file associations, follow these links
in the Eclipse Workbench User Guide:
Reference--&Preferences--&File
Associations.
By default, the IDE creates a simple “hello world” C/C++
source file for you, which you may or may not want to use as
a template for your own code.
To create a new C/C++ file:
Highlight the project that contains the new file you're creating.
Click the New C/C++ Source File button on the toolbar:
Enter (or select) the name of the folder where you want the file to reside.
Name your file, then click Finish.
You'll see an empty text editor window, ready for
you to begin working on your new file. Your filename appears highlighted in blue in the title bar above the editor.
In this section…
Besides the features already described above, the IDE has
several other helpful facilities worth exploring.
The Problems view provides you with a list of errors and
warnings related to your projects. These are typically
syntax errors, typos, and other programming errors identified by
the compiler:
The Problems view.
The IDE also shows corresponding markers in several other locations:
Project Explorer view — on both the file that
contained the compile errors, and on the project itself
Outline view — in the method (e.g. main())
C/C++ editor — on the left side, beside the offending line of code
To quickly go to the source of an error (if the IDE can determine where it is):
In the Problems view, double-click the error marker () or warning marker ().
The file containing the error or warning opens in the editor area, with the cursor positioned on the offending line.
Depending on the complexity and stage of your program, the
IDE can generate an overwhelming number of errors. But you
can customize the Problems view so you'll see only the errors
you want to see.
To access the error-filtering dialog:
In the Problems view, click the Filter icon ().
The Filters dialog lets you adjust the scope of the
errors shown in the Problems view. The more options you select, the more errors and warnings the IDE displays in the Problems view.
The Filters dialog, where you can select what errors are displayed in the Problems view.
The Tasks view is part of the core Eclipse platform. For
more information about this view, see these
links in the Workbench User Guide:
Reference--&User interface information--&Views and Editors--&Tasks view.
The Tasks view lets you track your tasks.
The Tasks view lets you create your own tasks for the
unfinished function you're writing, the error-handling routine you
want to check — or for anything at all (e.g. “Pick up a loaf of bread”).
To add a personal task:
In the Tasks view, right-click the tasks pane and select
Add Task, or click the Add Task button in the
Tasks view.
Complete the dialog for your task.
You can associate a task with an editable resource, for instance,
to remind yourself to update a line of source code later:
To associate a task with a resource:
In one of the navigation views, double-click the resource that you want
to associate the new task. The resource opens in the editor area.
Right-click in the gray border at the left of the editor area, beside
the line of text or source code you want to log the new task against.
In the pop-up menu, select Add Task.
When prompted, enter a brief description of the task.
To remove a personal task:
In the Tasks view, right-click the task and select
The Outline view provides you with a structural view of your C/C++ source code:
The Outline view shows the structural view of your source
The view shows the elements in the source file in the order
they occur, including functions, libraries, and variables.
You may also sort the list alphabetically, or hide certain
items (fields, static members, and nonpublic members).
If you click an entry in the Outline view, the
editor's cursor moves to the start of the item selected.
Description
Hide Fields
Hide Static Members
Hide Non-Public Members
Sort items alphabetically
Description
Macro Definition
Enumerator
Field private
Field protected
Field public
Method private
Method protected
Method public
Type definition
You can filter the Outline view by choosing to display or hide various items, such as fields, static members, and non-public members. You can select an element in the Outline view and then:
Right-click and select either Declarations or References.
select one of the following options:
Project — to open the C/C++ Search window to perform a text-based search of a project for the selected element.
Workspace — to perform a text-based search of a workspace for the selected element.
Working Set… — to perform a text-based search of a specified working set for the selected element.
Use working sets to group elements to display in the Outline view, or for operations on a set of elements. When using the search facility, you can also use working sets to restrict the set of elements that are searched.
The Working Sets dialog for selecting elements to display in the Outline view.
If you click New to create a new working set, you can choose from these different types: QNX Sources, C/C++, a Breakpoint, and a Resource working set.
The Console view shows the output from the make utility:
The Console view shows the output from make.
You can choose to clear the Console view before each new
build or let the output of each subsequent build grow in the
display. Whenever you perform a build, you can also have the Console view appear on top of the other stacked views.
To set the preferences for the Console view:
From the main menu, select Window--&Preferences.
In the left pane, select C/C++--&Build Console:
The C Build Console preferences.
While editing source code in the editor, you can select a
function name and press F3, and the editor immediately
jumps to the prototype for that function (if the file is
also in your project).
Press Ctrl-F3, and the
editor immediately jumps to the function's implementation (if the file is also in
your project).
For more information about the C/C++ perspective,
see the link Help--&Help Contents in the Workbench User Guide and the C/C++ Development User Guide.
To open a header file, right-click the file's name in the Outline view (for example stdio.h), and then choose Open.
Many of the enhanced source navigation (including opening header files)
and code development accelerators available in the C/C++ editor are extracted from the
source code. To enable these features and provide the most accurate data representation, you must properly configure the project with the include paths and
define directives used to compile the source.
For QNX projects, the include paths and definitions are set automatically based on the compiler and architecture. You can set additional values in the project's properties.
For C/C++ Make projects, you must define the values yourself, either manually using the Paths and Symbols
tab of the project's properties, or automatically
using the Set QNX Build Environment… item in the
project's context menu.
To set the include paths and define directives
for a C/C++ Make project:
In the Project Explorer view, right-click your project and select
Properties. The Properties dialog for the selected project appears.
On the left, expand C/C++ Build and select Settings. The Settings panel appears.
Select the Tool settings tab.
Select the appropriate compiler, language, and architecture for your project.
Click Apply.
On the left, expand C/C++ General and select Paths and Symbols.
The Paths and Symbols panel appears:
Specify any required include information.
The Go To Type command lets you jump directly to a specific type. Navigating by type provides direct navigation to the following:
namespace, typedef, class, enum, struct, and union.
Navigating using the Go To Type command.}

我要回帖

更多关于 clean the window 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信