运行CImg库笔记
2024-10-09 14:08:27
1. 在程序代码中加入
#include "CImg.h"
using namespace cimg_library;
2.
(1)Mac下
出现错误“无X11/Xlib.h”,:
解决方案:
安装XQuartz
建立X11到系统库的硬连接
sudo ln -s /opt/X11/include/X11 /usr/local/include/X11
sudo ln -s /opt/X11/include/X11 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10..sdk/usr/include/
(2)ubuntu下
出现无 X11/Xlib.h 的错误
解决方案:打开终端,安装X11
$sudo apt-get install libx11-dev
如果出现未找到软件包:
在“设置->软件源”中扫描更新为最快的软件源
3. 编译
样例:代码源文件 test.cpp 输出文件 test
(1)mac 下
g++ -o hello test.cpp -O2 -lm -lpthread -L/usr/X11R6/lib -lm -lpthread -lX11
g++ -o test test.cpp -O2 -lm -lpthread -L/usr/X11R6/lib -lm -lpthread -lX11
(2)ubuntu 下
g++ -o test test.cpp -O2 -L/usr/X11R6/lib -lm -lpthread -lX11
最新文章
- iOS获取app图标和启动图片名字(AppIcon and LaunchImage's name)
- Vigenère 密码NOIP 2012 提高组 第一天 第一题
- mysqldump常用参数
- 简单易用的导出文件(Excel、word等各种格式)的方法
- Linux下搭建Oracle11g RAC(7)----安装Oracle 软件
- C# 各版本更新简介
- scons构建自己的一个简单的程序
- VBA 简单调试
- 【转载】stm32中断学习
- 海量数据挖掘MMDS week4: 推荐系统之隐语义模型latent semantic analysis
- Linux Collection:用户管理
- CF_2018-2019 Russia Open High School Programming Contest (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
- context使用
- JavaScript-DOM(重点)
- ThinkPHP3.2.3框架下where的组合查询and、or方法
- xshell帮助
- FCN的理解
- 单细胞RNA-seq比对定量用什么工具好?使用哪个版本的基因组?数据来说话
- php file_get_contents fopen 连接远程文件
- js判断操作系统与浏览器
热门文章
- jenkins jmeter持续集成批处理jmx脚本
- JqGrid的总结大全【转】
- linux kernel module
- [转]8 Regular Expressions You Should Know
- 安装VMWare WorkStation 10 异常【 Failed to create the requested registry keyKey:Installer Error: 1021】
- C#中的DataSet添加DataTable问题
- json 多重嵌套反序列化和序列化
- 用Karma和Jasmine测试Angular应用
- Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
- VS2013中使用QT插件后每次重新编译问题