Support Board
Date/Time: Sat, 13 Sep 2025 16:38:22 +0000
Post From: Linux
[2025-09-10 09:47:42] |
R1sk - Posts: 247 |
If anyone is interested, the Makefile I'm now using is like this: APP=your_dll_name_without_dll_extension
DLL=$(APP)_64.dll OLD_DLL=include/acsil/../Data/$(DLL) MAKEFLAGS += --silent CC=x86_64-w64-mingw32-c++ CFLAGS=-D_WINDOWS -D_USRDLL -D_WINDLL -s -w -m64 -march=native -O2 -std=c++20 -I./include/acsil LFLAGS=-static -shared SRC=$(APP).cpp OBJ=$(SRC:.cpp=.o) LIBS= all: $(DLL) $(DLL): $(OBJ) $(info Linking $(APP)...) $(CC) $(LFLAGS) -o $@ $^ $(CFLAGS) $(LIBS) %.o: %.cpp $(info Compiling $(APP)...) $(CC) -c -o $@ $< $(CFLAGS) install: $(info Installing $(APP)...) ./setdll $(OLD_DLL) 0 sleep 2 cp $(DLL) $(OLD_DLL) ./setdll $(OLD_DLL) 1 uninstall: $(info Uninstalling $(APP)...) $(RM) -f $(OLD_DLL) clean: $(info Cleaning $(APP)...) $(RM) $(DLL) *.o build: $(MAKE) -f $(firstword $(MAKEFILE_LIST)) clean $(MAKE) -f $(firstword $(MAKEFILE_LIST)) all $(MAKE) -f $(firstword $(MAKEFILE_LIST)) install .PHONY: all clean uninstall install build My project directory contains an 'include' subdirectory. Within it, an 'acsil' symbolic link points to the SierraChart 'ACS_Source' directory. 'setdll' is a python script as follows, #!/bin/env python3
import sys import socket if (len(sys.argv) != 3): print('Usage: setdll [DLL path] [1=load, 0=release]') exit() dll_path = sys.argv[1] dll_cmd = int(sys.argv[2]) ip = '127.0.0.1' port = 22903 msg = 'ALLOW_LOAD_DLL' if dll_cmd else 'RELEASE_DLL' msg += '--' + dll_path #print(msg) with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock: sock.sendto(msg.encode(), (ip, port)) Date Time Of Last Edit: 2025-09-10 09:51:27
|