1
SFML website / Link to Flattr is broken (404)
« on: May 07, 2018, 11:24:55 pm »
Hi
Link to Flattr is broken (404).
Why you dont use patreon?
Thanks.
Link to Flattr is broken (404).
Why you dont use patreon?
Thanks.
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.
Player
- AnimatedSprite *sprite
- sf::Texture *texture
Engine
- player->update(sf::Time delta)
- player->draw() or window->draw(*player->sprite) // both code i get the same problem
void Engine::createPlayerPhysics(b2World& World, int posX, int posY, int width, int height)
{
b2BodyDef BodyDef;
BodyDef.position = b2Vec2(posX/SCALE, posY/SCALE);
BodyDef.type = b2_dynamicBody;
BodyDef.userData = (void*)"mainPlayer";
playerBody = World.CreateBody(&BodyDef);
b2PolygonShape Shape;
Shape.SetAsBox(width/SCALE, height/SCALE);
b2FixtureDef FixtureDef;
FixtureDef.density = 10.f;
FixtureDef.friction = 0.7f;
FixtureDef.shape = &Shape;
playerBody->CreateFixture(&FixtureDef);
}
////////////// player ////////////////
int width = 40;
int height = 56;
sf::Texture playerTexture;
playerTexture.loadFromFile(resourcePath() + "images/player1.png");
Animation walkingAnimation;
walkingAnimation.setSpriteSheet(playerTexture);
walkingAnimation.addFrame(sf::IntRect(0, 2*height, width, height));
walkingAnimation.addFrame(sf::IntRect(1*width, 2*height, width, height));
walkingAnimation.addFrame(sf::IntRect(2*width, 2*height, width, height));
walkingAnimation.addFrame(sf::IntRect(3*width, 2*height, width, height));
AnimatedSprite animatedSprite(sf::seconds(0.2));
animatedSprite.setAnimation(walkingAnimation);
createPlayerPhysics(*world, 50, 50, width, height);
Paulos-MacBook-Pro:build paulo$ ./rebuild.sh
-- The C compiler identification is Clang 4.2.0
-- The CXX compiler identification is Clang 4.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found SFML . in /Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -H/Users/paulo/Documents/workspaces/cpp/sfml-cmake -B/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_start /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make -f CMakeFiles/sfml-project.dir/build.make CMakeFiles/sfml-project.dir/depend
cd /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build && /usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_depends "Unix Makefiles" /Users/paulo/Documents/workspaces/cpp/sfml-cmake /Users/paulo/Documents/workspaces/cpp/sfml-cmake /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/sfml-project.dir/DependInfo.cmake --color=
Dependee "/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/sfml-project.dir/DependInfo.cmake" is newer than depender "/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/sfml-project.dir/depend.internal".
Dependee "/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/sfml-project.dir/depend.internal".
Scanning dependencies of target sfml-project
make -f CMakeFiles/sfml-project.dir/build.make CMakeFiles/sfml-project.dir/build
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles 1
[ 25%] Building CXX object CMakeFiles/sfml-project.dir/main.cpp.o
/usr/bin/c++ -g -I/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include -o CMakeFiles/sfml-project.dir/main.cpp.o -c /Users/paulo/Documents/workspaces/cpp/sfml-cmake/main.cpp
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles 2
[ 50%] Building CXX object CMakeFiles/sfml-project.dir/Engine.cpp.o
/usr/bin/c++ -g -I/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include -o CMakeFiles/sfml-project.dir/Engine.cpp.o -c /Users/paulo/Documents/workspaces/cpp/sfml-cmake/Engine.cpp
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles 3
[ 75%] Building CXX object CMakeFiles/sfml-project.dir/Util.cpp.o
/usr/bin/c++ -g -I/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include -o CMakeFiles/sfml-project.dir/Util.cpp.o -c /Users/paulo/Documents/workspaces/cpp/sfml-cmake/Util.cpp
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles 4
[100%] Building CXX object CMakeFiles/sfml-project.dir/ResourcePath.mm.o
/usr/bin/c++ -g -I/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include -o CMakeFiles/sfml-project.dir/ResourcePath.mm.o -c /Users/paulo/Documents/workspaces/cpp/sfml-cmake/ResourcePath.mm
Linking CXX executable sfml-project.app/Contents/MacOS/sfml-project
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_link_script CMakeFiles/sfml-project.dir/link.txt --verbose=1
/usr/bin/c++ -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names -framework Foundation -w CMakeFiles/sfml-project.dir/main.cpp.o CMakeFiles/sfml-project.dir/Engine.cpp.o CMakeFiles/sfml-project.dir/Util.cpp.o CMakeFiles/sfml-project.dir/ResourcePath.mm.o -o sfml-project.app/Contents/MacOS/sfml-project ../library/sfml/mac/lib/libsfml-system.dylib ../library/sfml/mac/lib/libsfml-window.dylib ../library/sfml/mac/lib/libsfml-graphics.dylib ../library/sfml/mac/lib/libsfml-network.dylib ../library/sfml/mac/lib/libsfml-audio.dylib
Undefined symbols for architecture x86_64:
"sf::String::String(std::string const&, std::locale const&)", referenced from:
Engine::initializeGraphics() in Engine.cpp.o
"sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)", referenced from:
Engine::run() in Engine.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [sfml-project.app/Contents/MacOS/sfml-project] Error 1
make[1]: *** [CMakeFiles/sfml-project.dir/all] Error 2
make: *** [all] Error 2
void threadMethod()
{
while(true){}
}
int main()
{
sf::Thread thread(&threadMethod);
thread.launch();
return EXIT_SUCCESS;
}
bool useThread = false;
bool useThread = true;
void start()
{
v8::HandleScope handleScope;
v8::Handle<v8::String> source = readFile(resourcePath() + "/js/robot1.js");
v8::Handle<v8::Script> script = v8::Script::Compile(source);
v8::Handle<v8::Value> result = script->Run();
}
<unknown>:232: Uncaught TypeError: Object [object Object] has no method 'walkForward'
https://github.com/prsolucoes/sfml-cmake/blob/master/JSCharacter.h
https://github.com/prsolucoes/sfml-cmake/blob/master/main.cppLINES: 86:92
Failed to load image "images/robot1.png". Reason : Unable to open file
MacBook-Pro-de-Paulo-Coutinho-2:build paulo$ ./build.sh
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Found SFML: /usr/local/include
CMake Error at CMakeLists.txt:19 (target_link_libraries):
Cannot specify link libraries for target
"/usr/local/lib/libsfml-system.dylib" which is not built by this project.
-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found. Stop.