![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux编程相关
帆的孤独啊
这个作者很懒,什么都没留下…
展开
-
source cmd
source是执行一个文件在当前shell中生效, 而用./filename或者sh filename 都是相当于额外开一个shell执行(执行结果在当前shell中不生效) 所以一般用户配置文件生效方式会采用 source ~/.bash_profile。测试方法: 编写tmp.sh 内容为export test=2, 使用sh tmp.sh 时, echo $test为空, 使用...原创 2019-12-11 10:49:27 · 726 阅读 · 0 评论 -
pkg-config妙用
1.makefile 中选项cflags 指定头文件路径 eg: CFLAGS=-I/usr/includeLDFLAGS: 库文件位置 eg: LDFLAGS=-L/usr/lib -L/path/to/your/libLIBS:告诉链接器要链接哪些库文件,如LIBS = -lpthread -liconvgcc 选项: -I -L2.pkg-configLInux命令,...原创 2018-10-21 19:15:23 · 238 阅读 · 0 评论 -
makefile 写法
// ” “表示首先在源文件目录下查找// include 内容在预处理时把头文件里定义内容复制到当前行,进行宏定义的替换, 在编译阶段检查语法错误,生成文本文件//汇编后生成目标文件 .o, 链接阶段分为静态链接和动态链接, 静态链接在编译时把库文件中全部文件加入到可执行文件中(后缀名.a), 动态链接字执行时加载,后缀名.so#include <iostream>#inc...原创 2018-10-26 11:35:17 · 142 阅读 · 1 评论 -
ubuntu 编译安装gcc 6.3
1. 参考博客编译安装gcc 6.3对make出错解决:错误一error: dereferencing pointer to incomplete type 'struct ucontext' 解决方法:In order to havemaketo work you have to modify the filemake_folder/libgcc/config...原创 2019-03-19 13:49:31 · 3536 阅读 · 2 评论 -
mac xquartz+iterm2
1.下载并安装xquartz2.配置过程参考3. 点击 xquartz 右键 自定义 添加一个命令指向iterm2 我这里添加的是/Applications/iTerm.app/Contents/MacOS/iTerm24.选择刚刚添加的iterm2 运行,但是这样只能在xquartz中运行。此时输入echo $DISPLAY 发现是:0.0, 打开bash_profile ...原创 2019-03-22 20:07:49 · 3397 阅读 · 1 评论 -
macos 编译gmplib 及cmake配置
1.下载gmp文件 解压后./configure –enable-cxxmakemake checkmake install2. 配置cmake创建FindGMP.cmake 使用这个文件找到相关头文件和动态库set(GMP_PREFIX "" CACHE PATH "path ")find_path(GMP_INCLUDE_DIR gmp.h gmpxx.h...原创 2019-04-11 14:58:25 · 1378 阅读 · 2 评论