简体   繁体   English

在Mac OS 10.8.2中编译VXL,未找到X11 / Xlib.h

[英]Compiling VXL in Mac OS 10.8.2, X11/Xlib.h not found

I am trying to install the VXL, when I typed in "make -j1", I got this 我正在尝试安装VXL,当我输入“ make -j1”时,我得到了这个

[ 10%] Building C object v3p/netlib/examples/CMakeFiles/netlib_showme.dir/showme.o
/Users/viviantung/downloads/vxl-1.17.0/v3p/netlib/examples/showme.c:106:10: fatal error: 
  'X11/Xlib.h' file not found
#include <X11/Xlib.h>
     ^
1 error generated.
make[2]: *** [v3p/netlib/examples/CMakeFiles/netlib_showme.dir/showme.o] Error 1
make[1]: *** [v3p/netlib/examples/CMakeFiles/netlib_showme.dir/all] Error 2
make: *** [all] Error 2

What should I do? 我该怎么办? I already have XQuartz installed. 我已经安装了XQuartz。 Thanks. 谢谢。

X11 header files are located under /usr/X11R6/include directory. X11头文件位于/usr/X11R6/include目录下。 What you need to do is ask the compiler to search there by using -isystem /usr/X11R6/include command line option. 您需要做的是让编译器使用-isystem /usr/X11R6/include命令行选项在-isystem /usr/X11R6/include搜索。 Or, if you are using CMake, use include_directories("/usr/X11R6/include") . 或者,如果您使用的是CMake,请使用include_directories("/usr/X11R6/include")

  1. download vxl-1.14.0 下载vxl-1.14.0
  2. create a folder named vxl , extract the vxl-1.14.0.zip in vxl , also create a folder named bin under vxl folder. 创建一个文件夹名为vxl ,提取vxl-1.14.0.zipvxl ,还可以创建一个命名的文件夹binvxl文件夹。
  3. make sure you installed cmake and xquartz . 确保安装了cmakexquartz
  4. open terminal, cd in the path of bin folder you created and typed ccmake /User/..../vxl/vxl-1.14.0 press c until you can press g to generate. 打开终端,在创建的bin文件夹的路径中输入cd,然后键入ccmake /User/..../vxl/vxl-1.14.0c直到可以按g生成。 then press g , and press q to quit. 然后按g ,然后按q退出。
  5. under bin folder typed make -j2 -k 在bin文件夹下键入make -j2 -k

hope you can build it successfully. 希望您可以成功构建它。

A brute force way to solve this problem if all else fails is to define CXXFLAGS or CFLAGS in your environment. 如果所有其他方法均失败,则解决此问题的蛮力方法是在您的环境中定义CXXFLAGS或CFLAGS。

Add

export CFLAGS="-I/opt/X11/include"

or 要么

export CXXFLAGS="-I/opt/X11/include"

depending on c or c++ compiler into your ~/.bashrc or ~/.bash_profile and then rerun. 取决于c或c ++编译器,将其放入〜/ .bashrc或〜/ .bash_profile,然后重新运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM