3
« on: April 14, 2022, 01:55:45 pm »
Hi there, I am new to C++ and I am attempting to compile a the tutorial code using VS code. I have looked all across the internet and I have not been able to find a tutorial that shows how to install SFML for VS code on a Mac. I have made a lot of progress but I am seemingly stumbling at the last hurdle after days of trying, so any help would be appreciated!
I downloaded the source code version of SFML and used cmake to build the libraries. This only produced dylib files. I created a src folder in my work environment and created two folders, lib and include within. I then moved the dylib files into the lib folder and the contents of the include folder into my include folder (Sorry if this is too much detail I just don't want to miss a step I where I made a mistake).
I then changed my task.json file so that the compiler path now read
"-fdiagnostics-color=always",
"-I${workspaceFolder}/src/include",
"-g",
"${workspaceFolder}/*.cpp",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"-L${workspaceFolder}/src/lib",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system""
Finally I moved the osx frameworks in the extlib folder to the Library/Frameworks folder on my mac. After all of this when I compile I produce an executable which provides the following error message:
dyld: Library not loaded: @rpath/libsfml-graphics.2.5.dylib
Referenced from: /Users/myusername/Desktop/Cpp_Project/main
Reason: image not found
I have been trying to get SFML to work for days and finally needed to cry for help! Any advice or tips would be greatly appreciated. Thank you!
P.S I have tried to add different combinations of the dylibs to my workspace folder but it hasn't made a difference.