Login Page - Create Account

Support Board


Date/Time: Tue, 22 Apr 2025 22:59:31 +0000



[Programming Help] - Local build with mingw creates a dll without study symbols using official compiler flags

View Count: 207

[2024-12-19 12:48:20]
jonas.cl - Posts: 3
I'm trying to build our studies locally using MingW on Linux, but for some reason the symbols scsf_ are never present in the created dll-file. I've tried all kinds of different compilation and linking parameters, also the ones provided officially here https://www.sierrachart.com/index.php?page=doc/AdvancedCustomStudyInterfaceAndLanguage.php#RemoteCompilerParameters_32.

x86_64-w64-mingw32-g++ -D _WIN64 -U NOMINMAX -march=x86-64 -mtune=x86-64 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -std=gnu++11 {InputFiles} -o Output.dll -Wno-deprecated

I'm building with wine64 x86_64-w64-mingw32-g++ ...

Running the nm command on the dll just reports "no symbols".

$ wine64 ~/Apps/cc/mingw64/bin/nm.exe strategy_64.dll
Z:\home\nixos\Apps\cc\mingw64\bin\nm.exe: strategy_64.dll: no symbols

It is also not possible to load the strategy in Sierra Chart.

What are the compiler/linker/etc flags used by "Remote Build"? All my studies build, load and work correctly with remote build.
[2024-12-19 14:35:43]
Sierra_Chart Engineering - Posts: 19305
We will get back to you on this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-12-19 16:33:02]
Sierra_Chart Engineering - Posts: 19305
This is what is used for Remote Build:

x86_64-w64-mingw32-g++ -D _WIN64 -march=x86-64 -mtune=x86-64 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fexceptions -std=gnu++17 {$FileNames} -o Output.dll -Wno-deprecated -lgdi32 &>Output.txt;

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-12-19 16:36:16
[2024-12-19 17:13:55]
jonas.cl - Posts: 3
Thank you for the answer! Unfortunately on my system this command doesn't produce a binary with symbols. I guess it could be related to compiler version, environment or something else. Would you mind sharing a build log with debugging enabled? Add -v -fverbose-asm -Q -save-temps to the command. If this path doesn't work I'll try compiling with clang instead.

My version is:
x86_64-w64-mingw32-g++.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r2) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[2024-12-19 22:14:19]
seandunaway - Posts: 348
try objdump


% nm example_arm64.dll

example_arm64.dll: no symbols


% objdump -p example_arm64.dll

example_arm64.dll: file format coff-arm64
Characteristics 0x2022
executable
large address aware
DLL

Time/Date Thu Dec 19 14:25:25 2024
Magic 020b (PE32+)
MajorLinkerVersion 14
MinorLinkerVersion 0
SizeOfCode 000000000004e600
SizeOfInitializedData 0000000000010800
SizeOfUninitializedData 0000000000000000
AddressOfEntryPoint 0000000000001cf0
BaseOfCode 0000000000001000
ImageBase 0000000180000000
SectionAlignment 00001000
FileAlignment 00000200
MajorOSystemVersion 6
MinorOSystemVersion 0
MajorImageVersion 0
MinorImageVersion 0
MajorSubsystemVersion 6
MinorSubsystemVersion 0
Win32Version 00000000
SizeOfImage 00069000
SizeOfHeaders 00000400
CheckSum 00000000
Subsystem 00000002 (Windows GUI)
DllCharacteristics 00000160
HIGH_ENTROPY_VA
DYNAMIC_BASE
NX_COMPAT
SizeOfStackReserve 0000000000100000
SizeOfStackCommit 0000000000001000
SizeOfHeapReserve 0000000000100000
SizeOfHeapCommit 0000000000001000
LoaderFlags 00000000
NumberOfRvaAndSizes 00000010

Export Table:
DLL name: example_arm64.dll
Ordinal base: 1
Ordinal RVA Name
1 0x1068 scdll_DLLName
2 0x1060 scdll_DLLVersion
3 0x1074 scsf_example

Date Time Of Last Edit: 2024-12-19 22:29:42
[2024-12-19 23:13:55]
seandunaway - Posts: 348
i switched to clang with xwin (the authentic winsdk), because i had issues getting a debugger to work with mingw's dwarf versus pdb format


sierrachart ?= /opt/sierrachart
xwin ?= /opt/xwin

CXX = clang++
CXXFLAGS += -target $(arch)-pc-windows-msvc -O3 -shared -fuse-ld=lld
CXXFLAGS += $(addprefix -isystem, $(header))
LDFLAGS += $(addprefix -L, $(addsuffix /$(arch), $(library)))

ifndef strip
CXXFLAGS += -O0 -g -fstandalone-debug
endif

header += $(xwin)/splat/crt/include
header += $(shell find $(xwin)/splat/sdk/include -maxdepth 1 -type d)
header += $(sierrachart)/ACS_Source
library += $(xwin)/splat/crt/lib
library += $(shell find $(xwin)/splat/sdk/lib -maxdepth 1 -type d)

src = $(wildcard *.cpp)
aarch64 = $(src:.cpp=_arm64.dll)
x86_64 = $(src:.cpp=_64.dll)

default: aarch64 x86_64
aarch64: $(aarch64)
x86_64: $(x86_64)

%_arm64.dll: arch = aarch64
%_arm64.dll: %.cpp
  $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)

%_64.dll: arch = x86_64
%_64.dll: %.cpp
  $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)

clean:
  rm -f $(aarch64) $(aarch64:.dll=.lib) $(aarch64:.dll=.pdb) $(x86_64) $(x86_64:.dll=.lib) $(x86_64:.dll=.pdb)

.PHONY: default aarch64 x86_64 clean

to install the winsdk:

xwin --accept-license --arch aarch64,x86_64 --cache-dir /opt/xwin --sdk-version 10.0.22621 splat --include-debug-libs --include-debug-symbols
Date Time Of Last Edit: 2024-12-19 23:19:52

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account