BlendInt
BlendInt copied to clipboard
error when compiling the sample code
hi,
Would you please outline the steps to build the sample code in XCode? I managed to compile the library, but failed to do so with the "hello world" example. Thanks!
update: here's some more info about the error: c++locale.h: no member named 'vsnprintf' in namespace std:: other errors are similar to this one. I tried other c++ dialect in xcode settings, but still get the errors
I'll check this issue on my Mac tonight.
I cannot reproduce this kind of error. What's the OS X and Xcode versions are you using?
I'm using OSX 10.10.1, Xcode 6.2. The errors are not related to BlenderInt codebase, but come from compiling c++ standard library and boost. It seems there are a mismatch of compiler/c++ library. I tried different c/c++ dialect without luck. Here's what I did so far:
- download the BlenderInt source code and generate xcode project with cmake gui
- compile the source code, succeeded
- create a new project (console program) in Xcode, copy the "Hello World" example and set the search path for the headers and compiled library from 2)
I checked the settings for the source project, both c/c++ dialect are set to "compiler default" with c++11 std library. I got errors with the same settings. I'm not sure why the example end up compiling the std library either.
Aha, I see. I'll try and provide a simple guide of how to write your program in Xcode in wiki. But won't be soon, maybe this weekend.
You could also use cmake to generate Xcode project, I have some demo code in https://github.com/zhanggyb/BlendInt_Demos. See https://github.com/zhanggyb/BlendInt/wiki/build to know how to checkout the submodule and build the demo.
I tried to create a Xcode project today and found it's really difficult to configure the xcode project and I failed too.
That's because you have to set the headers/libraries/definitions required by this project manually in xcode. For example, the header files of freetype, platform macro required by CppEvent.
This problem not only occurs in Xcode, but also in other IDEs. I need more time to clean up the code and solve this issue.
Currently, if you just want to have a look at a real example, please checkout "demo" submodule and build with cmake.
the glfw3 demo (including 'tutorial01') can be build thru command line successfully. But it failed to compile with xcode project(generated with cmake gui, with default settings plus build glfw demo option), due to an old glfw3 version (3.0.4) installed by brew. Because the source code bundled with BlenderInt is glfw 3.1, which does not match the header. Uninstall previous glfw fixes the problem.
still, a tutorial on writing a program with your library from scratch is very much needed. Thanks.
ok. since create a xcode project is too much work, maybe it's easier to outline steps to add new targets within BlendInt project?
Yes, it's already in plan and I'll do this as soon as I finish another c++ project -- libCppEvent to replace the CppEvent which is used in current code.
libCppEvent is more clean and comprehensible due to the C++11 features.
thanks for the update, and keep up the good work!
I've fixed some code bugs in recent commits. you can build the latest code, install to /usr/local (by default), and now you can configure Xcode to use this project. (Don't be supprised if you get other bug, it's still under development).
A step-by-step guide will be posted on wiki page soon.
See this page: https://github.com/zhanggyb/BlendInt/wiki/compile
hi,
I noticed that the external packages (glfw3, glm) are removed from the source. This requires that glfw3 being installed before BlendInt can be compiled. However, if use Homebrew, the installed glfw version is 3.0.4, which is not compatible with BlendInt. To make things worse, once it's installed thru Homebrew, XCode will use the installed header first, even if the glfw 3.1 path were set correctly thru cmake.
So I guess it might be helpful to clarify that for mac, user should:
- make sure glfw3 is not installed thru Homebrew
- build latest glfw, version 3.1 at least, also note that it should be built as a dynamic library
- specify header folder and the path to glfw.dylib in cmake
- compile with cmake or generate Xcode and compile
GLFW in Homebrew has already been upgraded to 3.1.x, the latest is 3.1.1. Could you update/upgrade homebrew and try to build BlendInt again:
$ brew update
$ brew upgrade --all
you are right, it's fixed now. Thanks.
So I'm going to close this issue. By the way, if you're using a Mac with retina display, the current code is not working. I'm fixing this in the "retina" branch.