2011-11-01 63 views
2

我的應用程序編譯罰款過,但在Xcode 4.2構建時,我現在看到了以下錯誤:如何在Xcode 4.2下構建cocos2d應用程序時解決這些錯誤?

在GLES-Render.mm它的報告:

variable length array of non pod element type b2vec2 

`cannot initialize parameter of type CCScene with an rvalue of type helloworld` 

我已經成功地使用了這個代碼一年以上沒有問題,所以我猜我需要修復我的構建設置中的某些東西。我能做些什麼來解決這些錯誤?

+4

你也應該張貼產生這些錯誤代碼 – LearnCocos2D

+0

這將是值得的,看看你所得到的錯誤代碼。聽起來像一些參數改變或者可能只是一些必要的類型轉換。很難說,但沒有看到代碼。 –

+0

我也有這個錯誤,甚至在我的遊戲中甚至沒有任何與Box2D相關的代碼。 – Voles

回答

0

只需更換

b2Vec2 vertices[vertexCount]; 
for(int i=0;i<vertexCount;i++) { 
    vertices[i] = old_vertices[i]; 
    vertices[i] *= mRatio; 
} 

到:

ccVertex2F vertices[vertexCount]; 
for(int i=0;i<vertexCount;i++) { 
    b2Vec2 tmp = old_vertices[i]; 
    tmp *= mRatio; 
    vertices[i].x = tmp.x; 
    vertices[i].y = tmp.y; 
} 
相關問題