Support Board
Date/Time: Sat, 03 May 2025 14:44:12 +0000
Post From: Is it possible to create a socket & send data to the socket from within a custom study?
[2025-02-03 22:42:05] |
Sierra123 - Posts: 27 |
Thank you for the response. I am still having an issue though. 0) I first took the sample client code and copied it verbatim, and then compiled it successfully using the following command line, obtained from Sierrachart website: x86_64-w64-mingw32-g++ -D _WIN64 -march=x86-64 -mtune=x86-64 -O2 -static -static-libgcc -static-libstdc++ -s -fexceptions -std=gnu++17 ${FileNames} -o clm -Wno-deprecated -lgdi32 -lWs2_32 -lMswsock -lAdvApi32 So now I should ba able to replicate with code in Sierrachart custom study format: 1) I took the client sample code from the link you provided, and added it to my custom study source. 2) I added the 3 libraries mentioned in the sample to the "Additional Compiler Parameters". I tried 2 different ways a) Ws2_32.lib Mswsock.lib AdvApi32.lib b) -lWs2_32 -lMswsock -lAdvApi32 3) I tried building with both the remote and the local (release) options. Both fail with the following output, as if it isn't able to find the libraries. Do you know what else I need to try? -- Starting remote build of Custom Studies Source files: Rick_SocketFeederv1.cpp. 64-bit -- 17:32:39 Allow time for the server to compile the files and build the DLL. Server: https://build3.sierrachart.com The remote build is complete. The build failed. /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x3658): undefined reference to `__imp_send' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x3b57): undefined reference to `__imp_WSAStartup' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x3dc7): undefined reference to `__imp_closesocket' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x3dcd): undefined reference to `__imp_WSACleanup' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x3e9c): undefined reference to `__imp_getaddrinfo' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x3ebc): undefined reference to `__imp_WSACleanup' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x4d54): undefined reference to `__imp_socket' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x4d7b): undefined reference to `__imp_connect' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x4dfc): undefined reference to `__imp_WSAGetLastError' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x4e14): undefined reference to `__imp_WSACleanup' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x4e22): undefined reference to `__imp_WSAGetLastError' /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccCzCGgH.o:Rick_SocketFeederv1.cpp:(.text+0x4e42): undefined reference to `__imp_closesocket' collect2: error: ld returned 1 exit status Failed to generate the dll file. -- End of Build -- 17:32:44 |