Vim configuration file location:/Etc/Vim/vimrc ~ /. Vimrc
Steps for creating an ide
, Ta, NN Testing
Use large ide
, Da generation documentation description, DD generation function description
, JD jump function, O closes other windows, BF displays the list of opened files
Use of GCC parameters:
Create a dynamic library and a static library in Linux. The file structure is shown below:
Create a static library. The static library ends with.:
Generate static library files using makefile in SRC
libcalc.a:
gcc -c *.c
ar rcs libcalc.a *.o
mv libcalc.a ../lib
clean:
rm -rf *.o
rm -rf libcalc.a
rm -rf ../lib/libcalc.a
The MAKEFILE file of Main. C is used to link the static library and run
all:
GCC main. C-iinclude lib/libcalc. A-O app //-iinclude is the address of the specified header file
clean:
Make-c src clean // make-C is to enter the src directory and execute the "make clean" command of SRC.
rm -rf app
Another method: You can use the GCC-C main. C-iinclude command to generate a main. o file and then compile the GCC main. O lib/libcalc. A-O app and the static library together.
Create a dynamic library: the dynamic library ends with. So
Generate a dynamic library file using makefile in SRC
libcalc.so:
gcc -fPIC -c *.c
gcc -shared -W -o libcalc.so *.o
mv libcalc.so ../lib
Link the dynamic library to generate the executable file GCC main. C-iinclude-L./lib-lcalc-O app
Explanation:-L./lib specifies the directory where the library is located-The lcalc library name is libcalc. So-L is short for Lib, so can be omitted, So-lcalc
Unfortunately, the following error is reported:
LDD./APP: No dynamic library found
How to find the dynamic library: What the instructor taught
At this time, you need to modify/etc/lD. So. conf and add the lib directory to it with the root permission.
Then, run sudo ldconfig and then LDD to see the dynamic library.
Then you can execute it.
Another way to find the dynamic library:
Linux does not search for executable programs in the current directory, nor does it look for the so library files in the current directory earlier
How to modify the user configuration file
1 cd
2 VI. bash_profile (under Ubuntu, It Is. Profile)
3 Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:. This is more difficult, = no space on both sides
4. Save and exit
5. bash_profile
Static library error cause nm view library files
You can use the NM command to view the symbol table of a database, so that you can view the errors in it.
From Weizhi note (wiz)
8.19 create a dynamic Vim ide static library