Page 1 of 1

C++ sample with Visual Studio 2008

Posted: 11. Jan 2009, 17:12
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?

Posted: 12. Jan 2009, 14:55
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.