Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - shvp

Pages: [1]
1
I really appreciate your help! I managed to create a window.
So I'm still using g++. What does a trick:

 
                ...
                "-L",
                "/usr/local/lib",
                "-lsfml-system",
                "-lsfml-window",
                "-lsfml-graphics",
                "-lsfml-network",
                "-lsfml-audio",
                 ...

+ moved FLAC, freestyle, freestyle folders and other ext dependencies from arm64 snapshot you posted to /Library/Framework
Cheers!

2
when building SFML yourself, to set the architecture to arm64.

So dylib I built showing:
DG@MBP-SHVP lib % file libsfml-audio.3.0.0.dylib
libsfml-audio.3.0.0.dylib: Mach-O 64-bit dynamically linked shared library arm64

I'll try snapshot anyways. Thanks!


3
I would really appreciate any help with that. That code is simple as it can be
#include <SFML/Window.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "My window");
}

The setup is VS Code & C/C++ Extension v1.9.5
g++ --version
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: arm64-apple-darwin21.2.0

Full error message goes like this:
> Executing task: Start Build <

Starting build...
/usr/bin/g++ -fdiagnostics-color=always -I /usr/local/include -L /Users/DG/cppurgatory/SFML_repo/lib -g /Users/DG/cppurgatory/helloworld/*.cpp -o /Users/DG/cppurgatory/helloworld/bin/run -std=c++17
Undefined symbols for architecture arm64:
  "sf::String::String(char const*, std::__1::locale const&)", referenced from:
      _main in helloworld-5735a7.o
  "sf::Window::Window(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)", referenced from:
      _main in helloworld-5735a7.o
  "sf::Window::~Window()", referenced from:
      _main in helloworld-5735a7.o
  "sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)", referenced from:
      _main in helloworld-5735a7.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Build finished with error(s).

I tried to follow this topic, but as original poster I still can't figure this out: https://en.sfml-dev.org/forums/index.php?topic=27867.0

I've compiled libs as it was suggested there. Here you can see that they are actually arm64:
~ % cd /Users/DG/cppurgatory/SFML_repo/lib
DG@MBP-SHVP lib % file libsfml-audio.3.0.0.dylib
libsfml-audio.3.0.0.dylib: Mach-O 64-bit dynamically linked shared library arm64

Running this tasks.json:
            "command": "/usr/bin/g++",
            "args": [
                "-fdiagnostics-color=always",
                "-I",
                "/usr/local/include",
                "-L",
                "/Users/DG/cppurgatory/SFML_repo/lib",
                "-g",
                "${workspaceFolder}/*.cpp",
                "-o",
                "${workspaceFolder}/bin/run",
                "-std=c++17",
            ],

With c_cpp_properties.json configuration:
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**",
                "/Users/DG/cppurgatory/SFML_repo/lib",
                "/usr/local/include"
            ],
            "defines": [],
            "macFrameworkPath": ["/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"],
            "compilerPath": "/usr/bin/g++",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-gcc-arm64",
            "forcedInclude": []
       

Any thoughts? Been struggling for two days already. I really want write some actual code already

Pages: [1]