Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unable to compile this
Forum Updated to NodeBB v4.3 + New Features

Unable to compile this

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lucky7456969
    wrote on 13 Apr 2014, 09:39 last edited by
    #1

    OS: Win7 x64
    Compiler: mingw64
    QT: 4.7.4 x64
    IDE: CodeBlocks

    Include directories:
    E:\Software\Q\qt-4.7.4\4.7.4-qt-x64-build\include\QT
    E:\Software\Q\qt-4.7.4\4.7.4-qt-x64-build\include\QTGui
    E:\Software\Q\qt-4.7.4\4.7.4-qt-x64-build\include\QTCore

    common.h
    [code]
    #ifndef COMMON_H_INCLUDED
    #define COMMON_H_INCLUDED

    #include <QWidget.h>
    #include <QtGui/QMainWindow.h>
    #include <QtGui/QStatusBar.h>
    #include <QtGui/QVector2D.h>
    #include <QtGui/QVector3D.h>
    #include <QtGui/QVector4D.h>
    #include <QtGui/QShowEvent>
    #include <d3dx9.h>
    #include <string>
    #include "tinyxml.h"
    #include "util/util.h"

    #endif // COMMON_H_INCLUDED
    [/code]

    DXWidget.h
    [code]
    #ifndef DXWIDGET_H
    #define DXWIDGET_H

    #include "common.h"
    #include "camera/camera.h"

    class DXWidget : public QWidget
    {
    public:
    DXWidget( QWidget *parent = 0, Qt::WindowFlags flags = 0 ) : QWidget( parent, flags )
    {
    setAttribute(Qt::WA_PaintOnScreen);
    setAttribute(Qt::WA_NoSystemBackground);

            m_standBy = false;
            m_lastRendered = 0;
            m_iCurCam = 0;
            m_bDeviceLost = false;
    
        }
    
    
        virtual ~DXWidget();
    
        virtual void setVisible(bool visible)
    

    {
    if(visible)
    {
    QWidget::setVisible(visible);
    //initialize();
    }
    else
    {
    //uninitialize();
    QWidget::setVisible(visible);
    }
    }

    virtual HRESULT initialize() = 0;
    virtual void uninitialize() = 0;

    virtual HRESULT restoreDeviceObjects() = 0;
    virtual HRESULT invalidateDeviceObjects() = 0;

    virtual void setTime(DWORD dwTime)
    {
    m_dwTime = dwTime;
    }

    virtual HRESULT render()
    {
    return S_OK;
    }

    virtual HRESULT present()
    {
    return S_OK;
    }

    virtual void initCamera()
    {

    }

    virtual void initModels()
    {
    }

    virtual void initEffects()
    {
    }

    virtual void update()
    {
    }

    void setAspect(float aspect)
    {

    }

    void perspective(float fovx, float aspect, float znear, float zfar)
    {

    }

    void moveCamera(float dx, float dy, float dz)
    {

    }

    void rotateCamera(float headingDegrees, float pitchDegrees, float rollDegrees)
    {

    }

    void zoomCamera(float zoom)
    {

    }

    void lookAtCamera(const D3DXVECTOR3 &eye, const D3DXVECTOR3 &target, const D3DXVECTOR3 &up)
    {

    }

    signals:
    void setCameraTranslate(QVector3D);
    void setCameraRotate(QVector3D);
    void setCameraScale(QVector3D);
    void setCenterOfInterest(double);
    void setAngleOfView(double);
    void setNearClipPlane(double);
    void setFarClipPlane(double);

    public slots:
    void cameraTranslateChanged(QVector3D p)
    {
    //m_camera->setTarget(vmVector3(p.x(), p.y(), p.z()));
    update();
    }

    void cameraRotateChanged(QVector3D p)
    {
    //m_camera->setEulerAngle(vmVector3(btRadians(p.x()), btRadians(p.y()), btRadians(p.z())));
    update();
    }

    void cameraScaleChanged(QVector3D p)
    {
    }

    void angleOfViewChanged(double value)
    {
    //m_camera->setFovx(value);
    update();
    }

    void nearClipPlaneChanged(double value)
    {
    //m_camera->setZnear(value);
    update();
    }

    void farClipPlaneChanged(double value)
    {
    //m_camera->setZfar(value);
    update();
    }

    void centerOfInterestChanged(double value)
    {
    //m_camera->setCenterOfInterest(value);
    update();
    }
    protected:
    private:
    Camera m_camera[NO_CAMS];

        //! if stand-by mode
        bool m_standBy;
    
        // indicate the device has been lost
        bool    m_bDeviceLost;
    
        //! Last updated time
        DWORD m_lastRendered;
    
        //! Clicked mouse position
        QPointF m_clickPos;
    
        //! Time
        DWORD m_dwTime;
    
        __int64 prevTimeStamp;
    
        float secsPerCnt;
    
        int m_iCurCam;
    

    };

    #endif // DXWIDGET_H
    [/code]

    Errors:
    ||=== Build: Debug in PerfectSim2 (compiler: mingw64) ===|
    ........\Software\Q\qt-4.7.4\4.7.4-qt-x64-build\include\Qt\QWidget.h|3|warning: #warning "Inclusion of header files from include/Qt is deprecated." [-Wcpp]|
    C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\include\d3d9types.h|25|warning: ignoring #pragma warning [-Wunknown-pragmas]|
    C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\include\d3d9types.h|2411|warning: ignoring #pragma warning [-Wunknown-pragmas]|
    C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\include\d3d9.h|2025|warning: "/" within comment [-Wcomment]|
    C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\include\d3d9.h|2026|warning: "/
    " within comment [-Wcomment]|
    C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\include\d3dx9math.h|19|warning: ignoring #pragma warning [-Wunknown-pragmas]|
    C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\include\d3dx9math.h|1792|warning: ignoring #pragma warning [-Wunknown-pragmas]|
    C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\include\d3dx9core.h|669|warning: multi-line comment [-Wcomment]|
    E:\Software\Q\qt-4.7.4\4.7.4-qt-x64-build\include\QtGui......\qt-everywhere-opensource-src-4.7.4\src\gui\widgets\qtabwidget.h|60|error: invalid use of incomplete type 'class QWidget'|
    E:\Software\Q\qt-4.7.4\4.7.4-qt-x64-build\include\QtGui......\qt-everywhere-opensource-src-4.7.4\src\gui\kernel\qwindowdefs.h|56|error: forward declaration of 'class QWidget'|
    E:\Software\Q\qt-4.7.4\4.7.4-qt-x64-build\include\QtGui......\qt-everywhere-opensource-src-4.7.4\src\gui\widgets\qtabwidget.h|162|error: 'QShowEvent' has not been declared|
    E:\Software\Q\qt-4.7.4\4.7.4-qt-x64-build\include\QtGui......\qt-everywhere-opensource-src-4.7.4\src\gui\widgets\qtabwidget.h|163|error: 'QResizeEvent' has not been declared|
    ....

    Any ideas why these errors would happen?
    Thanks
    Jack

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 13 Apr 2014, 13:30 last edited by
      #2

      You shouldn't be using .h includes. Use <QWidget>, <QMainWindow> etc. instead of <QWidget.h>, <QtGui/QMainWindow.h>.

      But I don't think that's the problem. The errors are in QTabWidget header and I don't see any tab widget in what you posted, so do you have any tab widgets in your code? Probably just some missing include.

      1 Reply Last reply
      0
      • X Offline
        X Offline
        Xander84
        wrote on 13 Apr 2014, 13:45 last edited by
        #3

        It seems like you are compiling Qt code directly and not with qmake? I don't know if that can lead to any problems but with this you can't use any of the Qt meta programming stuff (signals/slots, properties, etc) at least. Just a note. :)

        what do you want to do with Qt? to me it looks like you are just using the windowing system to display your DirectX stuff with a QMainWindow right? I don't know if that works like this.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lucky7456969
          wrote on 13 Apr 2014, 20:17 last edited by
          #4

          Okay, thanks, I'll make some changes.
          Have a great day!

          1 Reply Last reply
          0

          1/4

          13 Apr 2014, 09:39

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved