Page 1 of 1

Error in program ?

Posted: 6. Feb 2009, 12:47
by vazzdoin
I am Facinf the following errors when i use the header files of VBoxManage.cpp in the tstVBoxAPILinux.cpp

/usr/include/libio.h:475: error: `__gnuc_va_list' has not been declared
/usr/include/libio.h:477: error: `__gnuc_va_list' has not been declared
In file included from tstVBoxAPILinux.cpp:14:
/usr/include/stdio.h:77: error: `__gnuc_va_list' does not name a type
In file included from tstVBoxAPILinux.cpp:14:
/usr/include/stdio.h:339: error: `__gnuc_va_list' has not been declared
/usr/include/stdio.h:344: error: `__gnuc_va_list' has not been declared
/usr/include/stdio.h:347: error: `__gnuc_va_list' has not been declared
/usr/include/stdio.h:358: error: `__gnuc_va_list' has not been declared
/usr/include/stdio.h:367: error: `__gnuc_va_list' has not been declared
/usr/include/stdio.h:383: error: `__gnuc_va_list' has not been declared
/usr/include/stdio.h:414: error: `__gnuc_va_list' has not been declared
/usr/include/stdio.h:421: error: `__gnuc_va_list' has not been declared
/usr/include/stdio.h:426: error: `__gnuc_va_list' has not been declared
In file included from tstVBoxAPILinux.cpp:14:
/usr/include/stdio.h:800: error: `__gnuc_va_list' has not been declared
In file included from ../../../../../../../../include/iprt/time.h:33,
from /usr/include/sys/types.h:133,
from /usr/include/stdlib.h:433,
from tstVBoxAPILinux.cpp:15:
../include/iprt/cdefs.h:149:3: #error "You must defined which context the compiled code should run in; IN_RING3, IN_RING0 or IN_GC"
In file included from ../../../../../../../../include/iprt/time.h:34,
from /usr/include/sys/types.h:133,
from /usr/include/stdlib.h:433,
from tstVBoxAPILinux.cpp:15:
../include/iprt/types.h:159: error: `uint64_t' does not name a type
../include/iprt/types.h:160: error: `uint64_t' does not name a type
../include/iprt/types.h:173: error: `uint64_t' does not name a type
../include/iprt/types.h:174: error: `int64_t' does not name a type
../include/iprt/types.h:185: error: `uint16_t' does not name a type
../include/iprt/types.h:188: error: `uint16_t' does not name a type
../include/iprt/types.h:190: error: `uint8_t' does not name a type
../include/iprt/types.h:194: error: `uint16_t' does not name a type




There are more errors with the same type with other Header files . It's not recognising the data types declared in the various Header files included in .h files.

can some one tell me where's the problem..?

Posted: 7. Feb 2009, 20:27
by Sasquatch
Which version do you run (OSE, PUEL)? Do you run a different kernel, like KVM or Xen? Those kernel builds are not suited for VB, because they already provide virtualisation and you can't run two at the same time.

Posted: 9. Feb 2009, 12:19
by vazzdoin
No m not running separate kernal... I dont know abt the version. M working on i386 RHEL.

Posted: 9. Feb 2009, 20:11
by stefan.becker
Sorry, so is no help possible.

We dont know anything about ist, too. This is not a quiz show.

Provide infos (exact approach / description what you done, version, etc.).

Posted: 11. Feb 2009, 06:43
by vazzdoin
I searched over it and now i found that i am working on the Open source edition(OSE) version. Now,can nyone tell me where's the problem in my code.

Posted: 11. Feb 2009, 20:28
by stefan.becker
Which code? Details or forget it.

Posted: 12. Feb 2009, 05:57
by vazzdoin
Following is the function code which m trying to run.

Code: Select all

static nsresult showInfo (nsCOMPtr <IVirtualBox> virtualBox, nsCOMPtr<IMachine> machine,
                           nsCOMPtr <IConsole> console = nsCOMPtr <IConsole> (),
                           VMINFO_DETAILS details = VMINFO_NONE)
{
    nsresult rc;
    nsCOMPtr<IMachine> machine;

    nsID uuid (argv[0]);
    if (!uuid.isEmpty())
   /* {
        CHECK_ERROR (virtualBox, GetMachine (uuid, machine.asOutParam()));
    }
    else*/
    {
        CHECK_ERROR (virtualBox, FindMachine (Bstr(argv[0]), machine.asOutParam()));
        if (NS_SUCCEEDED (rc))
            machine->COMGETTER(Id) (uuid.asOutParam());
    }
    if (NS_FAILED (rc))
        return 1;

   
    VMINFO_DETAILS details = VMINFO_NONE;
    bool fDetails = false;
    bool fStatistics = false;
    bool fMachinereadable = false;
    for (int i=1;i<argc;i++)
    {
        if (!strcmp(argv[i], "-details"))
            fDetails = true;
        else
        if (!strcmp(argv[i], "-statistics"))
            fStatistics = true;
        if (!strcmp(argv[1], "-machinereadable"))
            fMachinereadable = true;
    }
    if (fMachinereadable)
        details = VMINFO_MACHINEREADABLE;
    else
    if (fDetails && fStatistics)
        details = VMINFO_FULL;
    else
    if (fDetails)
        details = VMINFO_STANDARD;
    else
    if (fStatistics)
        details = VMINFO_STATISTICS;

    nsCOMPtr <IConsole> console;
    nsCOMPtr <ISession> session;
        rc = virtualBox->OpenExistingSession (session, uuid);
    if (NS_SUCCEEDED(rc))
        
        rc = session->COMGETTER(machine)(machine.asOutParam());
    if (NS_SUCCEEDED(rc))
        
        rc = session->COMGETTER(console)(console.asOutParam());

    rc = showInfo (virtualBox, machine, console, details);


    if (console)
        session->Close();

    return NS_SUCCEEDED (rc) ? 0 : 1;
}
But its not recogniising the datatypes of .h files like types.h , time.h etc.
if i exclude these header files from my programm then its giving the following errors:

Code: Select all

[root@localhost samples]# make
g++ -c -DRT_OS_LINUX -g -fshort-wchar -I../include -I../include/nsprpub -I../include/string -I../include/xpcom -I../include/ipcd -DVBOX_WITH_XPCOM_NAMESPACE_CLEANUP -o tstVBoxAPILinux.o tstVBoxAPILinux.cpp
tstVBoxAPILinux.cpp: In function `nsresult showInfo(nsCOMPtr<IVirtualBox>, nsCOMPtr<IMachine>, nsCOMPtr<IConsole>, VMINFO_DETAILS)':
tstVBoxAPILinux.cpp:108: error: declaration of 'nsCOMPtr<IMachine> machine' shadows a parameter
tstVBoxAPILinux.cpp:110: error: `argv' undeclared (first use this function)
tstVBoxAPILinux.cpp:110: error: (Each undeclared identifier is reported only once for each function it appears in.)
tstVBoxAPILinux.cpp:111: error: 'struct nsID' has no member named 'isEmpty'
tstVBoxAPILinux.cpp:117: error: `Bstr' undeclared (first use this function)
tstVBoxAPILinux.cpp:117: error: 'class nsCOMPtr<IMachine>' has no member named 'asOutParam'
tstVBoxAPILinux.cpp:117: error: `FindMachine' undeclared (first use this function)
tstVBoxAPILinux.cpp:117: error: `CHECK_ERROR' undeclared (first use this function)
tstVBoxAPILinux.cpp:119: error: 'class nsDerivedSafe<IMachine>' has no member named 'COMGETTER'
tstVBoxAPILinux.cpp:119: error: `Id' undeclared (first use this function)
tstVBoxAPILinux.cpp:119: error: 'struct nsID' has no member named 'asOutParam'
tstVBoxAPILinux.cpp:125: error: declaration of 'VMINFO_DETAILS details' shadows a parameter
tstVBoxAPILinux.cpp:129: error: `argc' undeclared (first use this function)
tstVBoxAPILinux.cpp:151: error: declaration of 'nsCOMPtr<IConsole> console' shadows a parameter
tstVBoxAPILinux.cpp:156: error: 'class nsDerivedSafe<ISession>' has no member named 'COMGETTER'
tstVBoxAPILinux.cpp:156: error: 'class nsCOMPtr<IMachine>' has no member named 'asOutParam'
tstVBoxAPILinux.cpp:159: error: 'class nsDerivedSafe<ISession>' has no member named 'COMGETTER'
tstVBoxAPILinux.cpp:159: error: 'class nsCOMPtr<IConsole>' has no member named 'asOutParam'
tstVBoxAPILinux.cpp: In function `int main(int, char**)':
tstVBoxAPILinux.cpp:97: error: too few arguments to function `nsresult showInfo(nsCOMPtr<IVirtualBox>, nsCOMPtr<IMachine>, nsCOMPtr<IConsole>, VMINFO_DETAILS)'
tstVBoxAPILinux.cpp:533: error: at this point in file
make: *** [tstVBoxAPILinux.o] Error 1
Modedit: When posting code, it's useful to use the code blocks ;).