Skip to content

[iconv] How to use with vcpkg? vcpkg install iconv then "Could not find a package configuration file" #22539

@SamuelMarks

Description

@SamuelMarks

Library name: iconv
CMake: https://cmake.org/cmake/help/latest/module/FindIconv.html

include(FindIconv) # Attempted without this line also
find_package(iconv CONFIG REQUIRED)

After running this on 371be89:

$ ./vcpkg install libiconv
Computing installation plan...
The following packages will be built and installed:
    libiconv[core]:x64-osx -> 1.16#11
Detecting compiler hash for triplet x64-osx...
Restored 1 packages from .cache/vcpkg/archives in 14.66 ms. Use --debug to see more details.
Starting package 1/1: libiconv:x64-osx
Installing package libiconv[core]:x64-osx...
Elapsed time for package libiconv:x64-osx: 2.29 ms

Total elapsed time: 2.654 s

The package libiconv provides CMake targets:

    find_package(iconv CONFIG REQUIRED)
    target_link_libraries(main PRIVATE Iconv::Charset)

NOTE: I am debugging this issue from Intl in vcpkg:

Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      __nl_find_msg in libintl.a(dcigettext.o)
  "_iconv_open", referenced from:
      __nl_find_msg in libintl.a(dcigettext.o)
  "_libiconv_set_relocation_prefix", referenced from:
      _libintl_set_relocation_prefix in libintl.a(relocatable.o)

Which made me think the wrong libiconv was being found, so I'm trying to explicitly specify the vcpkg one.

Metadata

Metadata

Labels

category:port-bugThe issue is with a library, which is something the port should already support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions