A program that can compile box2d code

Hey guys,

I've been racking my brain the last few days on this question. What is the feasiblily of a program that will take in c++ box2d code and use the box2d library along with a c++ compiler to compile and run a box2d program.

My first assumption was that it would be straight forward. Just get a program to run a Makefile (Linux) and then run the output program. But i thought if just for me to get the box2d lib compiled on linux was a nightmare, how on earth would a program. Just running the makefile on linux initially came up with loads of errors. And then, I don't even know what the windows equivelent to makefiles are, do they even have any?

Does anyone have any experience for advice for this, and how feasible it is.

edit: the reason i am wondering how to do this, is because it would be part of a larger project.

Thank you

Silver
I'm not sure if the question is entirely clear (or, I may just not be understanding it fully).

Using Box2D is pretty similar to using any other library. C++ development being what it is, building an application is not always trivial, and it's pretty easy to find yourself mired in build errors (compiler, linker, etc.), regardless of what libraries and tools are being used. Finding your way through these errors and getting an application built successfully usually just comes down to experience and familiarity with the tools that you're using.

There are various development tools for all of the major operating systems (Linux, OS X, Windows). Some of these tools target more than one platform, while some are supported only on a single platform. Examples include the GCC compiler (cross-platform, but I think the level of support for recent versions varies between platforms), Xcode (OS X-only IDE that wraps GCC), Visual Studio (Windows-only IDE and compiler, although I think it can also be used with some third-party compilers), make (multi-platform command-line build tool), CMake (multi-platform meta-build tool), Code::Blocks (multi-platform IDE), etc.

Generally speaking, with a library such as Box2D, you can include all the source in your project directly, or build it as a separate library and link it to your application either statically or dynamically. Each major operating system has its own versions of static and dynamic libraries, e.g. .a and .so files in Linux, frameworks, .a, and .dylib files in OS X, and .lib and .dll files in Windows. Often, libraries will come with pre-built projects for building of library files (for example, Box2D comes with a Visual Studio solution for building Box2D as a static library).

I don't know if any of this information addresses your question directly (or is even relevant at all). If you're having trouble building or using Box2D in a particular development environment, I'd suggest posting some more details, such as exactly what tools you're using and what sort of errors you're getting. Also, be sure to read all of the readme's and installation instructions that come with the library.

Original thread: https://box2d.org/forum/viewtopic.php?t=4731