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

Compile error when using glm module with standard library module. #1260

Open
godxin999 opened this issue Feb 15, 2024 · 0 comments
Open

Compile error when using glm module with standard library module. #1260

godxin999 opened this issue Feb 15, 2024 · 0 comments

Comments

@godxin999
Copy link

I use standard library module std in my opengl project and I ran into a problem. I pick up the necessary part as follows.

import std;
import glm;

int main(int argc, char** argv){
    glm::mat4 matrix(1.0f);
    glm::mat4 matrix2=glm::inverse(matrix);
    return 0;
}

After compiling the code, the compiler told the error message unrecoverable error importing module 'std': symbol 'float_denorm_style' has already been defined.

I use the default glm.cppm file in package and I build my project with xmake. The xmake.lua file is as follows.

add_rules("mode.debug", "mode.release")
set_languages("c++latest")
add_requires("glm 1.0.0")
target("test")
    set_kind("binary")
    set_policy("build.c++.modules", true)
    add_files("src/*.cpp", "src/*.cppm")
    add_packages("glm")

At last there are some details about my environment.

  • The version of glm is 1.0.0
  • The compiler is MSVC\14.37.32822\bin\HostX64\x64\cl.exe
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

No branches or pull requests

1 participant