Cannot link to built Vala shared library when using MSVC
See original GitHub issueDescribe the bug
Linking with a Vala shared library fails when using MSVC on Windows. The problem I think is that the import library for the dll isn’t generated. Positional arguments like implib
or export_dynamic
aren’t supported with *library()
, but I think this should be done automatically. link
gives an error like cannot open input file lib\valalib.lib
[1/1] Linking target prog/valaprog.exe
FAILED: prog/valaprog.exe prog/valaprog.pdb
"link" /MACHINE:x64 /OUT:prog/valaprog.exe prog/valaprog.exe.p/meson-generated_prog.c.obj "/nologo" "/release" "/nologo" "/DEBUG" "/PDB:prog\valaprog.pdb" "lib\valalib.lib" "C:/lib/glib-2.0.lib" "C:/lib/intl.lib" "/LIBPATH:C://lib" "ws2_32.lib" "winmm.lib" "C:/lib/gobject-2.0.lib" "C:/lib/ffi.lib" "/LIBPATH:C://lib" "ws2_32.lib" "winmm.lib" "/SUBSYSTEM:CONSOLE" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib"
LINK : fatal error LNK1181: cannot open input file 'lib\valalib.lib'
ninja: build stopped: subcommand failed.
To Reproduce
Just run test case vala\7 shared library
on Windows using cl
for C compiler and link
for linker.
Expected behavior Linking with a Vala built shared library should work.
system parameters
- this is not a cross build
- OS: Windows 10
- Python 3.9.4
- Meson 0.57.2
- Ninja 1.10.2
cl.exe
msvc 19.29.30031 “Microsoft ® C/C++ Optimizing Compiler Version 19.29.30031 for x64”link.exe
14.29.30031.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Getting CMake to build shared library for MSVC - Stack Overflow
I keep getting the following message when I try to build. LINK : fatal error LNK1104: cannot open file 'Debug\MyLibrary.lib' [C:\sandbox\ ...
Read more >VS 2017 cannot find my shared library even though I tell it ...
My solution contains one shared library (.dll) and two unit test programs (.exe). The .dll compiles and links without errors. The first unit...
Read more >FAQ - The Meson Build system
My project works fine on Linux and MinGW but fails to link with MSVC due to a missing .lib file (fatal error LNK1181)....
Read more >Linking with library not working with Meson - GitLab - GNOME
The problem is with your meson.build. probably something like using link_with with a shared library instead of using dependencies and defining a ...
Read more >Untitled
Use the tickets linked to CPP-494 to leave your feedback and vote for the ... 2. ninja -C build meson install -C build...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Basically a duplicate of #2132 I think.
https://gitlab.gnome.org/GNOME/vala/-/merge_requests/178
closing