Hello.
The common way to link static lib if no pragma {.compile.} is:
$ gcc -c logic.c
$ ar rvs mylib.a logic.o
$ nim c --passL:mylib.a -r calculator.nim
What is a way to link few libs?
And what is a way to link libs that depend on each other. For example: link libA.a that depends on libB.a and libC.a
Thanks.
No, I didn't know about multiple --passL:...
Is it write?
nim c --passL:alib.a.blib.a -r calculator.nim
Need to change?
nim c --passL:alib.a --passL:blib.a -r calculator.nim
Can anyone point out how to link SDL2 statically? I have tried but none compiles succesfully. Thanks actually I am doing something with https://github.com/yglukhov/nimx/issues/218#issuecomment-302429619
nim c -r --threads:on -d:release --passL:sdl2.a test_nimx.nim
nim c -r --threads:on -d:release --passL:libsdl2.a test_nimx.nim
nim c -r --threads:on -d:release --passL:sdl2 test_nimx.nim
nim c -r --threads:on -d:release --passL:libsdl2 test_nimx.nim
Technically, you can also do :
nimble install sdl2#head
which will ignore release tags and fetch latest master.