-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not use link.exe to link static/shared libraries on windows #19033
Comments
related problem: https://forum.nim-lang.org/t/341 |
Thanks, I use nim c --cc:vcc -d:release --nimcache:build\.gens\test\windows\x64\release\nimcache --passL:-link --passL:-libpath:build\windows\x64\release --passL:foo.lib -o:build\windows\x64\release\test.exe src\main.nim I can finally let xmake support building nim projects on windows, thank you very much. @geekrelief $ xmake -v
[ 33%]: linking.release foo.lib
"C:\\Program Files\\nim-1.6.0\\bin\\nim" c --cc:vcc -d:release --nimcache:build\.gens\foo\windows\x64\release\nimcache --app:staticlib --noMain --passC:-DNimMain=NimMain_2D68A01A --passC:-DNimMainInne
r=NimMainInner_2D68A01A --passC:-DNimMainModule=NimMainModule_2D68A01A --passC:-DPreMain=PreMain_2D68A01A --passC:-DPreMainInner=PreMainInner_2D68A01A -o:build\windows\x64\release\foo.lib src\foo.nim
[ 66%]: linking.release test.exe
"C:\\Program Files\\nim-1.6.0\\bin\\nim" c --cc:vcc -d:release --nimcache:build\.gens\test\windows\x64\release\nimcache --passL:-link --passL:-libpath:build\windows\x64\release --passL:foo.lib -o:buil
d\windows\x64\release\test.exe src\main.nim
[100%]: build ok! However, I think nim should be able to handle link flags better and pass them automatically to link.exe instead of cl.exe |
FYI, I tested this on Windows 10, nim devel (1.7.1) with Visual Studio 2019, and I was able to compile with a single exec &"nim c --passL:\"/link /libpath:samples /libpath:samples/plugins\" {settings.join(\" \")} {nimFilePath}" where |
ok, thanks. |
I set
--cc:vcc
to build and link nim program on windows 10, but I cannot pass--passL:-libpath:xxx
to nim to link library.-libpath:
and-lfoo
seems to be passed into cl.exe and cl.exe ignored them.and nim cannot use link.exe to link them. it always call vccexe.exe to link objects and libraries.
verbose output
The text was updated successfully, but these errors were encountered: