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

[package] glew/2.2.0: The GLEW library #26677

Open
rudolfheszele opened this issue Feb 22, 2025 · 2 comments
Open

[package] glew/2.2.0: The GLEW library #26677

rudolfheszele opened this issue Feb 22, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@rudolfheszele
Copy link
Contributor

Description

Looks like the package cannot be built on Windows using clang.
Here is the profile I am using:

[settings]
arch=x86_64
build_type=Debug
compiler=clang
compiler.cppstd=20
compiler.version=19
compiler.libcxx=libstdc++11
os=Windows

[buildenv]
CC=clang
CXX=clang++

[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_EXPORT_COMPILE_COMMANDS': '1'}
tools.build:compiler_executables={'c': 'clang', 'cpp': 'clang++'}

When invoking conan install wirth --build=missing is start building glew, but it fails with the following error message:

glew/2.2.0: RUN: cmake --build "C:\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\build\Debug" -- -j16
[1/6] Building RC object CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res
FAILED: CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_llvm_rc C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res.pp C:\PROGRA~1\LLVM\bin\clang.exe -DGLEW_BUILD -DGLEW_NO_GLU -Dglew_EXPORTS -DRC_INVOKED -I C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/cmake/../../include  -MD -MF CMakeFiles\glew.dir\C_\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\src\build\glew.rc.res.d -x c -E -- C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc ++ C:\PROGRA~1\LLVM\bin\llvm-rc.exe -DGLEW_BUILD -DGLEW_NO_GLU -Dglew_EXPORTS -I SOURCE_DIR -I C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/cmake/../../include  -MD -MF CMakeFiles\glew.dir\C_\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\src\build\glew.rc.res.d /fo CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res.pp
llvm-rc: Error in VERSIONINFO statement (ID 1):
Non-ASCII 8-bit codepoint (�) can't be interpreted in the current codepage
[2/6] Building RC object CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res
FAILED: CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_llvm_rc C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res.pp C:\PROGRA~1\LLVM\bin\clang.exe -DGLEW_NO_GLU -DGLEW_STATIC -DRC_INVOKED -I C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/cmake/../../include  -MD -MF CMakeFiles\glew_s.dir\C_\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\src\build\glew.rc.res.d -x c -E -- C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc ++ C:\PROGRA~1\LLVM\bin\llvm-rc.exe -DGLEW_NO_GLU -DGLEW_STATIC -I SOURCE_DIR -I C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/cmake/../../include  -MD -MF CMakeFiles\glew_s.dir\C_\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\src\build\glew.rc.res.d /fo CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res.pp
llvm-rc: Error in VERSIONINFO statement (ID 1):
Non-ASCII 8-bit codepoint (�) can't be interpreted in the current codepage
[4/6] Building C object CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/src/glew.c.obj
ninja: build stopped: subcommand failed.

I think it is actually an issue with the CMakeLists.txt file in the original repository, since it always includes .rc files on Windows, and probably they should only be included with MSVC. I did a quick test locally and then it worked with clang if those .rc files were not included.

Package and Environment Details

  • Package Name/Version: glew/2.2.0
  • Operating System+version: Windows 11
  • Compiler+version: Clang 19.1.7
  • Docker image: NA
  • Conan version: conan 2.12.2
  • Python version: Python 3.13.2

Conan profile

[settings]
arch=x86_64
build_type=Debug
compiler=clang
compiler.cppstd=20
compiler.version=19
compiler.libcxx=libstdc++11
os=Windows

[buildenv]
CC=clang
CXX=clang++

[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_EXPORT_COMPILE_COMMANDS': '1'}
tools.build:compiler_executables={'c': 'clang', 'cpp': 'clang++'}

Steps to reproduce

See description

Logs

conan install . --profile clang-debug --build=missing              

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Debug
compiler=clang
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=19
os=Windows
[conf]
tools.build:compiler_executables={'c': 'clang', 'cpp': 'clang++'}
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_EXPORT_COMPILE_COMMANDS': '1'}
tools.cmake.cmaketoolchain:generator=Ninja
[buildenv]
CC=clang
CXX=clang++

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


======== Computing dependency graph ========
Graph root
    conanfile.txt: C:\Coding\Cpp\gl-renderer\conanfile.txt
Requirements
    bshoshany-thread-pool/4.1.0#be1802a8768416a6c9b1393cf0ce5e9c - Cache
    catch2/3.7.1#431d772165ed0bc5adaabaa44a9f53ca - Cache
    glew/2.2.0#162c9c4b82b196eed6de22764f658d87 - Cache
    glfw/3.3.8#56dd8fa2a72771171337cd05fded7862 - Cache
    glm/cci.20230113#c9c89bea128786a245028f0cb4c1936d - Cache
    glu/system#a5189f60c8270ac97ed29d7f36fffe39 - Cache
    opengl/system#7c02ea6ef926fd04844af53622a30541 - Cache

======== Computing necessary packages ========
Connecting to remote 'conancenter' anonymously
Requirements
    bshoshany-thread-pool/4.1.0#be1802a8768416a6c9b1393cf0ce5e9c:da39a3ee5e6b4b0d3255bfef95601890afd80709#926e3cbca7bb241850fe1b58c146ba2c - Cache
    catch2/3.7.1#431d772165ed0bc5adaabaa44a9f53ca:6b55d1db5a0675d0d3b1e0820ee977f6386bd496#eed70c7739a0fb27a3ee98804fe61110 - Cache
    glew/2.2.0#162c9c4b82b196eed6de22764f658d87:6b1e416095906558db528ba0a58ec551954f3934 - Build
    glfw/3.3.8#56dd8fa2a72771171337cd05fded7862:fedceaab3413fb33763d2361fa43d6eaaa2a908d#050dcb0dfbaff09e6df30e05d1c207b0 - Cache
    glm/cci.20230113#c9c89bea128786a245028f0cb4c1936d:da39a3ee5e6b4b0d3255bfef95601890afd80709#6e0f3e7e82ccc211e8cc3c012d8c42ef - Cache
    glu/system#a5189f60c8270ac97ed29d7f36fffe39:da39a3ee5e6b4b0d3255bfef95601890afd80709#0ba8627bd47edc3a501e8f0eb9a79e5e - Cache
    opengl/system#7c02ea6ef926fd04844af53622a30541:da39a3ee5e6b4b0d3255bfef95601890afd80709#0ba8627bd47edc3a501e8f0eb9a79e5e - Cache

======== Installing packages ========
bshoshany-thread-pool/4.1.0: Already installed! (1 of 7)
catch2/3.7.1: Already installed! (2 of 7)
glm/cci.20230113: Already installed! (3 of 7)
opengl/system: Already installed! (4 of 7)
glfw/3.3.8: Already installed! (5 of 7)
glu/system: Already installed! (6 of 7)

-------- Installing package glew/2.2.0 (7 of 7) --------
glew/2.2.0: Building from source
glew/2.2.0: Package glew/2.2.0:6b1e416095906558db528ba0a58ec551954f3934
glew/2.2.0: Copying sources to build folder
glew/2.2.0: Building your package in C:\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b
glew/2.2.0: Calling generate()
glew/2.2.0: Generators folder: C:\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\build\Debug\generators
glew/2.2.0: CMakeToolchain generated: conan_toolchain.cmake
glew/2.2.0: CMakeToolchain generated: C:\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\build\Debug\generators\CMakePresets.json
glew/2.2.0: Generating aggregated env files
glew/2.2.0: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat']
glew/2.2.0: Calling build()
glew/2.2.0: Apply patch (conan): Fix CMake: cmake_minimum_required() before project()
glew/2.2.0: Running CMake.configure()
glew/2.2.0: RUN: cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Debug" "C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/cmake"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- Using Conan toolchain: C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/build/Debug/generators/conan_toolchain.cmake
-- Conan toolchain: Defining architecture flag: -m64
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The C compiler identification is Clang 19.1.7 with GNU-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found OpenGL: opengl32
-- Configuring done (0.8s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/build/Debug

glew/2.2.0: Running CMake.build()
glew/2.2.0: RUN: cmake --build "C:\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\build\Debug" -- -j16
[1/6] Building RC object CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res
FAILED: CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_llvm_rc C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res.pp C:\PROGRA~1\LLVM\bin\clang.exe -DGLEW_BUILD -DGLEW_NO_GLU -Dglew_EXPORTS -DRC_INVOKED -I C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/cmake/../../include  -MD -MF CMakeFiles\glew.dir\C_\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\src\build\glew.rc.res.d -x c -E -- C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc ++ C:\PROGRA~1\LLVM\bin\llvm-rc.exe -DGLEW_BUILD -DGLEW_NO_GLU -Dglew_EXPORTS -I SOURCE_DIR -I C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/cmake/../../include  -MD -MF CMakeFiles\glew.dir\C_\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\src\build\glew.rc.res.d /fo CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res.pp
llvm-rc: Error in VERSIONINFO statement (ID 1):
Non-ASCII 8-bit codepoint (�) can't be interpreted in the current codepage
[2/6] Building RC object CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res
FAILED: CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_llvm_rc C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res.pp C:\PROGRA~1\LLVM\bin\clang.exe -DGLEW_NO_GLU -DGLEW_STATIC -DRC_INVOKED -I C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/cmake/../../include  -MD -MF CMakeFiles\glew_s.dir\C_\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\src\build\glew.rc.res.d -x c -E -- C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc ++ C:\PROGRA~1\LLVM\bin\llvm-rc.exe -DGLEW_NO_GLU -DGLEW_STATIC -I SOURCE_DIR -I C:/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/cmake/../../include  -MD -MF CMakeFiles\glew_s.dir\C_\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\src\build\glew.rc.res.d /fo CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res CMakeFiles/glew_s.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/build/glew.rc.res.pp
llvm-rc: Error in VERSIONINFO statement (ID 1):
Non-ASCII 8-bit codepoint (�) can't be interpreted in the current codepage
[4/6] Building C object CMakeFiles/glew.dir/C_/Users/rudol/.conan2/p/b/glew63c7a5ae9d532/b/src/src/glew.c.obj
ninja: build stopped: subcommand failed.

glew/2.2.0: ERROR:
Package '6b1e416095906558db528ba0a58ec551954f3934' build failed
glew/2.2.0: WARN: Build folder C:\Users\rudol\.conan2\p\b\glew63c7a5ae9d532\b\build\Debug
ERROR: glew/2.2.0: Error in build() method, line 80
        cmake.build()
        ConanException: Error 1 while executing
@rudolfheszele rudolfheszele added the bug Something isn't working label Feb 22, 2025
@rudolfheszele
Copy link
Contributor Author

I made a pull request on the glew repository with the proposed fix: nigels-com/glew#428

@jcar87
Copy link
Contributor

jcar87 commented Feb 26, 2025

Hi @rudolfheszele - thanks so much for opening this issue and even more so for reaching out to upstream.

However, I can see that CMake is correctly using llvm-rc to process the file - I think the logic in is perfectly valid if CMake knows to redirect the compilation to the resource compiler regardless of the compiler.

The issue seems similar to this: curl/curl#7765 , where it has issues with the unicode copyright character

            VALUE "LegalCopyright", "� 2002-2019 Nigel Stewart & Milan Ikits & Marcelo Magallon\0"

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

No branches or pull requests

2 participants