Page 1 of 1

VBox/com/array.h assertion failure

PostPosted: 7. Nov 2013, 23:32
by rjoyce
Hi all,

I'm trying to build code using the COM/XPCOM "glue" layer in C++ with VirtualBox 4.3.2. This is on both Linux and OS X -- so the XPCOM side of things. The VBox source tree's "include" directory is in my include path. After defining RT_ARCH_* and RT_OS_* as needed, I have:

#include <VBox/com/com.h>
#include <VBox/com/array.h>

The second line causes an assertion failure on line 265 of array.h:

AssertCompile(sizeof(PRUnichar) == sizeof(OLECHAR));

PRUnichar is 2 bytes, but OLECHAR is defined in VBox/com/defs.h line 315:

#define OLECHAR wchar_t

which is 4 bytes on Linux. I don't see any VBox preprocessor macros that would change this definition.

Am I missing some #define, compiler flag, or other setup? The regular VirtualBox code uses array.h and builds just fine (e.g., src/VBox/Main/testcase/tstAPI.cpp). But I don't see how it avoids wchar_t != PRUnichar.


Re: VBox/com/array.h assertion failure

PostPosted: 8. Nov 2013, 21:51
by noteirak
Moved to "Virtualbox OSE" for build issues.

Re: VBox/com/array.h assertion failure

PostPosted: 17. Nov 2015, 23:52
by smil2k
Just for the record: you need to include "-fshort-wchar" on Linux with GCC in order to be able compile VBox/com/array.h.