0

我最近下载了 Cinder for OSX 的预构建版本,并惊讶地发现它与 Xcode 的紧密联系。我一直在尝试使用简单的 Makefile 构建和链接“Hello Cinder”的第一部分,但无法找出需要包含的所有目录和链接的库。以前有没有人尝试过这个,你有一个 Makefile 的例子,它可以正确设置包含和库依赖项以运行一个简单的 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...)
4

0 回答 0