Skip to content
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

[bug] Error LNK1104 cannot open file 'CONAN_LIB::libpng_libpng16d_DEBUG.lib' #12818

Open
sinall opened this issue Jan 1, 2023 · 4 comments
Open
Assignees

Comments

@sinall
Copy link

sinall commented Jan 1, 2023

Environment details

  • Operating System+version: Windows11
  • Compiler+version: VC++2022
  • Conan version: 1.50.0 & 1.56.0
  • Python version: 3.9.13

Profile:

[settings]
arch=x86_64
build_type=Debug
compiler=Visual Studio
compiler.runtime=MDd
compiler.version=17
os=Windows
os_build=Windows
arch_build=x86_64
[options]
[conf]
[build_requires]
[env]

conanfile.py:

from conans import ConanFile
import os

class MyConan(ConanFile):
	settings = "os", "compiler", "build_type", "arch"

	requires = (
		"openssl/1.1.1d",
		"boost/1.76.0",
		"di/1.2.0",
		"cpprestsdk/2.10.18",
		"soci/4.0.2",
		"sqlcipher/4.3.0",
		"libzip/1.7.3",
		"libzippp/4.0",
		"bzip2/1.0.8",
		"zlib/1.2.11",
		"zstd/1.4.3",
		"ms-gsl/3.0.1",
		"tesseract/4.1.1",
		"xz_utils/5.2.4",
		"cryptopp/8.5.0",
		"opencv/4.5.2",
		"libwebp/1.1.0",
		"qt/5.15.2",
		"libjpeg/9e",
		"libpng/1.6.38",
		"libtiff/4.4.0",
		"sqlite3/3.39.2",
	)

	generators = "MSBuildDeps"

	default_options = (
		"boost:without_python=False",
		"boost:python_executable=" + os.path.join(os.path.dirname(__file__), "../../packages/Python/Python38/python.exe"),
		"boost:python_version=3.8",
		"soci:with_sqlite3=True",
		"libzip:shared=True",
		"libzippp:with_encryption=True",
	)

	def imports(self):
		dst = os.path.join("..", "..")
		if self.settings.arch == "x86_64":
			dst = os.path.join(dst, "x64")
		dst = os.path.join(dst, str(self.settings.build_type))
		self.copy("*.dll", dst, "bin", excludes=("libEGL*.dll", "libGLESv2*.dll"))

Steps to reproduce

  1. Add qt/6.4.1 as requires in conanfile.py
  2. QT Versions set 6.4.1-Debug => D:\.conan\3d5de2\1
  3. C:\Users\myname\AppData\Local\QtMsBuild\Qt.props in Property Manager
  4. Add conanbuildinfo.props in Property Manager
  5. Build project in VS

Logs

qtvars_x64_Debug.props:

