Skip to content

Zig C++ SFML compiler error #24532

@Renan2010

Description

@Renan2010

Zig Version

0.15.0-dev.1092+d772c0627

Steps to Reproduce and Observed Behavior

I was testing zig's C/C++ compiler and came across this while testing SFML compiling with zig c++

[renan@archlinux src]$ zig c++ main.cpp -lsfml-graphics -lsfml-window -lsfml-system
ld.lld: error: undefined symbol: sf::String::String(char const*, std::__1::locale const&)
>>> referenced by main.cpp:4
>>>               /home/renan/.cache/zig/o/2ad3e6bad8e90685910a7784ec2a6749/main.o:(main)

main.cpp

#include <SFML/Graphics.hpp>

int main() {
  sf::RenderWindow window(sf::VideoMode({800, 600}), "SFML window");

  while (const std::optional event = window.pollEvent()) {
    if (event->is<sf::Event::Closed>())
      window.close();
    window.clear();
    window.display();
  }
}

But if it is in g++ it compiles normally and in clang++ it also compiles normally

Expected Behavior

[renan@archlinux src]$ g++ main.cpp -lsfml-graphics -lsfml-window -lsfml-system
[renan@archlinux src]$

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions