我最近下载了适用于OSX的Cinder预构建版本,并惊讶地发现它与Xcode紧密相关。我一直试图使用一个简单的Makefile来构建和链接first part of "Hello Cinder",但是还没有能够找出所有需要包含的目录和链接的库。有没有人尝试过这个,你有一个Makefile的例子,它正确地设置了包含和库依赖,以便运行一个简单的Cinder应用程序吗?
cinder.cpp:
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class CinderProjectApp : public AppNative {
public:
void setup();
void mouseDown( MouseEvent event );
void update();
void draw();
};
void CinderProjectApp::setup()
{
}
void CinderProjectApp::mouseDown( MouseEvent event )
{
}
void CinderProjectApp::update()
{
}
void CinderProjectApp::draw()
{
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
}
CINDER_APP_NATIVE( CinderProjectApp, RendererGl )
我当前的makefile:
CXX=clang
CINDER_INSTALL = /usr/local/src/cinder_0.8.6_mac
CXX_FLAGS=-std=c++11 -stdlib=libc++ -m64
CXX_PATH =-I$(CINDER_INSTALL)/include/ -I$(CINDER_INSTALL)/boost/ -L$(CINDER_INSTALL)/lib/ -L$(CINDER_INSTALL)/lib/macosx/ -L/System/Library/Frameworks/OpenGL.framework/Libraries/
LLIBS =-lboost_date_time -lboost_filesystem -lboost_system -lz -lcinder -lGL
cinder.o:
$(CXX) $(CXX_FLAGS) $(CXX_PATH) $(LLIBS) -c src/cinder.cpp
cinder: cinder.o
$(CXX) $(CXX_FLAGS) $(CXX_PATH) $(LLIBS) -o cinder cinder.o
当前输出:
smithj1@signal: make cinder
clang -std=c++11 -stdlib=libc++ -m64 -I/usr/local/src/cinder_0.8.6_mac/include/ -I/usr/local/src/cinder_0.8.6_mac/boost/ -L/usr/local/src/cinder_0.8.6_mac/lib/ -L/usr/local/src/cinder_0.8.6_mac/lib/macosx/ -L/System/Library/Frameworks/OpenGL.framework/Libraries/ -lboost_date_time -lboost_filesystem -lboost_system -lz -lcinder -lGL -c src/cinder.cpp
clang: warning: -lboost_date_time: 'linker' input unused
clang: warning: -lboost_filesystem: 'linker' input unused
clang: warning: -lboost_system: 'linker' input unused
clang: warning: -lz: 'linker' input unused
clang: warning: -lcinder: 'linker' input unused
clang: warning: -lGL: 'linker' input unused
clang: warning: argument unused during compilation: '-L/usr/local/src/cinder_0.8.6_mac/lib/'
clang: warning: argument unused during compilation: '-L/usr/local/src/cinder_0.8.6_mac/lib/macosx/'
clang: warning: argument unused during compilation: '-L/System/Library/Frameworks/OpenGL.framework/Libraries/'
clang -std=c++11 -stdlib=libc++ -m64 -I/usr/local/src/cinder_0.8.6_mac/include/ -I/usr/local/src/cinder_0.8.6_mac/boost/ -L/usr/local/src/cinder_0.8.6_mac/lib/ -L/usr/local/src/cinder_0.8.6_mac/lib/macosx/ -L/System/Library/Frameworks/OpenGL.framework/Libraries/ -lboost_date_time -lboost_filesystem -lboost_system -lz -lcinder -lGL -o cinder cinder.o
Undefined symbols for architecture x86_64:
"_AudioComponentFindNext", referenced from:
cinder::audio::cocoa::findAudioComponent(AudioComponentDescription const&) in libcinder.a(libcinder.a-x86_64-master.o)
cinder::audio::cocoa::findAndCreateAudioComponent(AudioComponentDescription const&, ComponentInstanceRecord**) in libcinder.a(libcinder.a-x86_64-master.o)
"_AudioComponentInstanceDispose", referenced from:
(ETC...)