<Qt_LIBS_>D:\.conan\3d5de2\1\res\archdatadir\plugins\styles\qwindowsvistastyled.lib;D:\.conan\3d5de2\1\lib\objects-Debug\QWindowsIntegrationPlugin_resources_1\.rcc\qrc_openglblacklists.cpp.obj;D:\.conan\3d5de2\1\lib\objects-Debug\QWindowsIntegrationPlugin_resources_2\.rcc\qrc_cursors.cpp.obj;D:\.conan\3d5de2\1\res\archdatadir\plugins\platforms\qwindowsd.lib;imm32.lib;oleaut32.lib;shlwapi.lib;winspool.lib;wtsapi32.lib;shcore.lib;comdlg32.lib;d3d9.lib;D:\.conan\3d5de2\1\lib\Qt6OpenGLd.lib;D:\.conan\3d5de2\1\res\archdatadir\plugins\imageformats\qgifd.lib;D:\.conan\3d5de2\1\res\archdatadir\plugins\imageformats\qicod.lib;D:\.conan\3d5de2\1\lib\objects-Debug\Widgets_resources_1\.rcc\qrc_qstyle.cpp.obj;D:\.conan\3d5de2\1\lib\objects-Debug\Widgets_resources_2\.rcc\qrc_qstyle1.cpp.obj;D:\.conan\3d5de2\1\lib\objects-Debug\Widgets_resources_3\.rcc\qrc_qmessagebox.cpp.obj;D:\.conan\3d5de2\1\lib\Qt6Widgetsd.lib;dwmapi.lib;uxtheme.lib;D:\.conan\3d5de2\1\lib\objects-Debug\Gui_resources_1\.rcc\qrc_qpdf.cpp.obj;D:\.conan\3d5de2\1\lib\objects-Debug\Gui_resources_2\.rcc\qrc_gui_shaders.cpp.obj;D:\.conan\3d5de2\1\lib\Qt6Guid.lib;d3d11.lib;dxgi.lib;dxguid.lib;gdi32.lib;CONAN_LIB::libpng_libpng16d_DEBUG.lib;harfbuzz.lib;Gdi32.lib;RpcRT4.lib;USP10.lib;freetyped.lib;libpng16d.lib;zlib.lib;bz2.lib;brotlicommon-static.lib;brotlidec-static.lib;brotlienc-static.lib;glib-2.0.lib;WS2_32.lib;Ole32.lib;User32.lib;AdvAPI32.lib;pcre2-8-staticd.lib;pcre2-posix-staticd.lib;pcre2-16-staticd.lib;pcre2-32-staticd.lib;gnuintl.lib;iconv.lib;charset.lib;gmodule-2.0.lib;gobject-2.0.lib;libffi.lib;gthread-2.0.lib;gio-2.0.lib;iphlpapi.lib;DnsAPI.lib;ShLwApi.lib;CONAN_LIB::md4c_md4c_md4c_md4c_DEBUG.lib;CONAN_LIB::freetype_freetyped_DEBUG.lib;d2d1.lib;dwrite.lib;D:\.conan\3d5de2\1\lib\Qt6Cored.lib;CONAN_LIB::zlib_zlib_DEBUG.lib;synchronization.lib;mpr.lib;userenv.lib;advapi32.lib;authz.lib;kernel32.lib;netapi32.lib;ole32.lib;shell32.lib;user32.lib;uuid.lib;version.lib;winmm.lib;ws2_32.lib;CONAN_LIB::double-conversion_double-conversion_DEBUG.lib;runtimeobject.lib;CONAN_LIB::pcre2_PCRE2_16BIT_pcre2-16-staticd_DEBUG.lib;D:\.conan\3d5de2\1\lib\Qt6EntryPointd.lib;shell32.lib</Qt_LIBS_>
@memsharded
Copy link
Member

Hi @sinall

It seems you are using the legacy integrations, visual_studio (as it is generating the conanbuildinfo.props file).
There are new, modern integrations that are more powerful, complete and maintained and they will be maintained in Conan 2.0 (already in beta.7, will be final very soon), while the other generators will be removed. I suggest to update to use the new MSBuildDeps, MSBuildToolchain and MSBuild from: https://docs.conan.io/en/latest/reference/conanfile/tools.html

@sinall
Copy link
Author

sinall commented Jan 2, 2023

After I switch to generators = "MSBuildDeps", the problem still exists:

image

@memsharded
Copy link
Member

It seems that we would need more information, apparently it is missing the necessary build_type. Please provide:

  • The necessary conanfile you are using
  • The exact commands you are using to install the Conan dependencies, and the output when installing them
  • What is the Qt.props file? It seems this one is not generated by Conan?
  • What is the qtvars_x64_Debug.props file? I am not sure that is the correct filename generated by MSBuildDeps generator?

This could be a recipe issue as well, that the Qt recipe in ConanCenter has something that makes it not work for the MSBuild integration, but we would need more information to understand the issue better.

@sinall
Copy link
Author

sinall commented Jan 2, 2023

It seems that we would need more information, apparently it is missing the necessary build_type. Please provide:

  • The necessary conanfile you are using
  • The exact commands you are using to install the Conan dependencies, and the output when installing them
  • What is the Qt.props file? It seems this one is not generated by Conan?
  • What is the qtvars_x64_Debug.props file? I am not sure that is the correct filename generated by MSBuildDeps generator?

This could be a recipe issue as well, that the Qt recipe in ConanCenter has something that makes it not work for the MSBuild integration, but we would need more information to understand the issue better.

I have updated the topic body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants