This tutorial shows you how to set up a Visual C++ Express 2008 project as required as a starting point for all other tutorials.
Setting up the project
We must create a new VC++-project. The project contains all the applications settings and files. This is the recipe on how to do this:
- From the menu at the top, click File -> New -> Project.
- Select Win32 from the left and then Win32 Console Application at the right.
- And then enter a name. Ofcourse HelloWorld as this is our first Frontend-application ;) And then press OK
- Then press Next in the Win32 Application Wizard
- Check the checkbox by Empty Project, and then press Finish
You now have an empty C++ project. Next we need to add a source file. This is how:
- Right-click on the project icon in the Solution Explorer
- Click Add -> New Item
- Select Code at the left side and then C++ Code (.cpp)
- Type in main.cpp as name and click Add
Next we need to configure the project to link against the Frontend libraries. This must be done for each project, but as the paths has already been set up for good, we only need to enter the file names of the libraries. Your project has two different configurations by default, Debug and Release. We will configure both of them to link against the proper libraries.
- From the menu at the top, this time click Project -> HelloWorld Properties.
- At the top left, select Debug from the dropdown-list.
- At the left, expand Configuration Properties
- Expand C/C++ and select Code Generation
- Set Runtime Library to Multi-threaded Debug (/MTd)
- Expand Linker and select Input
- Click the text-field by Additional Dependencies and then the … button
- Type in:
openfrontend2_mtd.lib frontend2utils_mtd.lib
- At the top left again, select Release from the dropdown-list.
- Go to C/C++ -> Code Generation again
- Set Runtime Library to Multi-threaded (/MT)
- Go to Linker -> Input again
- Click the text-field by Additional Dependencies and then the … button
- Type in:
openfrontend2_mt.lib frontend2utils_mt.lib
Some code to test that everything works
To verify that you’ve set everything up correctly, write some code in our newly created main.cpp file.
int main(int argc, char* argv[])
{
IO::StdOut().WriteText("Hello World!\n");
}
Now select Press Ctrl+F5 . A console window should display Hello World, indicating that you have successfully built and linked against the OpenFrontend SDK :)
PS: If you have problems, try to go over the tutorial again and read it more carefully. Maybe you’ve missed something. :)