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

最新文章

  1. iOS获取app图标和启动图片名字(AppIcon and LaunchImage's name)
  2. Vigenère 密码NOIP 2012 提高组 第一天 第一题
  3. mysqldump常用参数
  4. 简单易用的导出文件(Excel、word等各种格式)的方法
  5. Linux下搭建Oracle11g RAC(7)----安装Oracle 软件
  6. C# 各版本更新简介
  7. scons构建自己的一个简单的程序
  8. VBA 简单调试
  9. 【转载】stm32中断学习
  10. 海量数据挖掘MMDS week4: 推荐系统之隐语义模型latent semantic analysis
  11. Linux Collection:用户管理
  12. CF_2018-2019 Russia Open High School Programming Contest (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
  13. context使用
  14. JavaScript-DOM(重点)
  15. ThinkPHP3.2.3框架下where的组合查询and、or方法
  16. xshell帮助
  17. FCN的理解
  18. 单细胞RNA-seq比对定量用什么工具好?使用哪个版本的基因组?数据来说话
  19. php file_get_contents fopen 连接远程文件
  20. js判断操作系统与浏览器

热门文章

  1. jenkins jmeter持续集成批处理jmx脚本
  2. JqGrid的总结大全【转】
  3. linux kernel module
  4. [转]8 Regular Expressions You Should Know
  5. 安装VMWare WorkStation 10 异常【 Failed to create the requested registry keyKey:Installer Error: 1021】
  6. C#中的DataSet添加DataTable问题
  7. json 多重嵌套反序列化和序列化
  8. 用Karma和Jasmine测试Angular应用
  9. Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
  10. VS2013中使用QT插件后每次重新编译问题