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. Snap7 Undefined Reference to TS7Client::TS7Client()
Forum Updated to NodeBB v4.3 + New Features

Snap7 Undefined Reference to TS7Client::TS7Client()

Scheduled Pinned Locked Moved Solved General and Desktop
24 Posts 4 Posters 6.6k 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.
  • Z Offline
    Z Offline
    ZekDe
    wrote on last edited by
    #15

    Okay okay, when I create the this object in mainwindow.h ,this is being creating but I couldn't reach it from in mainwinbdow.cpp

    into mainwindow.h

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QMainWindow>
    #include "snap7.h"
    
    
    namespace Ui {
    class MainWindow;
    }
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        explicit MainWindow(QWidget *parent = 0);
    
        void CliCompletion(void *usrPtr, int opCode, int opResult);
        void SysSleep(uint32_t Delay_ms);
        bool Check(int Result, const char * function);
        void MultiRead();
        void ListBlocks();
        void OrderCode();
        void CpuInfo();
        void CpInfo();
        void UnitStatus();
        void UploadDB0();
        void AsCBUploadDB0();
        void AsEWUploadDB0();
        void AsPOUploadDB0();
        void ReadSzl_0011_0000();
        bool CliConnect();
        void CliDisconnect();
        void PerformTests();
        void Summary();
        //void hexdump(void *mem, unsigned int len);
    
        ~MainWindow();
    
    private:
        Ui::MainWindow *ui;
    
             TS7Client *Client = new TS7Client();
    
             uint8_t Buffer[65536]; // 64 K buffer
             int SampleDBNum = 1000;
    
             char *Address = (char*)"192.168.0.1" ;     // PLC IP Address
             int Rack=0,Slot=1; // Default Rack and Slot
    
             int ok = 0; // Number of test pass
             int ko = 0; // Number of test failure
    
             bool JobDone=false;
             int JobResult=0;
    };
    
    #endif // MAINWINDOW_H
    
    

    into .cpp```
    0_1516196444568_efe5b0dc-d8d7-481d-a4c8-9b9eb9a7aad1-image.png //your code here

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZekDe
      wrote on last edited by
      #16

      I am missing something ,I couldnt get to used C++ yet

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZekDe
        wrote on last edited by
        #17

        ![alt text](0_1516196914626_2e46ef7a-b7c6-47f9-aebd-137eced44bbc-image.png image url)

        0_1516196938513_0c459213-da27-4662-ad9b-38e038f66077-image.png

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZekDe
          wrote on last edited by
          #18

          When I add the source files ,it worked properly.Also this lines is being added,I dont know why

          win32:LIBS += C:\Qt\Tools\mingw530_32\i686-w64-mingw32\lib\libws2_32.a
          win32:LIBS += C:\Qt\Tools\mingw530_32\i686-w64-mingw32\lib\libwinmm.a

          mrjjM 1 Reply Last reply
          0
          • Z ZekDe

            When I add the source files ,it worked properly.Also this lines is being added,I dont know why

            win32:LIBS += C:\Qt\Tools\mingw530_32\i686-w64-mingw32\lib\libws2_32.a
            win32:LIBS += C:\Qt\Tools\mingw530_32\i686-w64-mingw32\lib\libwinmm.a

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #19

            @ZekDe
            its runtime libs from the compiler.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZekDe
              wrote on last edited by
              #20

              well, how can I reliase it if I use any libs

              mrjjM 1 Reply Last reply
              0
              • Z ZekDe

                well, how can I reliase it if I use any libs

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #21

                @ZekDe
                In what way realize ?
                It surely uses its runtime files.

                1 Reply Last reply
                0
                • Z Offline
                  Z Offline
                  ZekDe
                  wrote on last edited by
                  #22

                  when I create a new project there are no these lines.A guy give me a sample project and these lines were in it.
                  If he dont give me a project .How will I add these line?

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZekDe
                    wrote on last edited by
                    #23

                    Hmm I have looked in Makefile and I encounter this line,
                    LIBS = -L"$(MINGW)/lib" -static-libgcc --no-export-all-symbols --add-stdcall-alias $(MINGW)/lib/libws2_32.a $(MINGW)/lib/libwinmm.a $(MINGW)/lib/gcc/mingw32/$(MINREL)/libstdc++.a
                    INCS = -I"$(MINGW)/include" -I"../../../src/sys" -I"../../../src/core" -I"../../../src/lib"

                    Previously I realised , there is no files in mingw32 5.3.0 but libstdc++ is available
                    Also existing a this writing in webside, "Libstdc++ are statically linked, so you don’t need to distribute them with your software" I suppose it means that.
                    I do not have enough knowledge.

                    mrjjM 1 Reply Last reply
                    0
                    • Z ZekDe

                      Hmm I have looked in Makefile and I encounter this line,
                      LIBS = -L"$(MINGW)/lib" -static-libgcc --no-export-all-symbols --add-stdcall-alias $(MINGW)/lib/libws2_32.a $(MINGW)/lib/libwinmm.a $(MINGW)/lib/gcc/mingw32/$(MINREL)/libstdc++.a
                      INCS = -I"$(MINGW)/include" -I"../../../src/sys" -I"../../../src/core" -I"../../../src/lib"

                      Previously I realised , there is no files in mingw32 5.3.0 but libstdc++ is available
                      Also existing a this writing in webside, "Libstdc++ are statically linked, so you don’t need to distribute them with your software" I suppose it means that.
                      I do not have enough knowledge.

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #24

                      Hi
                      Statically linked means it is put inside and hence requires no DLL to
                      be included with the app.

                      1 Reply Last reply
                      1

                      • Login

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