Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QtOpenCL install problems with Qt 4.7 and Windows XP
Forum Updated to NodeBB v4.3 + New Features

QtOpenCL install problems with Qt 4.7 and Windows XP

Scheduled Pinned Locked Moved Installation and Deployment
17 Posts 9 Posters 12.1k 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.
  • Q Offline
    Q Offline
    Qt newbie
    wrote on last edited by
    #1

    Dear All,

    I am trying to install QtOpenCL to Qt 4.7 in Windows XP. The install procedures I used are as follows.

    1. Download QtOpenCL source from http://qt.gitorious.org/qt-labs/opencl

    2. Copy QtOpenCl files and directories in C:\Qt\opencl (Note: Qt 4.7 has been installed in C:\Qt\2010.04)

    3. In Qt command prompt, go to C:\Qt\opencl and type qmake opencl.pro and then type mingw32-make

    I got the following error messages.

    C:\Qt\opencl>mingw32-make
    cd src\ && mingw32-make -f Makefile
    mingw32-make[1]: Entering directory C:/Qt/opencl/src' cd opencl\ && mingw32-make -f Makefile mingw32-make[2]: Entering directory C:/Qt/opencl/src/opencl'
    mingw32-make -f Makefile.Release
    mingw32-make[3]: Entering directory C:/Qt/opencl/src/opencl' g++ -c -O2 -Wall -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_MAKEDLL -DQT_BUILD_CL_LIB -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\2010.04\qt\include\QtCore" -I"..\..\..\2010.04\ qt\include\QtGui" -I"..\..\..\2010.04\qt\include" -I"..\..\..\2010.04\qt\include \ActiveQt" -I"release" -I"..\..\..\2010.04\qt\mkspecs\win32-g++" -o release\qclc ontext.o qclcontext.cpp qclcontext.cpp: In member function 'bool QCLContext::create(QFlags<QCLDevice::De viceType>)': qclcontext.cpp:169: error: invalid conversion from 'void (*)(const char*, const void*, size_t, void*)' to 'void (*)(const char*, const void*, size_t, void*)' qclcontext.cpp:169: error: initializing argument 4 of '_cl_context* clCreateCo ntext(const cl_context_properties*, cl_uint, _cl_device_id* const*, void (*)(con st char*, const void*, size_t, void*), void*, cl_int*)' qclcontext.cpp: In member function 'bool QCLContext::create(const QList<QCLDevic e>&)': qclcontext.cpp:212: error: invalid conversion from 'void (*)(const char*, const void*, size_t, void*)' to 'void (*)(const char*, const void*, size_t, void*)' qclcontext.cpp:212: error: initializing argument 4 of '_cl_context* clCreateCo ntext(const cl_context_properties*, cl_uint, _cl_device_id* const*, void (*)(con st char*, const void*, size_t, void*), void*, cl_int*)' mingw32-make[3]: *** [release/qclcontext.o] Error 1 mingw32-make[3]: Leaving directory C:/Qt/opencl/src/opencl'
    mingw32-make[2]: *** [release] Error 2
    mingw32-make[2]: Leaving directory C:/Qt/opencl/src/opencl' mingw32-make[1]: *** [sub-opencl-make_default-ordered] Error 2 mingw32-make[1]: Leaving directory C:/Qt/opencl/src'
    mingw32-make: *** [sub-src-make_default-ordered] Error 2

    Could anyone inform me how to fix it?

    Thanks,

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      Really strange errors. Problem in conversion between two identical types. Maybe problem in mingw somewhere?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kuiash
        wrote on last edited by
        #3

        Hiya Qt Newbie,

        I'm seeing the same problem - QT 4.7 (release), QtOpenCL packages, compiled using MINGW on Windows XP. Exact same error.

        I simply removed the callback function from the parameter list (replacing it with null which is apparently proper OpenCL) and the error went away - sadly other errors cropped up after "fixing" this one.

        Have you found a solution?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cisla
          wrote on last edited by
          #4

          Solution:
          Change in qclcontextgl.cpp:
          @
          static void qt_clgl_context_notify(const char *errinfo,
          const void *private_info,
          size_t cb,
          void *user_data)
          @
          with:
          @
          static void CL_API_CALL qt_clgl_context_notify(const char *errinfo,
          const void *private_info,
          size_t cb,
          void *user_data)
          @

          and in qclcontent.cpp:
          @
          static void qt_cl_context_notify(const char *errinfo,
          const void *private_info,
          size_t cb,
          void *user_data)
          @

          with:
          @
          static void CL_API_CALL qt_cl_context_notify(const char *errinfo,
          const void *private_info,
          size_t cb,
          void *user_data)
          @

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Tadius
            wrote on last edited by
            #5

            After following the "fixing" problem as cisla wrote I get this error. It's mean can't find -IOpenCL
            (I is uppercase of i). How to solve this problem:

            @
            C:\Qt\2010.05\qt\OpenCL>mingw32-make
            cd src\ && mingw32-make -f Makefile
            mingw32-make[1]: Entering directory C:/Qt/2010.05/qt/OpenCL/src' cd opencl\ && mingw32-make -f Makefile mingw32-make[2]: Entering directory C:/Qt/2010.05/qt/OpenCL/src/opencl'
            mingw32-make -f Makefile.Debug all
            mingw32-make[3]: Entering directory C:/Qt/2010.05/qt/OpenCL/src/opencl' g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel oc -shared -mthreads -Wl -Wl,--out-implib,..\..\bin\libQtOpenCL.a -o ..\..\bin\Q tOpenCL.dll object_script.QtOpenCL.Debug -L"c:\Qt\2010.05\qt\lib" -L"c:\Qt\2010 .05\qt\lib" -lOpenCL -lQtGuid4 -lQtCored4 c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lOpenCL collect2: ld returned 1 exit status mingw32-make[3]: *** [..\..\bin\QtOpenCL.dll] Error 1 mingw32-make[3]: Leaving directory C:/Qt/2010.05/qt/OpenCL/src/opencl'
            mingw32-make[2]: *** [debug-all] Error 2
            mingw32-make[2]: Leaving directory C:/Qt/2010.05/qt/OpenCL/src/opencl' mingw32-make[1]: *** [sub-opencl-make_default-ordered] Error 2 mingw32-make[1]: Leaving directory C:/Qt/2010.05/qt/OpenCL/src'
            mingw32-make: *** [sub-src-make_default-ordered] Error 2
            @

            [EDIT: code highlighting / Volker]

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              It is not -I (uppercase i) but -l (lowercase L) - the error occurs during linking.

              There is no path to your OpenCL lib in the command line. You should add it with -L like this in your .pro file:

              @
              LIBS += -L"c:\path\to\opencl\libdir"
              @

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • T Offline
                T Offline
                Tadius
                wrote on last edited by
                #7

                Thanks mr Volker. But how can i find the lib dir. I installed Nvidia Cuda toolkit 3.2.
                Do you mean the lib dir which contains "OpenCL.lib" file

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  Yes, that is exactly the path to put after the -L

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    Tadius
                    wrote on last edited by
                    #9

                    Thanks mr Volker again. At this time it compiled successfully. But it've try every example include with QtOpenCL, whole them crash.

                    My spec is :
                    NVdia 9500GT 1GB
                    Dirver ver 260.99 (Supported OpenCL following by NVidia website)
                    Windows XP Sp3.
                    QT 4.7.1

                    What went wrong?

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      Now it's time to put OpenCL.dll near your exe.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        Tadius
                        wrote on last edited by
                        #11

                        I doing exactly what you told me. It's require some more dll such as mingw100.dll and some Qt4 runtime dll almost done. I've tested with clinfo program but it's doesn't show up anything about my system device. It's just terminated in silent.

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          Tadius
                          wrote on last edited by
                          #12

                          QtOpenCL doesn't work on my XP system. Every examples are built, but them crashes?
                          What went wrong?

                          1 Reply Last reply
                          0
                          • G Offline
                            G Offline
                            giesbert
                            wrote on last edited by
                            #13

                            [quote author="Tadius" date="1294390789"]QtOpenCL doesn't work on my XP system. Every examples are built, but them crashes?
                            What went wrong?
                            [/quote]

                            This question is something like: My car is out of order, how can I repair it.

                            Please be morre precisely, What exaclty happens? Which error/crash messages do you get? Can you debug it? You are using mingw, is QtOpenCL also compiled with the same compiler? ...?

                            Nokia Certified Qt Specialist.
                            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                            1 Reply Last reply
                            0
                            • T Offline
                              T Offline
                              Tadius
                              wrote on last edited by
                              #14

                              I'm using Qt from QtSDK for Windows. It comes with MinGW.

                              1.Example "Colorize" and "Blur" ran but after I quit these program ,they were crashed.
                              Messages is "An unhandle Win32 exception occurred in colorize [3928]" because I've installed Visual Studio 2008 on same machine with Qt SDK 2010.05 (ver 4.7.1 - MinGW).

                              2.clinfo - for displaying infor about my devices run. But doesn't show up anything. It quits with Error code 0. I've try comment out all the code in scope main() to make it like this

                              [quote]
                              //include some header of QtOpenCL or OpenCL header file
                              #include <conio.h>
                              int main(int argc,char *argv[])
                              {
                              /*I comment all code of original clinfo.cpp file */
                              getch();
                              return 0;
                              }
                              [/quote]
                              I save it and recompile and then launch it. It returned immediately without waiting for user press a key. That means something went wrong when including the header of QtOpenCL but I don't know.
                              Some one can tell me why? And how to solve this problem.

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                sabrog
                                wrote on last edited by
                                #15

                                I have same problems. If i run bezierpatch demo in QtCreator i see in console:

                                @
                                QCLContextGL::create: do not know how to enable sharing
                                QtOpenGL: Resources are still available at program shutdown.
                                This is possibly caused by a leaked QGLWidget,
                                QGLFramebufferObject or QGLPixelBuffer.
                                @

                                Only debug version worked for me, but also crashed at close. But debug version don't run under gdb, segmentation fault at runtime.

                                Problems with utils like clinfo i solve by adding "CONFIG += console" to .pro files. printf doesn't work for windows if programs don't compiled as "console" application.

                                QT - Apple QuickTime
                                Qt - Nokia's Qt Development Frameworks
                                Apple is a competitor of Nokia, so QT != Qt

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  sabrog
                                  wrote on last edited by
                                  #16

                                  Something wrong inside QApplication and QApplication::exec()/QCoreApplication::exec(). With QCoreApplication and without call main event loop application run and exit without crashes, but with QApplication and without call main event loop application also crashes. Maybe something bad inside event loop.

                                  QT - Apple QuickTime
                                  Qt - Nokia's Qt Development Frameworks
                                  Apple is a competitor of Nokia, so QT != Qt

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    mrad
                                    wrote on last edited by
                                    #17

                                    Following instructions on this page I succeeded in building qtopencl on windows 7/64 bit but when I run the colorize example I get:

                                    QCLProgram::build: "CL_BUILD_PROGRAM_FAILURE"
                                    "C:\Users\name\AppData\Local\Temp\OCL6154.tmp.cl(41): warning: global
                                    variable declaration is corrected by the compiler to have addrSpace
                                    constant
                                    const sampler_t samp = CLK_ADDRESS_CLAMP_TO_EDGE |
                                    ^

                                    Error:E014:Images not currently supported!

                                    QCLContext::createImage2DCopy: "CL_INVALID_OPERATION"

                                    Has anybody suggestions on that?
                                    Thanks

                                    1 Reply Last reply
                                    0

                                    • Login

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