hackerpoet / particle-life Goto Github PK
View Code? Open in Web Editor NEWA game of life with particles
License: MIT License
A game of life with particles
License: MIT License
Hi, I'm trying to run this on Linux but I'm getting an error when I try to compile it:
/usr/bin/ld: /tmp/ccAVgtoO.o: in function `main':
Main.cpp:(.text+0x507): undefined reference to `Universe::Universe(unsigned long, unsigned long, int, int)'
/usr/bin/ld: Main.cpp:(.text+0x551): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0x651): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
/usr/bin/ld: Main.cpp:(.text+0x680): undefined reference to `sf::String::String(char const*, std::locale const&)'
/usr/bin/ld: Main.cpp:(.text+0x6b3): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
/usr/bin/ld: Main.cpp:(.text+0x6e5): undefined reference to `sf::Window::setFramerateLimit(unsigned int)'
/usr/bin/ld: Main.cpp:(.text+0x6f9): undefined reference to `sf::Window::setVerticalSyncEnabled(bool)'
/usr/bin/ld: Main.cpp:(.text+0x70d): undefined reference to `sf::RenderWindow::setActive(bool)'
/usr/bin/ld: Main.cpp:(.text+0x71c): undefined reference to `sf::Window::requestFocus()'
/usr/bin/ld: Main.cpp:(.text+0x72b): undefined reference to `sf::Clock::Clock()'
/usr/bin/ld: Main.cpp:(.text+0x749): undefined reference to `sf::Window::close()'
/usr/bin/ld: Main.cpp:(.text+0x781): undefined reference to `sf::Window::close()'
/usr/bin/ld: Main.cpp:(.text+0x7a8): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0x7f2): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0x819): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0x863): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0x88a): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0x8d4): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0x8fb): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0x945): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0x96c): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0x9b6): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0x9dd): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0xa2b): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0xa52): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0xa9c): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0xac3): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0xb0d): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0xb34): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0xb82): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0xba9): undefined reference to `Universe::SetPopulation(unsigned long, unsigned long)'
/usr/bin/ld: Main.cpp:(.text+0xbf7): undefined reference to `Universe::ReSeed(float, float, float, float, float, float, float, bool)'
/usr/bin/ld: Main.cpp:(.text+0xc31): undefined reference to `Universe::SetRandomParticles()'
/usr/bin/ld: Main.cpp:(.text+0xc4e): undefined reference to `Universe::PrintParams() const'
/usr/bin/ld: Main.cpp:(.text+0xd4d): undefined reference to `sf::Clock::getElapsedTime() const'
/usr/bin/ld: Main.cpp:(.text+0xd63): undefined reference to `sf::Time::asMilliseconds() const'
/usr/bin/ld: Main.cpp:(.text+0xd8b): undefined reference to `sf::Mouse::getPosition(sf::Window const&)'
/usr/bin/ld: Main.cpp:(.text+0xdbe): undefined reference to `Universe::ToCenter(int, int, float&, float&) const'
/usr/bin/ld: Main.cpp:(.text+0xdfe): undefined reference to `Universe::GetIndex(int, int) const'
/usr/bin/ld: Main.cpp:(.text+0xe34): undefined reference to `sf::Window::pollEvent(sf::Event&)'
/usr/bin/ld: Main.cpp:(.text+0xe5c): undefined reference to `Universe::GetParticleX(int) const'
/usr/bin/ld: Main.cpp:(.text+0xe7d): undefined reference to `Universe::GetParticleY(int) const'
/usr/bin/ld: Main.cpp:(.text+0xf52): undefined reference to `Universe::Zoom(float, float, float)'
/usr/bin/ld: Main.cpp:(.text+0xf76): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
/usr/bin/ld: Main.cpp:(.text+0xf93): undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
/usr/bin/ld: Main.cpp:(.text+0xfd7): undefined reference to `Universe::Step()'
/usr/bin/ld: Main.cpp:(.text+0xffa): undefined reference to `Universe::Draw(sf::RenderWindow&, float) const'
/usr/bin/ld: Main.cpp:(.text+0x101e): undefined reference to `sf::Window::display()'
/usr/bin/ld: Main.cpp:(.text+0x102d): undefined reference to `sf::Window::isOpen() const'
/usr/bin/ld: Main.cpp:(.text+0x1049): undefined reference to `sf::RenderWindow::~RenderWindow()'
/usr/bin/ld: Main.cpp:(.text+0x10a5): undefined reference to `sf::RenderWindow::~RenderWindow()'
collect2: error: ld returned 1 exit status```
Dear HackerPoet:
I would like to know where can I find a text description of the interaction rules (formulas) among particles.
All the best and thanks for sharing
David
Hi HP,
I'm fairly new to C++ and am no doubt doint something wrong. Sorry about this. I can't seem to get this working in VS. I've set it up as a Console Application. I've added the Header files (HSV.h, Particles.h and Universe.h) and the Source files (Main.cpp and Universe.cpp). I've also referenced SFML in the Project Properties. But when I run the Local Windows Debugger I receive the following errors. Please see screenshot below.
Best wishes,
Taps
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.