Skip to content

Conversation

@rudolfheszele
Copy link

I noticed that the CMake build does not work on Widows, using clang. The error message was complaining about .rc files. I changed the CMakeLists.txt file, to only include those files with MSVC, and then it worked.

@jcar87
Copy link

jcar87 commented Feb 26, 2025

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"

I suspect here:

glew/auto/src/glew.rc

Lines 123 to 124 in 9fb23c3

VALUE "LegalCopyright", "© 2002-2019 Nigel Stewart & Milan Ikits & Marcelo Magallon\0"
VALUE "LegalTrademarks", "\0"
-
it could either be replaced with (c), or a escaped unicode character with L"" by the looks of it.

@rudolfheszele
Copy link
Author

I can confirm, that changing the .rc files solves the issue. Looks like the .rc files have been updated in the repo in commit 35d928bc77cc5d9515f06ca27ac6f86c0298feba (Fixed failing build on Windows when using LLVM). It was committed on 20 Feb 2022, but the latest release is from 10 Jan 2021.
So probably a new release would fix the issue.

@nigels-com nigels-com requested a review from Copilot April 13, 2025 12:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@rudolfheszele
Copy link
Author

Sorry for disappearing. Is there any chance for a new release with this fix included?

@ghost
Copy link

ghost commented Sep 8, 2025

I encountered the same problem.

DEV ENV
compiler: llvm (clang/clang++) v20.1.6 
std (headers): mingw v15.1.0
terminal: windows terminal
project generator: cmake  v4.0.2
build system: ninja v1.12.1
shell: pwsh v7.5.1
package manager: scoop
machine: windows 10

steps to replicate

  1. git clone https://github.com/nigels-com/glew.git
  2. cd to project directory
  3. cd to build directory
  4. cmake build
cmake -S .\cmake -B build -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_C_COMPILER_TARGET=x86_64-windows_gnu -DCMAKE_CXX_COMPILER_TARGET=x86_64-windows_gnu -DCMAKE_POLICY_VERSION_MINIMUM="3.5" -DCMAKE_BUILD_TYPE=Debug && ninja -C build

gives me error such as

CMake Error at CMakeLists.txt:114 (add_library):
  Cannot find source file: 

I tried this solution and this doesn't seem work. (errors is more of missing headers and source files) by looking at auto directory this is likely to be solve by running make -C auto

@nigels-com
is there a reason for not doing this inside cmake ?

@rudolfheszele
assuming this will be under native windows only (no msys) like mine, this likely wouldn't work either

doing make -C auto gives me error

process_begin: CreateProcess(NULL, touch OpenGL-Registry/.dummy, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:97: OpenGL-Registry/.dummy] Error 2

I think this is more of issue#363

I resolve it by building it from the release snapshot reference

  1. download release snapshot
  2. extract (tgz, zip)
  3. cd to project directory
  4. cd to build directory
cmake -S .\cmake -B build -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_C_COMPILER_TARGET=x86_64-windows_gnu -DCMAKE_CXX_COMPILER_TARGET=x86_64-windows_gnu -DCMAKE_POLICY_VERSION_MINIMUM="3.5" -DCMAKE_BUILD_TYPE=Debug && ninja -C build

p.s. adjust the build script accordingly

@ghost
Copy link

ghost commented Sep 8, 2025

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"

I suspect here:

glew/auto/src/glew.rc

Lines 123 to 124 in 9fb23c3

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

it could either be replaced with (c), or a escaped unicode character with L"" by the looks of it.

I think this is more of issue#363

@nigels-com
Copy link
Owner

CMake Error at CMakeLists.txt:114 (add_library):
  Cannot find source file: 

I tried this solution and this doesn't seem work. (errors is more of missing headers and source files) by looking at auto directory this is likely to be solve by running make -C auto

@nigels-com is there a reason for not doing this inside cmake ?

The main reason is that the cmake setup is more portable (including MS Visual Studio or macOS XCode for example) than the GNU make, perl, bash setup for generating the GLEW sources. Over the years there has been the idea of migrating all the code generation to python, but a lack of progress.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants