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

[openexr ]openexr/2.5.7: LNK2019 on windows #24559

Closed
domin144 opened this issue Jul 8, 2024 · 2 comments · Fixed by #24563
Closed

[openexr ]openexr/2.5.7: LNK2019 on windows #24559

domin144 opened this issue Jul 8, 2024 · 2 comments · Fixed by #24563
Labels
bug Something isn't working

Comments

@domin144
Copy link

domin144 commented Jul 8, 2024

Description

When using meson (or using pkg-config in any other way) on Windows, openexr libraries cannot be found.
This is caused by openexr.pc and OpenEXR.pc name config on Windows. Linux is not affected.
This is discussed in conan-io/conan#14428
conan-openexr-example.zip

Package and Environment Details

  • Package Name/Version: openexr/2.5.7
  • Operating System+version: Windows 11
  • Compiler+version: Visual Studio C++ 2022
  • Docker image: N/A
  • Conan version: conan 2.5.0
  • Python version: Python 3.12.4

Conan profile

Host profile:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows

Build profile:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows

Steps to reproduce

conan build . --output-folder=builddir --build=missing --settings=build_type=Debug

Logs

Click to expand log
$ conan build . --output-folder=builddir --build=missing --settings=build_type=Debug

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Debug
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.version=193
os=Windows

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows


======== Computing dependency graph ========
Graph root
    conanfile.py: D:\sources\conan-openexr-example\conanfile.py
Requirements
    openexr/2.5.7#12354f9981fb308033eb62df29c29fc8 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Build requirements
    meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19 - Cache
    ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21 - Cache
    pkgconf/2.2.0#6462942a22803086372db44689ba825f - Cache
Resolved version ranges
    meson/[>=1.1.0]: meson/1.2.2
    openexr/[>=2.5.0 <3.0.0]: openexr/2.5.7
    pkgconf/[>=1.9]: pkgconf/2.2.0
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
Requirements
    openexr/2.5.7#12354f9981fb308033eb62df29c29fc8:5768b44d895ee6beaa950668f0d30ea118462c06#7a2325f4a21b078c4e963f0f5fa08ae5 - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:ed44dacde2751b398e4bf9441ff992a70c913c00#7d9791ebc3b359b96f55bdbaec75cccf - Cache
Build requirements
    meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19:da39a3ee5e6b4b0d3255bfef95601890afd80709#97f4a23dd2d942f83e5344b1ca496ce7 - Cache
    ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21:723257509aee8a72faf021920c2874abc738e029#74ebd8f35f54015dcbf2b18a6adbd023 - Cache
    pkgconf/2.2.0#6462942a22803086372db44689ba825f:43771b8671ac44479c188dd72670e2eb2d7918a6#7bf2c1dc194cbb493a2cce6721fb7c01 - Cache

======== Installing packages ========

======== Installing packages ========
ninja/1.11.1: Already installed! (1 of 5)
zlib/1.3.1: Already installed! (2 of 5)
pkgconf/2.2.0: Already installed! (3 of 5)
pkgconf/2.2.0: WARN: The use of 'unix_path_legacy_compat' is deprecated in Conan 2.0 and does not perform path conversions. This is retained for compatibility with Conan 1.x and will be removed in a future version.
meson/1.2.2: Already installed! (4 of 5)
openexr/2.5.7: Already installed! (5 of 5)
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated:     'cpp_info.names' used in: zlib/1.3.1, openexr/2.5.7
WARN: deprecated:     'env_info' used in: pkgconf/2.2.0
WARN: deprecated:     'cpp_info.build_modules' used in: openexr/2.5.7

======== Finalizing install (deploy, generators) ========
conanfile.py: Writing generators to D:\sources\conan-openexr-example\builddir
conanfile.py: Generator 'MesonToolchain' calling 'generate()'
conanfile.py: Generator 'PkgConfigDeps' calling 'generate()'
conanfile.py: Generating aggregated env files
conanfile.py: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat']

======== Calling build() ========
conanfile.py: Calling build()
conanfile.py: Meson configure cmd: meson setup --native-file "D:\sources\conan-openexr-example\builddir\conan_meson_native.ini" "D:\sources\conan-openexr-example\builddir" "D:\sources\conan-openexr-example" --prefix=/
conanfile.py: RUN: meson setup --native-file "D:\sources\conan-openexr-example\builddir\conan_meson_native.ini" "D:\sources\conan-openexr-example\builddir" "D:\sources\conan-openexr-example" --prefix=/
conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.3
[vcvarsall.bat] Environment initialized for: 'x64'
The Meson build system
Version: 1.2.2
Source dir: D:\sources\conan-openexr-example
Build dir: D:\sources\conan-openexr-example\builddir
Build type: native build
Project name: hello
Project version: undefined
C++ compiler for the host machine: cl (msvc 19.38.33135 "Microsoft (R) C/C++ wersja kompilatora optymalizującego 19.38.33135 dla x64")
C++ linker for the host machine: link link 14.38.33135.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: C:/Users/domin144/.conan2/p/pkgcoe905804c6b50c/p/bin/pkgconf.exe (2.2.0)
Run-time dependency openexr found: YES 2.5.7
Build targets in project: 1

