依赖库查询
objdump -x xxx | grep NEEDED
ldd xxx
readelf -d xxx
glibc版本信息查看:strings “/lib/x86_64-linux-gnu/libc.so.6” | grep LIBC
nm xx | grep GLIBC查看是否依赖glibc
https:
linux让程序优先加载当前路径动态库
1、设置LD_LIBRARY_PATH
修改/etc/profile在文件末尾加上两行: LD_LIBRARY_PATH=./ 和 export LD_LIBRARY_PATH
source /etc/profile
PS:当前会话有效
2、设置rpath
-Wl,--rpath=lib_path
PS:建议
3、在/etc/ld.so.conf.d/下增加xxx.conf
在xxx.conf里写依赖库路径,修改完成,执行命令ldconfig
PS:不建议,可能会导致系统启动失败
新建系统,root无密码,需要先设置
sudo passwd root
vscode安装
1、sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
2、sudo apt-get update
3、sudo apt-get install ubuntu-make
4、umake ide visual-studio-code
Ubuntu下VS安装以及C++环境配置
https:
sudo apt-get install gcc
sudo apt-get install g++
增加用户
useradd -d /home/test -m test(创建test)
passwd test(修改test 密码)
userdel -r test(删除test)
usermod -s /bin/bash test(为用户指定命令解释行为)
管理员账户:
修改/etc/sudoers, 找到下面root ALL=(ALL:ALL) ALL添加(cus_admin)
cus_admin ALL=(ALL:ALL) ALL
qt安装
sudo apt-get install build-essential (开发环境安装)
sudo apt install --reinstall libxcb-xinerama0 (解决:libxcb-xinerama.so.0: cannot open shared object file)
./qt-unified-linux-x64-4.5.0-online.run
grpc安装
https:
https:
https:
git submodule update --init
git clone --recurse-submodules https:
windows:
cmake(https:
nssm(https:
perl(https:
go(https:
git(https:
https:
proc文件处理(xx.proto):
grpc
protoc.exe --grpc_out=. --plugin=protoc-gen-grpc=path\grpc_cpp_plugin.exe xx.proto
cpp
protoc.exe --cpp_out=. xx.proto
unix:
cmake、go、git
github访问慢(Ubuntu)
进入终端命令行模式,输入sudo gedit /etc/hosts
用浏览器访问 IPAddress.com 使用 IP Lookup 工具获得github.com和github.global.ssl.fastly.net域名的ip地址
在gedit打开的hosts文件中最后面添加如下格式:
140.81.112.1 github.com
199.231.69.191 github.global.ssl.fastly.net
(上面两行中的ip要根据第2步中查询到的ip填写)
保存hosts文件
更新DNS缓存,输入sudo /etc/init.d/networking restart
go安装
https:
https:
x11
https:
sudo apt-get install libx11-dev(安装前更新源:apt-get update)
sqlite下载
https:
windows下编译
1、lib.exe /def:sqlite3.def(默认32位,如果64位,需要加/machine:x64)
https:
1、下载sqlite3源码
从官网下载对应的压缩包 :wget https:
2、对压缩包进行解压
tar -xzvf sqlite-autoconf-3350400.tar.gz
3、进入到解压的文件夹内
cd sqlite-autoconf-3350400/
4、运行相应的配置文件
./configure prefix=install_path
5、make
6、make install
soci编译
下载地址:https:
cmake -G "Visual Studio 16" -A=Win32 -DWITH_SQLITE3=ON -DSOCI_SQLITE3=ON -DSQLITE3_INCLUDE_DIR=D:\Develop\sqlite\include -DSQLITE3_LIBRARY=D:\Develop\sqlite\lib\sqlite3.lib ../
-DCMAKE_INSTALL_PREFIX=E:\Project\TeamProject\SOCI\soci-4.0.1\soci
openssl编译
下载地址:https:
编译:./config --prefix=install_path
make
make install
curl编译
下载地址:https:
编译:./configure --prefix=install_path --with-openssl=ssl_install_path
make
make install
安装SVN桌面程序(rabbitvcs)
1. sudo add-apt-repository ppa:rabbitvcs/ppa
2. sudo apt-get update
3. sudo apt-get install rabbitvcs-nautilus
4. sudo apt-get install rabbitvcs-gedit
压缩/解压缩文件
zip file -r dir tar -zcvf file.tar.gz files
unzip file(-d dir) tar -zxvf file.tar.gz -C dir
Vim中退格异常
修改/etc/vim/vimrc.tiny增加
set nocompatible
set backspace=2
增加环境变量
编辑~/.profile,新增export ENV_DEV=/path ,退出保存
执行source ~/.profile
DBus安装
sudo apt-get install libdbus-1-dev
链接库:dbus-1