Discussion:
[vbox-dev] Qt C++ Vbox
Sanchir Kartiev
2014-09-01 12:52:56 UTC
Permalink
Hello, Everyone! I want to integrate my Qt C++ application with VirtualBox
API. How I can resolve my problem with error like: error: #error "Define
the correct platform identifier / Port me." When I try to compile sample
application, and add some functions to my Qt project. Thanks


CPU :Intel Core i3
OS: Debian Linux 7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20140901/12de8fba/attachment.html
Klaus Espenlaub
2014-09-01 17:31:34 UTC
Permalink
Sanchir,
Post by Sanchir Kartiev
Hello, Everyone! I want to integrate my Qt C++ application with
#error "Define the correct platform identifier / Port me." When I try to
compile sample application, and add some functions to my Qt project. Thanks
Could you please provide the full error message and if possible a small
piece of sample code which reproduces your problem?

Klaus
Post by Sanchir Kartiev
CPU :Intel Core i3
OS: Debian Linux 7
Sanchir Kartiev
2014-09-01 19:36:52 UTC
Permalink
Klaus,
Problem appear in preprocessor. I guess that compiler, can't define my OS
and CPU Architecture. This error also appear in make step of executing
sample program from "sdk/bindings/xpcom/samples/tstVBoxAPIXPCOM"
Full Error
1)
C:\Users\Sanchir\Documents\sdk\bindings\xpcom\include\nsprpub\prcpucfg.h:62:
error: #error "Define the correct platform identifier / Port me."
2) \sdk\bindings\xpcom\include\iprt\cdefs.h:199: error: #error "You must
define which context the compiled code should run in; IN_RING3, IN_RING0 or
IN_RC"
3) \sdk\bindings\xpcom\include\VBox\com\defs.h:79: ??????: atlbase.h: No
such file or directory
# include <atlbase.h>
This error from Windows Version, also this problems is appears on Linux and
Mac OS. (Linux and Mac OS also want to <atlbase.h>
in Qt this headers has been Imported by : all files sucessfully included.

INCLUDEPATH +=USER_NAME/Documents/sdk/bindings/xpcom/include


#ifndef nspr_vboxcfg___

#define nspr_vboxcfg___

#ifdef RT_OS_DARWIN

# include <md/_darwin.cfg>

#elif defined(RT_OS_FREEBSD)

# include <md/_freebsd.cfg>

#elif defined(RT_OS_L4)

# include <md/_l4v2.cfg>

#elif defined(RT_OS_LINUX)

# include <md/_linux.cfg>

#elif defined(RT_OS_NETBSD)

# include <md/_netbsd.cfg>

#elif defined(RT_OS_OPENBSD)

# include <md/_openbsd.cfg>

#elif defined(RT_OS_SOLARIS)

# if defined(RT_ARCH_X86)

# include <md/_solaris32.cfg>

#else

# include <md/_solaris64.cfg>

# endif

#elif defined(RT_OS_OS2)

# include <md/_os2.cfg>

#else

# error "Define the correct platform identifier / Port me." ---------

#endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20140901/48a7ba80/attachment.html
Klaus Espenlaub
2014-09-03 09:07:18 UTC
Permalink
Sanchir,

all those errors are
Post by Sanchir Kartiev
Klaus,
Problem appear in preprocessor. I guess that compiler, can't define my
OS and CPU Architecture. This error also appear in make step of
executing sample program from "sdk/bindings/xpcom/samples/tstVBoxAPIXPCOM"
Please check the contents of the Makefile we're shipping for building
the sample... it contains all details and instructions, including that
you need to define RT_OS_LINUX, RT_OS_WINDOWS, RT_OS_DARWIN,
RT_OS_SOLARIS depending on your host OS. The remaining errors are all
ultimately caused by ignoring this.

Klaus
Post by Sanchir Kartiev
Full Error
1)
error: #error "Define the correct platform identifier / Port me."
2) \sdk\bindings\xpcom\include\iprt\cdefs.h:199: error: #error "You must
define which context the compiled code should run in; IN_RING3, IN_RING0
or IN_RC"
3) \sdk\bindings\xpcom\include\VBox\com\defs.h:79: ??????: atlbase.h: No
such file or directory
# include <atlbase.h>
This error from Windows Version, also this problems is appears on Linux
and Mac OS. (Linux and Mac OS also want to <atlbase.h>
in Qt this headers has been Imported by : all files sucessfully included.
INCLUDEPATH +=USER_NAME/Documents/sdk/bindings/xpcom/include
#ifndef nspr_vboxcfg___
#define nspr_vboxcfg___
#ifdef RT_OS_DARWIN
# include <md/_darwin.cfg>
#elif defined(RT_OS_FREEBSD)
# include <md/_freebsd.cfg>
#elif defined(RT_OS_L4)
# include <md/_l4v2.cfg>
#elif defined(RT_OS_LINUX)
# include <md/_linux.cfg>
#elif defined(RT_OS_NETBSD)
# include <md/_netbsd.cfg>
#elif defined(RT_OS_OPENBSD)
# include <md/_openbsd.cfg>
#elif defined(RT_OS_SOLARIS)
# if defined(RT_ARCH_X86)
# include <md/_solaris32.cfg>
#else
# include <md/_solaris64.cfg>
# endif
#elif defined(RT_OS_OS2)
# include <md/_os2.cfg>
#else
# error "Define the correct platform identifier / Port me." ---------
#endif
Loading...