resolve linker errors #15
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi all,
I'm John Duffie and have worked with Sam Hatchett. I wanted to run the tool to generate some simulated data but was unable to get it to compile. Below is the auto-generated PR. I ran the builds from within a docker container based on debian:bookworm-slim. I can pass the Dockerfile along if interested.
Fix linker errors and build dependencies for EPANET-MSX
Summary
This PR resolves multiple definition linker errors and missing library dependencies that prevented successful compilation of EPANET-MSX, enabling the full build process to complete successfully.
Changes Made
1. Fixed Multiple Definition Linker Errors in MSX Core
MSXgetPipeRates,MSXgetTankRates, etc.) were declared withoutexterninmsxfuncs.h, causing multiple definitions across source filesexternkeyword to function pointer declarations inMSX Core/src/msxfuncs.h(lines 21-26)MSX Core/src/msxfuncs.c(lines 38-43)2. Fixed Math Library Linking in Legacy DLL
sin,cos,exp,log, etc. on Linux builds-lm(math library) totarget_link_librariesfor non-MSVC builds inLegacy DLL/CMakeLists.txt(line 58)3. Enabled docker_embedded_build.sh Script
cmake ..andcmake --build . --config Releasecommands (lines 7-8)Build Verification
All modules now build successfully using Docker:
libmsxcore.soandlibmsxcore_lib.aliblegacymsx.solibexamples.sorunepanetmsxexecutableTest Plan
build.shscriptdocker_embedded_build.shBackward Compatibility
These changes maintain full backward compatibility:
Related Issues
Fixes build failures that prevented compilation on Linux systems with recent GCC versions.
This PR description summarizes the key technical fixes needed to resolve the build errors and demonstrates that all components now build successfully.