main.cppWie undefined reference to fix auf `b2World :: b2World (b2Vec2 const &)‘
#include <iostream>
#include <Box2D/Box2D.h>
int main() {
int32 velocityIterations = 6;
int32 positionIterations = 2;
b2Vec2 gravity(0.0f, -10.0f);
b2World world(gravity);
std::cout << "Hello, world!" << std::endl;
}
Der Fehler erhalte ich:
undefined reference to `b2World :: b2World (b2Vec2 const &)‘
Wenn ich versuche, die Verknüpfung Box2D in CMakeLists.txt:
include_directories(C:/Users/blahblah/CPPLibs)
target_link_libraries(HelloWorld Box2D)
ich:
c:/mingw/bin /../ lib/gcc/x86_64-w64-mingw32/6.1.0 /../../../../ x86_64 -w64-mingw32/bin/ld.exe: kann -lBox2D nicht finden
Wie kann ich Box2D richtig in mein Projekt importieren?
create b2World Konstruktor –
@MichelJord Ich tat 'b2World Welt (Schwerkraft);', was ist los? –