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. How to use KDCharts from GitHub on Windows?
Forum Updated to NodeBB v4.3 + New Features

How to use KDCharts from GitHub on Windows?

Scheduled Pinned Locked Moved Solved General and Desktop
25 Posts 4 Posters 3.4k Views 2 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.
  • jsulmJ jsulm

    @Mucip You still did not answer the question regarding MSVC console short-cut in start menu: did you try to use it?
    And there is actually no need for an YouTube video to find a file...

    MucipM Offline
    MucipM Offline
    Mucip
    wrote on last edited by
    #15

    @jsulm ,
    Yes I use MSVC2017 64 bit console from start menu which comes with Qt instalation.

    Regards,
    Mucip:)

    jsulmJ 1 Reply Last reply
    0
    • jsulmJ jsulm

      @Mucip You still did not answer the question regarding MSVC console short-cut in start menu: did you try to use it?
      And there is actually no need for an YouTube video to find a file...

      MucipM Offline
      MucipM Offline
      Mucip
      wrote on last edited by Mucip
      #16

      @jsulm
      I added rc.exe and others in the PATH and restart configure.bat and nmake command.

      nmake result error message is:

      rc /NOLOGO -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DNDEBUG -DUSE_EXCEPTIONS -DKDCHART_VERSION=200 -DKDCHART_MASTER_CVS -DQT_FATAL_ASSERT -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -DQBA_NO_CAST_TO_VOID -DQBA_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DNOMINMAX -D_USE_MATH_DEFINES -DKDCHART_SHAREDLIB -DKDCHART_BUILD_KDCHART_LIB -DQT_NO_KEYWORDS -Demit= -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_WINDLL -fo release\_obj\kdchart_resource.res kdchart_resource.rc
      kdchart_resource.rc(1) : fatal error RC1015: cannot open include file 'windows.h'.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\rc.EXE"' : Return code '0x1'
      Stop.
      NMAKE : fatal error U1077: 'cd' : Return code '0x2'
      Stop.
      
      C:\Users\mucip\Documents\Qt\KDChart>
      

      Regards,
      Mucip:)

      1 Reply Last reply
      0
      • MucipM Mucip

        @jsulm ,
        Yes I use MSVC2017 64 bit console from start menu which comes with Qt instalation.

        Regards,
        Mucip:)

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #17

        @Mucip said in How to use KDCharts from GitHub on Windows?:

        Yes I use MSVC2017 64 bit console from start menu which comes with Qt instalation.

        But you have Visual Studio 2019? I'm not sure it is going to work. You can try the console from Visual Studio - I'm not a Visual Studio expert but I think there is a console.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by VRonin
          #18
          1. Install MSVC (aka Visual Studio)
          2. Install Qt5 for MSVC
          3. Install CMake (https://cmake.org/)
          4. open a command prompt and run both qtenv2.bat (from the Qt folder) and vcvarsall.bat x64 (from the Visual Studio Folder)
          5. Prepend the path to cmake.exe to your PATH env variable: SET PATH=C:\Program Files\CMake;%PATH%
          6. download the sources of kdchart
          7. navigate the command prompt to that folder
          8. Run the following commands:
          mkdir build
          cd build
          cmake -G "NMake Makefiles" -DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX=C:/KDCharts -DCMAKE_BUILD_TYPE=DEBUG ../
          cmake --build .
          cmake --build . --target install
          cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:/KDCharts -DCMAKE_BUILD_TYPE=RELEASE ../
          cmake --build .
          cmake --build . --target install
          

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          MucipM 2 Replies Last reply
          2
          • VRoninV VRonin
            1. Install MSVC (aka Visual Studio)
            2. Install Qt5 for MSVC
            3. Install CMake (https://cmake.org/)
            4. open a command prompt and run both qtenv2.bat (from the Qt folder) and vcvarsall.bat x64 (from the Visual Studio Folder)
            5. Prepend the path to cmake.exe to your PATH env variable: SET PATH=C:\Program Files\CMake;%PATH%
            6. download the sources of kdchart
            7. navigate the command prompt to that folder
            8. Run the following commands:
            mkdir build
            cd build
            cmake -G "NMake Makefiles" -DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX=C:/KDCharts -DCMAKE_BUILD_TYPE=DEBUG ../
            cmake --build .
            cmake --build . --target install
            cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:/KDCharts -DCMAKE_BUILD_TYPE=RELEASE ../
            cmake --build .
            cmake --build . --target install
            
            MucipM Offline
            MucipM Offline
            Mucip
            wrote on last edited by
            #19

            Hi @VRonin ,
            I applied your list but there is error. I think it's because of VS2019 or my path variables?!

            C:\Users\mucip\Documents\Qt\KDChart\build>cmake -G "NMake Makefiles" -DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX=C:/KDCharts -DCMAKE_BUILD_TYPE=DEBUG ../
            -- The CXX compiler identification is MSVC 19.23.28106.4
            -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
            -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe - broken
            CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeTestCXXCompiler.cmake:53 (message):
              The C++ compiler
            
                "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe"
            
              is not able to compile a simple test program.
            
              It fails with the following output:
            
                Change Dir: C:/Users/mucip/Documents/Qt/KDChart/build/CMakeFiles/CMakeTmp
            
                Run Build Command(s):nmake /nologo cmTC_f17e3\fast &&       "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\Hostx64\x64\nmake.exe" -f CMakeFiles\cmTC_f17e3.dir\build.make /nologo -L                  CMakeFiles\cmTC_f17e3.dir\build
                Building CXX object CMakeFiles/cmTC_f17e3.dir/testCXXCompiler.cxx.obj
                    C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\bin\Hostx64\x64\cl.exe @C:\Users\mucip\AppData\Local\Temp\nm72D3.tmp
                testCXXCompiler.cxx
                Linking CXX executable cmTC_f17e3.exe
                    "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_f17e3.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_f17e3.dir\objects1.rsp @C:\Users\mucip\AppData\Local\Temp\nm745B.tmp
                LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_f17e3.dir\objects1.rsp /out:cmTC_f17e3.exe /implib:cmTC_f17e3.lib /pdb:C:\Users\mucip\Documents\Qt\KDChart\build\CMakeFiles\CMakeTmp\cmTC_f17e3.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_f17e3.dir/intermediate.manifest CMakeFiles\cmTC_f17e3.dir/manifest.res" failed (exit code 1104) with the following output:
                LINK : fatal error LNK1104: 'kernel32.lib' dosyas² a²lam²yor
                NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : D÷n³■ kodu '0xffffffff'
                Stop.
                NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\Hostx64\x64\nmake.exe"' : D÷n³■ kodu '0x2'
                Stop.
            
            
            
            
            
              CMake will not be able to correctly generate this project.
            Call Stack (most recent call first):
              CMakeLists.txt:40 (project)
            
            
            -- Configuring incomplete, errors occurred!
            See also "C:/Users/mucip/Documents/Qt/KDChart/build/CMakeFiles/CMakeOutput.log".
            See also "C:/Users/mucip/Documents/Qt/KDChart/build/CMakeFiles/CMakeError.log".
            
            C:\Users\mucip\Documents\Qt\KDChart\build>
            

            Regards,
            Mucip:)

            VRoninV 1 Reply Last reply
            0
            • MucipM Mucip

              Hi @VRonin ,
              I applied your list but there is error. I think it's because of VS2019 or my path variables?!

              C:\Users\mucip\Documents\Qt\KDChart\build>cmake -G "NMake Makefiles" -DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX=C:/KDCharts -DCMAKE_BUILD_TYPE=DEBUG ../
              -- The CXX compiler identification is MSVC 19.23.28106.4
              -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
              -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe - broken
              CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeTestCXXCompiler.cmake:53 (message):
                The C++ compiler
              
                  "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe"
              
                is not able to compile a simple test program.
              
                It fails with the following output:
              
                  Change Dir: C:/Users/mucip/Documents/Qt/KDChart/build/CMakeFiles/CMakeTmp
              
                  Run Build Command(s):nmake /nologo cmTC_f17e3\fast &&       "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\Hostx64\x64\nmake.exe" -f CMakeFiles\cmTC_f17e3.dir\build.make /nologo -L                  CMakeFiles\cmTC_f17e3.dir\build
                  Building CXX object CMakeFiles/cmTC_f17e3.dir/testCXXCompiler.cxx.obj
                      C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\bin\Hostx64\x64\cl.exe @C:\Users\mucip\AppData\Local\Temp\nm72D3.tmp
                  testCXXCompiler.cxx
                  Linking CXX executable cmTC_f17e3.exe
                      "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_f17e3.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_f17e3.dir\objects1.rsp @C:\Users\mucip\AppData\Local\Temp\nm745B.tmp
                  LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_f17e3.dir\objects1.rsp /out:cmTC_f17e3.exe /implib:cmTC_f17e3.lib /pdb:C:\Users\mucip\Documents\Qt\KDChart\build\CMakeFiles\CMakeTmp\cmTC_f17e3.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_f17e3.dir/intermediate.manifest CMakeFiles\cmTC_f17e3.dir/manifest.res" failed (exit code 1104) with the following output:
                  LINK : fatal error LNK1104: 'kernel32.lib' dosyas² a²lam²yor
                  NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : D÷n³■ kodu '0xffffffff'
                  Stop.
                  NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\Hostx64\x64\nmake.exe"' : D÷n³■ kodu '0x2'
                  Stop.
              
              
              
              
              
                CMake will not be able to correctly generate this project.
              Call Stack (most recent call first):
                CMakeLists.txt:40 (project)
              
              
              -- Configuring incomplete, errors occurred!
              See also "C:/Users/mucip/Documents/Qt/KDChart/build/CMakeFiles/CMakeOutput.log".
              See also "C:/Users/mucip/Documents/Qt/KDChart/build/CMakeFiles/CMakeError.log".
              
              C:\Users\mucip\Documents\Qt\KDChart\build>
              

              Regards,
              Mucip:)

              VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by VRonin
              #20

              @Mucip said in How to use KDCharts from GitHub on Windows?:

              I think it's because of VS2019 or my path variables?!

              Did you run vcvarsall.bat x64 as mentioned in step 4? and I don't mean double-clicking on the file but using the command line to execute them

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              MucipM 1 Reply Last reply
              0
              • VRoninV VRonin

                @Mucip said in How to use KDCharts from GitHub on Windows?:

                I think it's because of VS2019 or my path variables?!

                Did you run vcvarsall.bat x64 as mentioned in step 4? and I don't mean double-clicking on the file but using the command line to execute them

                MucipM Offline
                MucipM Offline
                Mucip
                wrote on last edited by
                #21

                @VRonin ,
                I run below command in MSVC2019 console:

                C:\Users\mucip\Documents\Qt\KDChart\build>"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
                

                It's building now. I think it will be ok. Thanks :)

                Regards,
                Mucip:)

                1 Reply Last reply
                0
                • VRoninV VRonin
                  1. Install MSVC (aka Visual Studio)
                  2. Install Qt5 for MSVC
                  3. Install CMake (https://cmake.org/)
                  4. open a command prompt and run both qtenv2.bat (from the Qt folder) and vcvarsall.bat x64 (from the Visual Studio Folder)
                  5. Prepend the path to cmake.exe to your PATH env variable: SET PATH=C:\Program Files\CMake;%PATH%
                  6. download the sources of kdchart
                  7. navigate the command prompt to that folder
                  8. Run the following commands:
                  mkdir build
                  cd build
                  cmake -G "NMake Makefiles" -DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX=C:/KDCharts -DCMAKE_BUILD_TYPE=DEBUG ../
                  cmake --build .
                  cmake --build . --target install
                  cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:/KDCharts -DCMAKE_BUILD_TYPE=RELEASE ../
                  cmake --build .
                  cmake --build . --target install
                  
                  MucipM Offline
                  MucipM Offline
                  Mucip
                  wrote on last edited by
                  #22

                  @VRonin ,
                  I build library and add all necessary things in pro file:

                  QT       += core gui
                  
                  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                  
                  CONFIG += c++11
                  
                  # The following define makes your compiler emit warnings if you use
                  # any Qt feature that has been marked deprecated (the exact warnings
                  # depend on your compiler). Please consult the documentation of the
                  # deprecated API in order to know how to port your code away from it.
                  DEFINES += QT_DEPRECATED_WARNINGS
                  
                  # You can also make your code fail to compile if it uses deprecated APIs.
                  # In order to do so, uncomment the following line.
                  # You can also select to disable deprecated APIs only up to a certain version of Qt.
                  #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                  
                  SOURCES += \
                      main.cpp \
                      mainwindow.cpp
                  
                  HEADERS += \
                      mainwindow.h
                  
                  FORMS += \
                      mainwindow.ui
                  
                  # Default rules for deployment.
                  qnx: target.path = /tmp/$${TARGET}/bin
                  else: unix:!android: target.path = /opt/$${TARGET}/bin
                  !isEmpty(target.path): INSTALLS += target
                  
                  win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../KDCharts/lib/ -lkdchart2
                  else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../KDCharts/lib/ -lkdchart2d
                  # else:unix:!macx: LIBS += -L$$PWD/../KDCharts/lib/ -lkdchart2
                  
                  
                  
                  
                  
                  INCLUDEPATH += $$PWD/../KDCharts/include/KDChart
                  DEPENDPATH += $$PWD/../KDCharts/include/KDChart
                  

                  I can add the includes without erro in mainWindow.h file

                  #include <KDChartChart>
                  #include <KDChartLineDiagram>
                  
                  

                  Then in cpp file:

                  //Add the widget to your layout like any other QWidget:
                      QHBoxLayout* chartLayout = new QHBoxLayout(ui->chartFrame);
                      KDChart::Chart *m_chart = new KDChart::Chart(this);
                      chartLayout->addWidget( m_chart );
                  

                  But I can not run the code. It crush without message. Only this:

                  22:40:54: Starting C:\Users\mucip\Documents\Qt\build-KDChartdYeniDeneme-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\release\KDChartdYeniDeneme.exe ...
                  22:40:54: The program has unexpectedly finished.
                  22:40:54: The process was ended forcefully.
                  22:40:54: C:\Users\mucip\Documents\Qt\build-KDChartdYeniDeneme-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\release\KDChartdYeniDeneme.exe crashed.
                  

                  I run debugger but nothings happend?! I use MSVC2019. May it be because of newest version of VS?

                  Regards,
                  Mucip:)

                  MucipM VRoninV 2 Replies Last reply
                  0
                  • MucipM Mucip

                    @VRonin ,
                    I build library and add all necessary things in pro file:

                    QT       += core gui
                    
                    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                    
                    CONFIG += c++11
                    
                    # The following define makes your compiler emit warnings if you use
                    # any Qt feature that has been marked deprecated (the exact warnings
                    # depend on your compiler). Please consult the documentation of the
                    # deprecated API in order to know how to port your code away from it.
                    DEFINES += QT_DEPRECATED_WARNINGS
                    
                    # You can also make your code fail to compile if it uses deprecated APIs.
                    # In order to do so, uncomment the following line.
                    # You can also select to disable deprecated APIs only up to a certain version of Qt.
                    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                    
                    SOURCES += \
                        main.cpp \
                        mainwindow.cpp
                    
                    HEADERS += \
                        mainwindow.h
                    
                    FORMS += \
                        mainwindow.ui
                    
                    # Default rules for deployment.
                    qnx: target.path = /tmp/$${TARGET}/bin
                    else: unix:!android: target.path = /opt/$${TARGET}/bin
                    !isEmpty(target.path): INSTALLS += target
                    
                    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../KDCharts/lib/ -lkdchart2
                    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../KDCharts/lib/ -lkdchart2d
                    # else:unix:!macx: LIBS += -L$$PWD/../KDCharts/lib/ -lkdchart2
                    
                    
                    
                    
                    
                    INCLUDEPATH += $$PWD/../KDCharts/include/KDChart
                    DEPENDPATH += $$PWD/../KDCharts/include/KDChart
                    

                    I can add the includes without erro in mainWindow.h file

                    #include <KDChartChart>
                    #include <KDChartLineDiagram>
                    
                    

                    Then in cpp file:

                    //Add the widget to your layout like any other QWidget:
                        QHBoxLayout* chartLayout = new QHBoxLayout(ui->chartFrame);
                        KDChart::Chart *m_chart = new KDChart::Chart(this);
                        chartLayout->addWidget( m_chart );
                    

                    But I can not run the code. It crush without message. Only this:

                    22:40:54: Starting C:\Users\mucip\Documents\Qt\build-KDChartdYeniDeneme-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\release\KDChartdYeniDeneme.exe ...
                    22:40:54: The program has unexpectedly finished.
                    22:40:54: The process was ended forcefully.
                    22:40:54: C:\Users\mucip\Documents\Qt\build-KDChartdYeniDeneme-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\release\KDChartdYeniDeneme.exe crashed.
                    

                    I run debugger but nothings happend?! I use MSVC2019. May it be because of newest version of VS?

                    Regards,
                    Mucip:)

                    MucipM Offline
                    MucipM Offline
                    Mucip
                    wrote on last edited by
                    #23

                    Hi,
                    Missing DLL's. Sorry...
                    I coppied DLL's from KDCharts/bin directory to build directory.

                    Regards,
                    Mucip:)

                    1 Reply Last reply
                    0
                    • MucipM Mucip

                      @VRonin ,
                      I build library and add all necessary things in pro file:

                      QT       += core gui
                      
                      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                      
                      CONFIG += c++11
                      
                      # The following define makes your compiler emit warnings if you use
                      # any Qt feature that has been marked deprecated (the exact warnings
                      # depend on your compiler). Please consult the documentation of the
                      # deprecated API in order to know how to port your code away from it.
                      DEFINES += QT_DEPRECATED_WARNINGS
                      
                      # You can also make your code fail to compile if it uses deprecated APIs.
                      # In order to do so, uncomment the following line.
                      # You can also select to disable deprecated APIs only up to a certain version of Qt.
                      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                      
                      SOURCES += \
                          main.cpp \
                          mainwindow.cpp
                      
                      HEADERS += \
                          mainwindow.h
                      
                      FORMS += \
                          mainwindow.ui
                      
                      # Default rules for deployment.
                      qnx: target.path = /tmp/$${TARGET}/bin
                      else: unix:!android: target.path = /opt/$${TARGET}/bin
                      !isEmpty(target.path): INSTALLS += target
                      
                      win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../KDCharts/lib/ -lkdchart2
                      else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../KDCharts/lib/ -lkdchart2d
                      # else:unix:!macx: LIBS += -L$$PWD/../KDCharts/lib/ -lkdchart2
                      
                      
                      
                      
                      
                      INCLUDEPATH += $$PWD/../KDCharts/include/KDChart
                      DEPENDPATH += $$PWD/../KDCharts/include/KDChart
                      

                      I can add the includes without erro in mainWindow.h file

                      #include <KDChartChart>
                      #include <KDChartLineDiagram>
                      
                      

                      Then in cpp file:

                      //Add the widget to your layout like any other QWidget:
                          QHBoxLayout* chartLayout = new QHBoxLayout(ui->chartFrame);
                          KDChart::Chart *m_chart = new KDChart::Chart(this);
                          chartLayout->addWidget( m_chart );
                      

                      But I can not run the code. It crush without message. Only this:

                      22:40:54: Starting C:\Users\mucip\Documents\Qt\build-KDChartdYeniDeneme-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\release\KDChartdYeniDeneme.exe ...
                      22:40:54: The program has unexpectedly finished.
                      22:40:54: The process was ended forcefully.
                      22:40:54: C:\Users\mucip\Documents\Qt\build-KDChartdYeniDeneme-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\release\KDChartdYeniDeneme.exe crashed.
                      

                      I run debugger but nothings happend?! I use MSVC2019. May it be because of newest version of VS?

                      Regards,
                      Mucip:)

                      VRoninV Offline
                      VRoninV Offline
                      VRonin
                      wrote on last edited by
                      #24

                      @Mucip said in How to use KDCharts from GitHub on Windows?:

                      -L$$PWD/../KDCharts/lib/

                      Relative paths are often inadvisable, use the full absolute path -LC:/KDCharts/lib/

                      I coppied DLL's from KDCharts/bin directory to build directory.

                      This is bad. You should add the path to those DLLs to the "run environment" options of Qt Creator

                      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                      ~Napoleon Bonaparte

                      On a crusade to banish setIndexWidget() from the holy land of Qt

                      MucipM 1 Reply Last reply
                      4
                      • VRoninV VRonin

                        @Mucip said in How to use KDCharts from GitHub on Windows?:

                        -L$$PWD/../KDCharts/lib/

                        Relative paths are often inadvisable, use the full absolute path -LC:/KDCharts/lib/

                        I coppied DLL's from KDCharts/bin directory to build directory.

                        This is bad. You should add the path to those DLLs to the "run environment" options of Qt Creator

                        MucipM Offline
                        MucipM Offline
                        Mucip
                        wrote on last edited by
                        #25

                        Hi @VRonin ,
                        OK. I will care about this advice. Thanks. ;)

                        Regards,
                        Mucip:)

                        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