main.cpp
#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;
}
The error I get:
undefined reference to `b2World::b2World(b2Vec2 const&)'
When I try linking Box2D in CMakeLists.txt:
include_directories(C:/Users/blahblah/CPPLibs)
target_link_libraries(HelloWorld Box2D)
I get:
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lBox2D
How I can properly import Box2D to my project?
b2World world(gravity);, what's wrong? - Szymon Marczak