gvsbuild build librsvg fails #1183
Replies: 2 comments
-
Appologies for the github automatic reformatting of my query, I am new to GitHub and was not aware it would change what I wrote. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all.
I have a problem that has plagued me for several weeks now, and I hoping someone here may give me some guidance on what to try next.
In summary:
Microsoft (R) Program Maintenance Utility Version 14.38.33133.0
Copyright (C) Microsoft Corporation. All rights reserved.
ws2_32.lib /implib:vs17\release\x64\rsvg-2.0.lib -out:vs17\release\x64\rsvg-2.0-vs17.dll /def:vs17\release\x64\librsvg\librsvg.def @C:\Users\fred\AppData\Local\Temp\nmDFC2.tmp
Microsoft (R) Incremental Linker Version 14.38.33133.0
Copyright (C) Microsoft Corporation. All rights reserved.
vs17\release\x64\librsvg_rsvg_dummy.obj
Creating library vs17\release\x64\rsvg-2.0.lib and object vs17\release\x64\rsvg-2.0.exp
librsvg.lib(std-0953e6946d141dd5.std.1acf644841c643e8-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol __imp_NtCreateFile
librsvg.lib(std-0953e6946d141dd5.std.1acf644841c643e8-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol __imp_RtlNtStatusToDosError
librsvg.lib(std-0953e6946d141dd5.std.1acf644841c643e8-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol __imp_NtReadFile
librsvg.lib(std-0953e6946d141dd5.std.1acf644841c643e8-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol __imp_NtWriteFile
vs17\release\x64\rsvg-2.0-vs17.dll : fatal error LNK1120: 4 unresolved externals
NMAKE : fatal error U1077: 'link /DLL /machine:x64 /DEBUG /LTCG /opt:ref /libpath:C:\gtk-build\gtk\x64\release\lib vs17\release\x64\obj\rsvg_c_api\x86_64-pc-windows-msvc\release\librsvg.lib pangocairo-1.0.lib
pango-1.0.lib cairo-gobject.lib gdk_pixbuf-2.0.lib gio-2.0.lib gobject-2.0.lib glib-2.0.lib cairo.lib harfbuzz.lib freetype.lib libxml2.lib intl.lib libxml2.lib advapi32.lib userenv.lib bcrypt.lib ws2_32.lib /implib:vs17\release\x64\rsvg-2.0.lib -out:vs17\release\x64\rsvg-2.0-vs17.dll /def:vs17\release\x64\librsvg\librsvg.def @C:\Users\fred\AppData\Local\Temp\nmDFC2.tmp' : return code '0x460'
Stop.
Traceback (most recent call last):
File "C:\Users\fred.local\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\builder.py", line 524, in build
if self.__build_one(p):
^^^^^^^^^^^^^^^^^^^
File "C:\Users\fred.local\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\builder.py", line 660, in __build_one
skip_deps = proj.build()
^^^^^^^^^^^^
File "C:\Users\fred.local\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\projects\librsvg.py", line 57, in build
self.exec_vs(cmd)
File "C:\Users\fred.local\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\base_project.py", line 194, in exec_vs
self.builder.exec_vs(
File "C:\Users\fred.local\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\builder.py", line 934, in exec_vs
self.__execute(
File "C:\Users\fred.local\pipx\venvs\gvsbuild\Lib\site-packages\gvsbuild\utils\builder.py", line 1036, in __execute
subprocess.check_call(args, cwd=working_dir, env=env, shell=True)
File "C:\Python311\Lib\subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'nmake -f makefile.vc CFG=release PREFIX=C:\gtk-build\gtk\x64\release PYTHON=C:\Users\fred.local\pipx\venvs\gvsbuild\Scripts\python.exe install' returned non-zero exit status 2.
Error: librsvg build failed
Dev environment:
System: Windows 10 Pro, Version 22H2, OS BUild 19045.3803, updated to latest
Visual Studio 2022 (Community) + Windows 10 SDK (10.0.19041.0)
GTK4 installed with gvsbuild and MSVC as recommended in GTK4-rs book
Rust toolchain installed via rustup and set to MSVC as recommended in GTK4-rs book.
Also have the following Windows 10 SDK's installed:
10.0.14393.0
10.0.17134.0
10.0.17763.0
10.0.19041.0
10.0.20348.0
10.0.22000.0
10.0.22621.0
Have also tried:
Some background:
Initially (on Windows) I had installed GTK4 with the MSYS2 and GNU toolchain and all worked fine until I wanted to use the opencv-rs crate (this needs the MSVC toolchain). At this stage one of my apps, a game of Patience (Solitaire) this was using svg format card images and this worked fine with the MSYS2 and GNU toolchain.
When I uninstall the MSYS2+GNU GTK4 installation and install the MSVC toolchain version as described above. The opencv-rs test app worked fine, BUT, re-compiling my Patience app (with svg images) caused it to crash, and, any other apps with buttons using icons (eg: "edit-undo-symbolic") now display the missing icon error symbol.
I have converted all my svg card images to jpg and now the Patience app works OK except for the broken icon issue, therefore my persistant attempts to build the librsvg library.
Oh, by the way, compiling these apps on the Ubuntu (23.04) system has not had any issues or problems with svg images, button icons or opencv-rs.
I have spend much time searching the web for a solution, uninstalling and reinstalling, uninstalling unused apps, removed WSL (+Debian) from pc, even found one reference to the same error message that indicated that it may be caused by previously having the GNU toolchain installed but that didn't provide a solution. Have cleaned up the ENV variables including PATH.
I am NOT a professional programmer but have been a "user" since buying my 1st PC in 1985 and am mostly self taught other than some entry level programming at uni in the mid 1980's.
I searched for "__imp_NtCreateFile" which produced a lot of results, all basically said:
https://learn.microsoft.com/en-us/windows/win32/devnotes/calling-internal-apis
which basically states "If you do use these functions, you can access them through run-time dynamic linking using LoadLibrary and GetProcAddress."
Beta Was this translation helpful? Give feedback.
All reactions