Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows10 - Qt 5.5.1 MSVC2013 64bits] Error during execution of the examples #23

Closed
naubry opened this issue Jan 18, 2016 · 2 comments
Closed

Comments

@naubry
Copy link

naubry commented Jan 18, 2016

Hello,

I have compiled the library with Qt Creator. I have obtained some files like QGLViewer2.dll, QGLViewerd2.dll, QGLViewer2.lib and QGLViewerd2.lib.

After that, I compiled the various examples without error but when I execute one of these, I get this error every time : QWidget: Must construct a QApplication before a QWidget

I have compiled library and examples in the debug profil in Qt Creator 3.6 ; Besides, I am quite confused by the fact that we get the both (debug and release version of the library) when we are in the debug profil in Qt Creator or I missed something ?!

@naubry
Copy link
Author

naubry commented Jan 18, 2016

I have solved my issue. I replaced in the examples.pri file the following expression :

win32 {
    CONFIG *= debug_and_release

    # Seems to be needed for Visual Studio with Intel compiler
    DEFINES *= WIN32

    # Use native OpenGL drivers with Qt5.5
    # No longer implicit since the ANGLE driver is now an alternative
    LIBS += -lopengl32 -lglu32

    isEmpty( QGLVIEWER_STATIC ) {
        LIBS *= -L$${LIB_DIR} -lQGLViewer2
    } else {
        DEFINES *= QGLVIEWER_STATIC
        LIBS *= $${LIB_DIR}/libQGLViewer2.a
    }
}

by this :

win32 {
    # Seems to be needed for Visual Studio with Intel compiler
    DEFINES *= WIN32

    # Use native OpenGL drivers with Qt5.5
    # No longer implicit since the ANGLE driver is now an alternative
    LIBS += -lopengl32 -lglu32

        CONFIG(debug, debug|release) {
            isEmpty( QGLVIEWER_STATIC ) {
                LIBS *= -L$${LIB_DIR} -lQGLViewerd2
            } else {
                DEFINES *= QGLVIEWER_STATIC
                LIBS *= $${LIB_DIR}/libQGLViewerd2.lib
            }
        } else {
            isEmpty( QGLVIEWER_STATIC ) {
                LIBS *= -L$${LIB_DIR} -lQGLViewer2
            } else {
                DEFINES *= QGLVIEWER_STATIC
                LIBS *= $${LIB_DIR}/libQGLViewer2.lib
            }
        }
}

@GillesDebunne
Copy link
Owner

thanks for this feedback. I do not have a windows machine to try this out,
so I think I'll blindly fix the .pro from your code.

On Mon, Jan 18, 2016 at 6:56 PM, AUBRY Nicolas notifications@github.com
wrote:

I have solved my issue. I replaced in the examples.pri file the following
expression :

win32 {
CONFIG *= debug_and_release

Seems to be needed for Visual Studio with Intel compiler

DEFINES *= WIN32

Use native OpenGL drivers with Qt5.5

No longer implicit since the ANGLE driver is now an alternative

LIBS += -lopengl32 -lglu32

isEmpty( QGLVIEWER_STATIC ) {
LIBS *= -L$${LIB_DIR} -lQGLViewer2
} else {
DEFINES *= QGLVIEWER_STATIC
LIBS *= $${LIB_DIR}/libQGLViewer2.a
}

}

by this :

win32 {

Seems to be needed for Visual Studio with Intel compiler

DEFINES *= WIN32

Use native OpenGL drivers with Qt5.5

No longer implicit since the ANGLE driver is now an alternative

LIBS += -lopengl32 -lglu32

CONFIG(debug, debug|release) {
    isEmpty( QGLVIEWER_STATIC ) {
        LIBS *= -L$${LIB_DIR} -lQGLViewerd2
    } else {
        DEFINES *= QGLVIEWER_STATIC
        LIBS *= $${LIB_DIR}/libQGLViewerd2.lib
    }
} else {
    isEmpty( QGLVIEWER_STATIC ) {
        LIBS *= -L$${LIB_DIR} -lQGLViewer2
    } else {
        DEFINES *= QGLVIEWER_STATIC
        LIBS *= $${LIB_DIR}/libQGLViewer2.lib
    }
}

}


Reply to this email directly or view it on GitHub
#23 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants