0
openFrameworks和cocos2d都有一個包裝EAGLview.h
,當然你不能只使用兩者。只需添加這兩個庫(libcocos2d.a
和libofxiPhone_iphoneos_Release.a
)到我的項目給出了一個鏈接錯誤:兩個庫擴展了EAGLview,我想使用它們兩個。怎麼樣?
ld: duplicate symbol _OBJC_METACLASS_$_ES1Renderer in /Developer/of_007_iphone/apps/cwi007/iTicTacToe/libofxiPhone_iphoneos_Release.a(ES1Renderer.o) and /Developer/of_007_iphone/apps/cwi007/iTicTacToe/libs/libcocos2d.a(ES1Renderer.o) for architecture armv7
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
我在寫我的計劃的核心在了openFrameworks,因爲它很容易和C++。我想將UI,轉換,菜單等與cocos2d,因爲它也很容易,看起來不錯。
我試圖
#define __OPENFRAMEWORKS__
在一個.h
文件,包裹等在
#ifndef __OPENFRAMEWORKS__
#endif
盤算我可以「增加」與由cocos2d中加入額外的位了openFrameworks的.h
,但那麼openFrameworks將不會生成,因爲它不再具有EAGLview
的定義。
是否有像這樣的兩個庫一起工作的最佳實踐,這兩個庫都使用相同的低級功能,在這種情況下爲CoreAnimation
?我可以編寫自己的類,從它們繼承嗎?有沒有辦法從我的項目中刪除.h
文件之一?
在OP中注意到,在項目中只有兩個庫都會因符號重複而導致鏈接器錯誤。 – buildsucceeded
但是...是的!適當重建庫。 – buildsucceeded