Open popcornkerne1 opened 1 year ago
Create the main.cpp file listed in the README file and run your compiler on the two source files.
You have to also add -lsfml-graphics -lsfml-window -lsfml-system
to your compiler args.
Also be sure you have a recent version of sfml installed.
it gives the following errors:
g++ main.cpp -lsfml-graphics -lsfml-window -lsfml-system
main.cpp:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~
compilation terminated.
g++ LorenzAttractor.cpp -lsfml-graphics -lsfml-window -lsfml-system
In file included from LorenzAttractor.h:2,
from LorenzAttractor.cpp:1:
vectormath.h:2:10: fatal error: SFML/Graphics.hpp: No such file or directory
2 | #include <SFML/Graphics.hpp>
| ^~~~~~~
compilation terminated.
Bro, are you sure you have SFML installed? “No such file or directory” suggests it's not! Keep in mind this isn't just a regular C script that just does a calculation—we need the extension SFML for the visual interface! Just install Code::Blocks you must have version for Linux. Here is a guide for SFML in Linux: https://web.archive.org/web/20210422225352/http://www.edparrish.net/common/sfmlcb-linux.html
It is also possible the compiler is not finding the SFML. Try adding the -I
option in your command:
g++ main.cpp -lsfml-graphics -lsfml-window -lsfml-system -I/path/to/SFML/headers
I have installed SFML, I installed it through my package manager, the thing is, I tried to follow the guide, but the dependencies have different names and/or don't even exist, I even clicked the extra link for the dependencies only to find that about 1/2 to a 1/3 of them didn't exist, I need a guide for Fedora, or else I am not able to follow the cmake way
Quick edit, I asked GPT for the alternatives and am going to try again, will update
Update: spits out the following, I have put the files physically in the SFML header directory:
In file included from main.cpp:2:
LorenzAttractor.h:77:13: error: ‘Uint8’ in namespace ‘sf’ does not name a type
77 | sf::Uint8 clamp(float x)
| ^~~~~
main.cpp: In function ‘int main()’:
main.cpp:11:47: error: no matching function for call to ‘sf::VideoMode::VideoMode(int, int)’
11 | window.create(sf::VideoMode(1980, 1080), "Coding Projects", (isFullscreen ? sf::Style::Fullscreen : sf::Style::Default), sf::ContextSettings());
| ^
In file included from /usr/local/include/SFML/Window.hpp:42,
from /usr/local/include/SFML/Graphics.hpp:57,
from vectormath.h:2,
from LorenzAttractor.h:2:
/usr/local/include/SFML/Window/VideoMode.hpp:61:14: note: candidate: ‘sf::VideoMode::VideoMode(const sf::Vector2u&, unsigned int)’
61 | explicit VideoMode(const Vector2u& modeSize, unsigned int modeBitsPerPixel = 32);
| ^~~~~
/usr/local/include/SFML/Window/VideoMode.hpp:61:40: note: no known conversion for argument 1 from ‘int’ to ‘const sf::Vector2u&’ {aka ‘const sf::Vector2~~~~^~~~
/usr/local/include/SFML/Window/VideoMode.hpp:52:5: note: candidate: ‘sf::VideoMode::VideoMode()’
52 | VideoMode();
| ^~~~~
/usr/local/include/SFML/Window/VideoMode.hpp:52:5: note: candidate expects 0 arguments, 2 provided
/usr/local/include/SFML/Window/VideoMode.hpp:43:23: note: candidate: ‘constexpr sf::VideoMode::VideoMode(const sf::VideoMode&)’
43 | class SFML_WINDOW_API VideoMode
| ^~~~~
/usr/local/include/SFML/Window/VideoMode.hpp:43:23: note: candidate expects 1 argument, 2 provided
/usr/local/include/SFML/Window/VideoMode.hpp:43:23: note: candidate: ‘constexpr sf::VideoMode::VideoMode(sf::VideoMode&&)’
/usr/local/include/SFML/Window/VideoMode.hpp:43:23: note: candidate expects 1 argument, 2 provided
main.cpp:19:18: error: expected unqualified-id before ‘.’ token
19 | LorenzAttractor.run(window);
| ^
how would you compile this on linux?