忍者ブログ
MASTER →  ADMIN / NEW ENTRY / COMMENT
現代魔法(nearly equal 情報技術)を勉強中な人のメモ(チラシの裏)
/ 2017/09/21 (Thu) / 編集
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

/ 2009/12/16 (Wed) / 編集
デモプログラムの癖に、移動させるとコンパイルできなくなるってどうよ?

MacOSXにBulletを入れたわけだよ、もちろん正常にframeworkがインストールできたわけね、だからDemoのソースコードたちだけコピーしてとっておいて他のを削除したわけだよ、、、、

普通さ、サンプルプログラムってそのプログラム単体でコンパイルできるでしょ?Bulletはちがうんだよなんか。。。
Demo/BasicDemoをコンパイルするのにDemo/OpenGLが必要なんだよ!

というわけで、オプションすべてつけたはずなのに以下のようなエラーが出るは注目!
main.cpp: In function ‘int main(int, char**)’:
main.cpp:72: warning: unused variable ‘tmp’
main.cpp:69: warning: unused variable ‘ourPtr’
Undefined symbols:
  "DemoApplication::shootBox(btVector3 const&)", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "DemoApplication::~DemoApplication()", referenced from:
      BasicDemo::~BasicDemo()in ccOoEC0K.o
      BasicDemo::~BasicDemo()in ccOoEC0K.o
      BasicDemo::~BasicDemo()in ccOoEC0K.o
      BasicDemo::~BasicDemo()in ccOoEC0K.o
      _main in ccxwz4lq.o
      _main in ccxwz4lq.o
  "DemoApplication::keyboardCallback(unsigned char, int, int)", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "DemoApplication::mouseFunc(int, int, int, int)", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "glutmain(int, char**, int, int, char const*, DemoApplication*)", referenced from:
      _main in ccxwz4lq.o
  "vtable for GlutDemoApplication", referenced from:
    _main in ccxwz4lq.o
  "vtable for GlutDemoApplication", referenced from:
      __ZTV19GlutDemoApplication$non_lazy_ptr in ccOoEC0K.o
      __ZTV19GlutDemoApplication$non_lazy_ptr in ccxwz4lq.o
  "typeinfo for GlutDemoApplication", referenced from:
      typeinfo for BasicDemoin ccOoEC0K.o
  "GlutDemoApplication::specialKeyboard(int, int, int)", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "DemoApplication::DemoApplication()", referenced from:
      _main in ccxwz4lq.o
  "GLDebugDrawer::GLDebugDrawer()", referenced from:
      _main in ccxwz4lq.o
  "DemoApplication::renderme()", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "DemoApplication::reshape(int, int)", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "DemoApplication::clientResetScene()", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "DemoApplication::setShootBoxShape()", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "GlutDemoApplication::swapBuffers()", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "GlutDemoApplication::updateModifierKeys()", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "DemoApplication::updateCamera()", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
  "DemoApplication::setCameraDistance(float)", referenced from:
      BasicDemo::initPhysics()      in ccOoEC0K.o
  "DemoApplication::mouseMotionFunc(int, int)", referenced from:
      vtable for BasicDemoin ccOoEC0K.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [BasicDemo] Error 1


コンパイルには、Demo/OpenGLを同梱する必要があります。つまりBasicDemo.cppをコンパイルするときのMakefileはこう
CC = g++ -O2 -Wall

libGL = -framework OpenGL -framework GLUT -framework Foundation
incOpenGL = -I../OpenGL
libBULLET =  -framework BulletCollision -framework BulletDynamics -framework BulletSoftBody -framework LinearMath

SUPPORTFILES = ../OpenGL/*.cpp

LIBS = $(libGL) $(libBULLET)

all:
	$(CC)  BasicDemo.cpp main.cpp $(SUPPORTFILES) $(LIBS) $(incOpenGL) -o AppBasicDemo

気をつけようね!(主に俺w)

拍手[0回]

PR
忍者ブログ [PR]