If you see a linker error like "export ordinal too large: 73832" (or similar) when running cargo test or cargo build in the onchain workspace, you are hitting a Windows PE export table limit when using the GNU toolchain (MinGW). The combined dependency tree (soroban-sdk, stellar-*, crypto libs) exports more than 65,535 symbols, which MinGW's linker cannot handle.
Keep the GNU toolchain and build only the contract WASM on Windows. Run tests in WSL or rely on CI (e.g. GitHub Actions).
rustup target add wasm32-unknown-unknownFrom the repo root:
.\scripts\migrations\build_wasm_only.ps1Or manually:
cd onchain\contracts\stello_pay_contract
cargo build -p stello_pay_contract --target wasm32-unknown-unknown --releaseThe built WASM is at:
onchain\contracts\stello_pay_contract\target\wasm32-unknown-unknown\release\stello_pay_contract.wasm
- WSL: Open the repo in WSL and run
cargo testfromonchain/contracts/stello_pay_contract(or use./scripts/migrations/run_migration_tests.shfrom the repo root in WSL). - CI: GitHub Actions (and other Linux/macOS CI) run the full test suite; no extra steps on your side.
If you prefer to run cargo test and stellar contract build directly on Windows without WSL:
- Install Visual Studio Build Tools with the "Desktop development with C++" workload.
- Switch to the MSVC toolchain:
rustup default stable-x86_64-pc-windows-msvc rustup target add wasm32-unknown-unknown
- From
onchain\contracts\stello_pay_contract:cargo testandstellar contract buildwill then work.
| Goal | Option B (GNU + WASM only) | Option A (MSVC) |
|---|---|---|
| Build contract WASM | Yes (script or wasm target) | Yes |
Run cargo test locally |
WSL or CI | Yes, on Windows |
| No VS Build Tools | Yes | No (required for MSVC) |