C++ sample with Visual Studio 2008

Discussions related to using VirtualBox on Windows hosts.
Post Reply
MrsPuff
Posts: 6
Joined: 8. Jan 2008, 14:13

C++ sample with Visual Studio 2008

Post by MrsPuff »

Tried to create a Win32 project and included the 'VirtualBox.h' header and 'tstVBoxAPIWin.cpp' to the project. Can't create the project, because the linker runs into the following errors:

1>tstVBoxAPIWin.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_CLSID_VirtualBox".
1>tstVBoxAPIWin.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_IID_IVirtualBox".
1>K:\CPP\VirtualBox2-Sample\Debug\VirtualBox2-Sample.exe : fatal error LNK1120: 2 nicht aufgelöste externe Verweise.

How can i integrate those symbols?
MrsPuff
Posts: 6
Joined: 8. Jan 2008, 14:13

Post by MrsPuff »

Foud it:

1. Fire up your favorite C++ compiler (I use the free VC++ 9.0 Express edition) and create a Win32 console project.

2. Add the sdk\samples\API\tstVBoxAPIWin.cpp.

3. Add sdk\include to the INCLUDE path.

4. Don't forget to also add sdk\lib\VirtualBox_i.c to your sources since this file contains all the generated COM interfaces for VirtualBox.

5. Add sdk\lib to your linker path .

6. Run a build.
Post Reply