- Content
- How can I setup a new TXT application or SLI project from scratch
- Introduction
- How to add a project from scratch?
- Step 1
- Step 2 Set the type of the project and the name
- Step 3 Select Configuration
- Step 3A Advanced settings: Set -fPIC flag
- Step 3B Advanced settings: Set the dialect ISO C11/C++11
- Step 3C Advanced settings: Set the reference to the Include in the TxtDeps.
- Step 3D Advanced settings: Set the reference to the Library Paths of the TxtDeps
- Step 3E Advanced settings: Updating the Libraries list
- Step 3E Advanced settings: Preparation
- Step 3F To the next step
- Step 4 up to 9 reserve
- Step 10 Cross GCC Commands
- Step 11 up to 12 reserve
- Step 13 + 14
- Step 15 + 16
- Step 17
- Step 18
- Step 19 Updating the Library list (continue)
- Step 20
- document history
If you have already a workspace with the TxtDeps ready then you can skip this step.
-
To start with a new application project, you need to have a workspace, for example
H:\workspace\FtTxtWorkspace
.
FtTxtWorkspace
is here your Eclipse workspace name. -
In this workspace you place the
TxtDeps-project
(if it is not their already). ThisTxtDeps
-project contains all the information about the includes and libraries which are available on the TXT. -
Now you can start Eclipse. Eclipse will ask for the workspace directory.
-
There is one important preference setting for the workspace to realize. The directory to your Linaro toolchain.
In this example the toolchaingcc-linaro-7.2.1-2017.11-i686-mingw32_arm-linux-gnueabihf
has been installed inH:\TXT\toolchain\
-
How to add the library TxtDeps to Eclipse?
Now is your workspace ready to add new or import existing projects to it.
There are a couple of ways to start a new project within Eclipse:
- Create a new project from scratch with the Eclipse File-menu..
- Add/Import the TxtNewProj to your workspace and rename it. You need to check the project settings of the new project.
- Copy the project in the Eclipse Project Explorer and Paste it there too. Eclipse will ask you for a new name for the project. You need to check the project settings of the new project. Remove what your not need.
Go the the top menu File
and select New C/C++ Project
.
Select C++ Managed Build
and press Next
.
Add a name for your project.
Choose Shared Library
for a SLI or Executable
for an TXT application.
And select the Cross GCC
option and press Next
.
For the moment we don't use the Debug configuration so only the release
press Advanced settings...
.
(Only needed for SLI's)
Set the -fPIC
position independent code generation
Set the compiler option. This is important for dynamic linking.
If forgotten the compiler will generate an error.
Press Apply
C/C++ knows a lot of dialects.
Press Apply
Press Apply
Add both the Txt_libs`` and Txt_Libs_deps
to `Library`.
Press Apply
For Updating the long dynamic library link list we are going to use a little tric.
The .cproject file will edit directly.
A small preparation:
Add a dummy so you can find back the library section in the .cproject later.
Press Apply and Close
.
You are ready with step 3 so press (3) Next
for the next step.
Now the reference to the tool chain needs to be fill in and we are going to use our workspace environment variable LinaroMap
in the form ${LinaroMap}
The cross compiler prefix = arm-linux-gnueabihf-
The cross compiler path =${LinaroMap}\gcc-linaro-7.2.1-2017.11-i686-mingw32_arm-linux-gnueabihf\bin
So after browsing you will need to replace the directory part with ${LinaroMap}
.
And press Finish
and the base for your project is ready.
Add two maps to the project:
- src: for the source files
- inlcudes: for the header files
- you can add more if you need for the organization of your project.
Add the include and src to the project properties.
Check The Environments settings.
Set the build engine to the internal one. Otherwise the compiler will generate an error at the beginning of a build of your project.
Close your new project.
- Close the project.
- Open the .cproject in Notepad++
- Search for the DummyXXX project
- Copy the XML list with library names from the README in the
TxtDeps
project - Drop this list here.
- Don't forget to remove the XML entry with the dummy.
- Open the project again in Eclipse and inspect the library list in the project properties.
- 2020-05-16,28 CvL 466.1.1 new