https://github.com/soratenshi/zig-odin-interop-static
Just a PoC to interop a statically compiled Odin library from within Zig.
https://github.com/soratenshi/zig-odin-interop-static
language-interoperability static-linking
Last synced: 11 months ago
JSON representation
Just a PoC to interop a statically compiled Odin library from within Zig.
- Host: GitHub
- URL: https://github.com/soratenshi/zig-odin-interop-static
- Owner: SoraTenshi
- License: mit
- Created: 2024-02-09T21:26:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-15T23:58:55.000Z (over 1 year ago)
- Last Synced: 2025-04-10T23:28:28.553Z (11 months ago)
- Topics: language-interoperability, static-linking
- Language: Zig
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zig-odin-interop
Just an attempt to get Zig to call Odin code via static linking.
Oh and this is supposed to work for Windows. I am pretty sure that linux just works as fine, if you adjust the object filename in the `build.zig`
### Disclaimer:
For some reason, `fmt.println` call is not really... liked? as in: it doesn't work with it.
I am unsure whether it's because of the context or because of what the `fmt.println` call does, but yeah generally this works *fine*.
## Usage:
To compile the Odin obj file:
```sh
odin build from.odin -build-mode:obj -target:windows_amd64 -no-entry-point -file
```
and then just:
```sh
zig build
```