我从源以在Mac OS X 10.6 / lib目录/编译的FreeImage FreeImage的3.10.0。
我可以看到,编译后,这些文件被复制:
/usr/local/lib/libfreeimage-3.10.0.dylib
/usr/local/lib/libfreeimage.a
/usr/local/include/FreeImage.h
CMake的不能找到FreeImage的,但我不能连做
#include <FreeImage.h> // not found
我假设我需要FreeImage.h添加到Mac OS X环境的路径,但我不知道哪条路是正确的,因为是存储环境路径变量的几个不同的文件。
什么我需要做的就是FreeImage的头被我的C ++应用程序或CMake的发现?
这是我的第一部分Makefile.osx
被这有助于:
# -*- Makefile -*-
# Mac OSX makefile for FreeImage
# This file can be generated by ./gensrclist.sh
include Makefile.srcs
# General configuration variables:
CC_PPC = gcc-4.0
CC_I386 = gcc-4.0
CPP_PPC = g++-4.0
CPP_I386 = g++-4.0
COMPILERFLAGS = -Os -fexceptions -fvisibility=hidden
COMPILERFLAGS_PPC = -arch ppc
COMPILERFLAGS_I386 = -arch i386
COMPILERPPFLAGS = -Wno-ctor-dtor-privacy
INCLUDE +=
INCLUDE_PPC = -isysroot /Developer/SDKs/MacOSX10.6.sdk
INCLUDE_I386 = -isysroot /Developer/SDKs/MacOSX10.6.sdk
CFLAGS_PPC = $(COMPILERFLAGS) $(COMPILERFLAGS_PPC) $(INCLUDE) $(INCLUDE_PPC)
CFLAGS_I386 = $(COMPILERFLAGS) $(COMPILERFLAGS_I386) $(INCLUDE) $(INCLUDE_I386)
CPPFLAGS_PPC = $(COMPILERPPFLAGS) $(CFLAGS_PPC)
CPPFLAGS_I386 = $(COMPILERPPFLAGS) $(CFLAGS_I386)
LIBRARIES_PPC = -Wl,-syslibroot /Developer/SDKs/MacOSX10.6.sdk
LIBRARIES_I386 = -Wl,-syslibroot /Developer/SDKs/MacOSX10.6.sdk
LIBTOOL = libtool
LIPO = lipo
更新:我添加几行代码写进我的Makefile文件按尼古拉斯的说明,然后重建但这并没有工作:
CFLAGS = -I/usr/local/include
LDFLAGS = -L/usr/local/lib