hello undefined

  User defined options
    Native files: D:\sources\conan-openexr-example\builddir\conan_meson_native.ini
    prefix      : /

Found ninja-1.11.1 at C:\Users\domin144\.conan2\p\ninjae2ad385cd85df\p\bin\ninja.EXE

conanfile.py: Meson build cmd: meson compile -C "D:\sources\conan-openexr-example\builddir" -j48
conanfile.py: RUN: meson compile -C "D:\sources\conan-openexr-example\builddir" -j48
conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.3
[vcvarsall.bat] Environment initialized for: 'x64'
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: C:\Users\domin144\.conan2\p\ninjae2ad385cd85df\p\bin\ninja.EXE -j 48
[2/2] Linking target hello.exe
FAILED: hello.exe hello.pdb
"link"  /MACHINE:x64 /OUT:hello.exe hello.exe.p/hello.cpp.obj "/nologo" "/release" "/nologo" "/DEBUG" "/PDB:hello.pdb" "C:/Users/domin144/.conan2/p/b/opene0a8b3623efacf/p/lib/Imath-2_5_d.lib" "C:/Users/domin144/.conan2/p/b/opene0a8b3623efacf/p/lib/Half-2_5_d.lib" "C:/Users/domin144/.conan2/p/b/opene0a8b3623efacf/p/lib/IexMath-2_5_d.lib" "C:/Users/domin144/.conan2/p/b/opene0a8b3623efacf/p/lib/IlmThread-2_5_d.lib" "C:/Users/domin144/.conan2/p/b/opene0a8b3623efacf/p/lib/Iex-2_5_d.lib" "C:/Users/domin144/.conan2/p/b/opene0a8b3623efacf/p/lib/IlmImfUtil-2_5_d.lib" "/SUBSYSTEM:CONSOLE" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib"
hello.cpp.obj : error LNK2019: nierozpoznany symbol zewnętrzny "int __cdecl Imf_2_5::globalThreadCount(void)" (?globalThreadCount@Imf_2_5@@YAHXZ) przywołany w funkcji main
hello.cpp.obj : error LNK2019: nierozpoznany symbol zewnętrzny "public: __cdecl Imf_2_5::RgbaOutputFile::RgbaOutputFile(char const * const,int,int,enum Imf_2_5::RgbaChannels,float,class Imath_2_5::Vec2<float>,float,enum Imf_2_5::LineOrder,enum Imf_2_5::Compression,int)" (??0RgbaOutputFile@Imf_2_5@@QEAA@QEBDHHW4RgbaChannels@1@MV?$Vec2@M@Imath_2_5@@MW4LineOrder@1@W4Compression@1@H@Z) przywołany w funkcji main
hello.cpp.obj : error LNK2019: nierozpoznany symbol zewnętrzny "public: virtual __cdecl Imf_2_5::RgbaOutputFile::~RgbaOutputFile(void)" (??1RgbaOutputFile@Imf_2_5@@UEAA@XZ) przywołany w funkcji main
hello.cpp.obj : error LNK2019: nierozpoznany symbol zewnętrzny "public: void __cdecl Imf_2_5::RgbaOutputFile::setFrameBuffer(struct Imf_2_5::Rgba const *,unsigned __int64,unsigned __int64)" (?setFrameBuffer@RgbaOutputFile@Imf_2_5@@QEAAXPEBURgba@2@_K1@Z) przywołany w funkcji main
hello.cpp.obj : error LNK2019: nierozpoznany symbol zewnętrzny "public: void __cdecl Imf_2_5::RgbaOutputFile::writePixels(int)" (?writePixels@RgbaOutputFile@Imf_2_5@@QEAAXH@Z) przywołany w funkcji main
hello.exe : fatal error LNK1120: liczba nierozpoznanych elementów zewnętrznych: 5
ninja: build stopped: subcommand failed.

ERROR: conanfile.py: Error in build() method, line 21
        meson.build()
        ConanException: Error 1 while executing

@domin144 domin144 added the bug Something isn't working label Jul 8, 2024
@SpaceIm
Copy link
Contributor

SpaceIm commented Jul 9, 2024

You can submit a PR for openexr 2.x recipes forcing pkg_config_name of its global cpp_info to some specific value like openexr_conan or openexr_do_not_use which would avoid OpenEXR.pc file of openexr_ilmimf component to be overwritten.

@SpaceIm
Copy link
Contributor

SpaceIm commented Jul 9, 2024

Please give #24563 a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants