Snap7 Undefined Reference to TS7Client::TS7Client()
-
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```
//your code here
-
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 -
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. -
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.Hi
Statically linked means it is put inside and hence requires no DLL to
be included with the app.