Results 1 to 3 of 3

Thread: Probleme d'execution Qt/XML

  1. #1
    Join Date
    Apr 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Probleme d'execution Qt/XML

    dans le cadre de generer un fichier XML ,je tente d'executer ce fichier mais il me renvoie des erreurs tels que :


    C:\Users\user\Desktop\Projet\test\test_xml>make
    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory `C:/Users/user/Desktop/Projet/test/test_xml'

    g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS
    _QMAIN -I"c:\Qt\4.3.4\include\QtCore" -I"c:\Qt\4.3.4\include\QtCore" -I"c:\Qt\4.
    3.4\include\QtGui" -I"c:\Qt\4.3.4\include\QtGui" -I"c:\Qt\4.3.4\include" -I"." -
    I"c:\Qt\4.3.4\include\ActiveQt" -I"release" -I"." -I"c:\Qt\4.3.4\mkspecs\win32-g
    ++" -o release\main.o main.cpp
    main.cpp:1:22: QtXml/qdom: No such file or directory
    main.cpp:3:31: QDomImplementation: No such file or directory
    main.cpp: In function `int main(int, char**)':
    main.cpp:7: error: `QDomImplementation' undeclared (first use this function)
    main.cpp:7: error: (Each undeclared identifier is reported only once for each fu
    nction it appears in.)
    main.cpp:7: error: expected `;' before "impl"
    main.cpp:9: error: `QString' undeclared (first use this function)
    main.cpp:9: error: expected `;' before "name"
    main.cpp:10: error: expected `;' before "publicId"
    main.cpp:11: error: expected `;' before "systemId"
    main.cpp:12: error: `QDomDocument' undeclared (first use this function)
    main.cpp:12: error: expected `;' before "doc"
    main.cpp:15: error: `doc' undeclared (first use this function)
    main.cpp:19: error: `QDomElement' undeclared (first use this function)
    main.cpp:19: error: expected `;' before "stoneNode"
    main.cpp:20: error: `stoneNode' undeclared (first use this function)
    main.cpp:24: error: expected `;' before "appearanceNode"
    main.cpp:25: error: expected `;' before "colorNode"
    main.cpp:26: error: `colorNode' undeclared (first use this function)
    main.cpp:27: error: `appearanceNode' undeclared (first use this function)
    main.cpp:31: error: expected `;' before "geometryNode"
    main.cpp:33: error: expected `;' before "triangleNode"
    main.cpp:34: error: `triangleNode' undeclared (first use this function)
    main.cpp:35: error: `geometryNode' undeclared (first use this function)
    main.cpp:37: error: expected `;' before "quadNode"
    main.cpp:38: error: `quadNode' undeclared (first use this function)
    main.cpp:43: error: `cout' undeclared (first use this function)
    mingw32-make[1]: *** [release/main.o] Error 1
    mingw32-make[1]: Leaving directory `C:/Users/user/Desktop/Projet/test/test_xml'
    mingw32-make: *** [release] Error 2



    alors Merci bien de me corriger les erreurs ,je sais qu'ils sont betes mais je suis debutant , bon voila mon fichier .cpp



    #include <QtXml/qdom>
    #include <iostream>
    #include <QDomImplementation>

    int main(int, char **)
    {
    QDomImplementation impl = QDomDocument().implementation();
    // document with document type
    QString name = "stone";
    QString publicId = "-//XADECK//DTD Stone 1.0 //EN";
    QString systemId = "http://www-imagis.imag.fr/DTD/stone1.dtd";
    QDomDocument doc(impl.createDocumentType(name,publicId,systemId ));

    // add some XML comment at the beginning
    doc.appendChild(doc.createComment("This file describe a jewel"));
    doc.appendChild(doc.createTextNode("\n")); // for nicer output

    // root node
    QDomElement stoneNode = doc.createElement("stone");
    stoneNode.setAttribute("name","diamond");
    doc.appendChild(stoneNode);

    // appearance
    QDomElement appearanceNode = doc.createElement("appearance");
    QDomElement colorNode = doc.createElement("color");
    colorNode.appendChild(doc.createTextNode("255 255 255"));
    appearanceNode.appendChild(colorNode);
    stoneNode.appendChild(appearanceNode);

    // geometry
    QDomElement geometryNode = doc.createElement("geometry");

    QDomElement triangleNode = doc.createElement("triangle");
    triangleNode.appendChild(doc.createTextNode("0 0 0 1 0 0 1 1 0"));
    geometryNode.appendChild(triangleNode);

    QDomElement quadNode = doc.createElement("quad");
    quadNode.appendChild(doc.createTextNode("0 0 1 1 0 1 1 1 1 0 1 1"));
    geometryNode.appendChild(quadNode);

    stoneNode.appendChild(geometryNode);

    cout<<doc.toString();
    }


    N.B :c'est un fichier que je lé trouvé sur le NET pour savoire comment s'execute les choses .

    MErci d'avance

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    506
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Probleme d'execution Qt/XML

    Hi, try to add
    Qt Code:
    1. QT += xml
    To copy to clipboard, switch view to plain text mode 
    to your project file.

    Ginsengelf

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Probleme d'execution Qt/XML

    Et il y a aussi des forums français parce que ici seulement un peu des hommes parlent français. Et moi, je apprendre encore...

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.