-
Notifications
You must be signed in to change notification settings - Fork 8
compile
Freeman Zhang edited this page May 3, 2015
·
1 revision
Here's a quick guide of how to compile your code with BlendInt.
Suppose the BlendInt was installed to /usr/local
, and you want to compile the "Hello World" code in main.cpp
.
#include <blendint/gui/window.hpp>
#include <blendint/gui/message-box.hpp>
int main(int argc, char* argv[])
{
using namespace BlendInt;
if(Window::Initialize()) {
Window win(240, 180, "Tutorial 01");
MessageBox* message = new MessageBox("Hello World!",
"Click the \"close\" button.");
// 'message' will be destroyed when the window is closed.
win.AddFrame(message);
message->MoveTo(
(win.size().width() - message->size().width()) / 2,
(win.size().height() - message->size().height()) / 2);
win.Exec();
Window::Terminate();
}
return 0;
}
In OS X:
$ clang++ `pkg-config --cflags --libs blendint` main.cpp -o hello_world
In Linux:
$ g++ `pkg-config --cflags --libs blendint` main.cpp -o hello_world
- Create a new Xcode project
- Select "Command Line Tool" project
- Select "C++" language
- In project property page -> "Linking" -> "Other Linker Flags", fill in "-lblendint -lboost_filesystem-mt -lboost_system-mt -lboost_thread-mt"
- In project property page -> "Search Paths" -> "Header Search Paths", add /usr/local/include, /usr/local/include/blendint, /usr/local/include/freetype2
- In project property page -> "Search Paths" -> "Library Search Paths", add /usr/local/lib
- Home
- Roadmap
- Known Issues
- Build from Source
- Using BlendInt
- H/W Requirements
- Fontconfig and Fonts
- Compile with BlendInt
- "Hello World" example
- Eclipse
- Xcode
- Tips
- Use BlendInt in real time app
- Use BlendInt in non-real time app
- Gallery
- Programming Guide
- Basic Class Diagrams
- Layout
- Draw
- Draw with OpenGL APIs
- Draw with Predefined Shaders
- Use event framework
- Process HID events from window system
- Memory Management
- MVC for ListView/TreeView
- Off-screen Render with FBO
- Write your custom Widget
- Write your custom Container
- Themes
- API Reference
- Development
- IDE Setup
- Code Layout 10-. Reporting a Bug
- FAQ