Embedded Development Tools

Embedded Linux development tools,
vim, gcc gdb, the make.
Vim (text editor): learn to use and how to configure vim;
gcc (compiler): how to make dynamic and static libraries and use the difference;
gdb (debugger): set breakpoints, single-step execution, debug memory errors;
the make (project Manager): write the makefile;
Linux text editor: vim - the most powerful text editor - get rid of the mouse;
vi-vim-gvim: command-line mode (nyy \ p \ ndd \ u ), insert mode (i a.), the bottom line mode (shift +:)
how to configure vim?
/ etc / vim / vimrc the SET Number The
IDE (integrated development environment) -vscode
embedded Linux development tools -gcc
compiler: gcc (GNU CC)
gcc features (GNU tools, cross-compiler)
What is the cross-compiler?
cross compiler: compile the code enforceable in other CPU platform CPU platform in the current
source file to the executable which documents need to go through several steps?
preprocessing, compiler, assembler, linker
(PC: x86) hello.c gcc helllo.c a.out ./a.out -> Linux phone (ARM)
pretreatment: expand the header file, macro substitution, conditional compilation -EI -D
compiler: preprocessing documents translated into the assembler file .s -S
assembler : The compilation of documents compiled object file .o -C
Links: Create symbol table - the executable file a.out
renaming the executable file

Commonly used compiler options:
-ESCoID
-Wall -W-
01 -02 -03
Second, the production of static and dynamic library of
what libraries 1. Save functions and variables (warehouse) Features:? Saving functions and variables can only be used but can not see its implementation
; 2, Linux libraries:
static library: load at compile time; (to load the code library files to the source files) dynamic libraries: loaded at runtime;
1. use static library generated executable file greater than the dynamic library generated executable file (program memory for running more)
2, the use of static libraries generated executable file is difficult to upgrade; dynamic libraries generated executable file is easy to upgrade;
how to make a static library?
1, first create a .c file with vim
2, will need to save the file where the function compiled object file -c add.c- gcc> add.o
3, static library creation tool:
Arar RCS (it does not exist to create, there is updated) library name of the target file name ar rcs libadd.a add.o3
use gcc source file name -L -l library inventory put the path
gcc main.c -ladd -L -o add
how to create a dynamic library?
gcc -shared -fPIC
source file -o libcal.sogcc -shared -fPIC add.c sub.c -o libcal.so
use:
cp libcal.so/usr/libgcc main.c -lcalgcc main.c./libcal.so -o calgcc -static
role is to prohibit the use of shared connections.

Published 10 original articles · won praise 0 · Views 270

Guess you like

Origin blog.csdn.net/m0_46451503/article/details/104906294