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.


Topics - stav

Pages: [1]
1
General / CMake android build errors
« on: March 21, 2019, 03:46:02 pm »
Hi guys
im trying to build sfml libraries for the android platform from my linux machine.

I've got everyting installed: cmake, android ndk, make, gcc, and all of SFML's dependencies.

However when i invoke cmake with the following command:
Code: [Select]
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=/home/stav/Android/Sdk/ndk-bundle -DCMAKE_ANDROID_ARCH_ABI=x86-64 ..

I get this error:
Code: [Select]
CMake Error at /usr/share/cmake-3.12/Modules/Platform/Android-Determine.cmake:243 (message):
  Android: Unknown ABI CMAKE_ANDROID_ARCH_ABI='x86-64'.
Call Stack (most recent call first):
  /usr/share/cmake-3.12/Modules/CMakeDetermineSystem.cmake:130 (include)
  CMakeLists.txt:45 (project)


CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!


I initially thought it was because i didn't have the x86-64 abi installed or something
However if i change the x86-64 to any other arch (x86 in this example) i get this error:
Code: [Select]
Android: No toolchain for ABI 'x86' found in the NDK:

Also when i look under {NDK}/platform/android-xx/ i do have a folder called arch-x86 and one called arch-x86-64

Is anyone else having trouble with generating the build system for android?
Can someone please help me?

2
General / SFML_FOUND get set to NOT_FOUND ?
« on: March 18, 2019, 09:03:04 am »
Hi
I'm on windows and im trying to setup SFML with a cmake script.

CMakeLists.txt:
Code: [Select]
cmake_minimum_required(VERSION 3.12.1 )
project(Towdef)

add_definitions(-DDEBUG_BUILD)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(SFML_DIR "C:/Users/vatsug/SFML-2.5.1/cmake")
find_package(SFML 2.5 COMPONENTS graphics network audio window system REQUIRED)

set(sfml-libs
    sfml-graphics
    sfml-network
    sfml-audio
    sfml-window
    sfml-system
  )

file(GLOB SOURCES *.cpp)

add_executable(Towdef ${SOURCES})
target_link_libraries(Towdef ${sfml-libs})


When i run it i get the following error:
Code: [Select]
CMake Error at CMakeLists.txt:9 (find_package):
  Could not find a configuration file for package "SFML" that is compatible
  with requested version "2.5".

  The following configuration files were considered but not accepted:

    C:/Users/vatsug/SFML-2.5.1/cmake/SFMLConfig.cmake, version: unknown

And when i remove the 2.5 from find_package i get this error:
Code: [Select]
CMake Error at CMakeLists.txt:9 (find_package):
  Found package configuration file:

    C:/Users/vatsug/SFML-2.5.1/cmake/SFMLConfig.cmake

  but it set SFML_FOUND to FALSE so package "SFML" is considered to be NOT
  FOUND.

What am i doing wrong?
Thanks for reading.

EDIT:
oh and another question:
In order to get this to work in the first place i had to go in to my sfml/cmake directory and rename the SFMLConfig.cmake.in to SFMLConfig.cmake

otherwise cmake couldn't find it. Is there a reason that it has a .in postfix?

3
HI
I'm trying to build sfml for android.

I invoke cmake with the following command:
Code: [Select]
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_TOOLCHAIN_FILE=/home/stav/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DCMAKE_ANDROID_NDK=/home/stav/Android/Sdk/ndk-bundle/ -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug ../..

but im getting this error:
Code: [Select]
CMake Error at /usr/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.12/Modules/FindOpenAL.cmake:96 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cmake/Macros.cmake:398 (find_package)
  src/SFML/Audio/CMakeLists.txt:69 (sfml_find_package)
even though i have installed all the dependencies (including OpenAL)
can someone help me?

4
General / [SOLVED] 100% cpu usage on linux
« on: December 30, 2018, 11:32:13 pm »
Hi
I recently switched to linux ( Ubuntu 18.04 )

Before when i ran the following code on my windows machine the cpu usage would stay fairly low but now when i run it on linux my cpu usage instantly goes to 100% (which makes sense since its a never ending while loop - now that i think about it)

This is my code:
Code: [Select]
#include <SFML/Window.hpp>

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

while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
}

return 0;
}

but im just curious why it didnt use 100% cpu when i ran it on my windows machine. Did i do something wrong? or is it this supposed to happen?

My theory is that on windows sfml automatically sleeps to match the screens refresh rate and for whatever reason it doesnt on linux.
Is there any way to turn this back on? i know i can decrease the cpu usage myself, by sleeping after each loop but id rather let sfml handle it if possible

I tried adding:
Code: [Select]
window.setFramerateLimit(10u);
window.setVerticalSyncEnabled(true);
but that doesn't fix it :<

5
General / SFML Android - No toolchain for armeabi (or x86)
« on: November 15, 2018, 11:47:53 am »
Hi
im trying to build SFML for android.

Im following the github tutorial

Ive installed android studio, cmake, gradle, and added everything to the path

i cloned SFML, made a directory called /build/armeabi

i then invoke cmake with this command:
Code: [Select]
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=C:/Users/stav/AppData/Local/Android/Sdk/ndk-bundle -DCMAKE_ANDROID_ARCH_ABI=armeabi -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" ../..

but then i get the following error saying something about "armeabi" toolchain not found:
Code: [Select]
-- Android: Targeting API '28' with architecture 'arm', ABI 'armeabi', and processor 'armv5te'
CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/Platform/Android/Determine-Compiler-NDK.cmake:108 (message):
  Android: No toolchain for ABI 'armeabi' found in the NDK:

    C:/Users/stav/AppData/Local/Android/Sdk/ndk-bundle

  after considering:

    C:/Users/stav/AppData/Local/Android/Sdk/ndk-bundle/build/core/toolchains/aarch64-linux-android-clang/config.mk
    C:/Users/stav/AppData/Local/Android/Sdk/ndk-bundle/build/core/toolchains/arm-linux-androideabi-clang/config.mk
    C:/Users/stav/AppData/Local/Android/Sdk/ndk-bundle/build/core/toolchains/x86-clang/config.mk
    C:/Users/stav/AppData/Local/Android/Sdk/ndk-bundle/build/core/toolchains/x86_64-clang/config.mk
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.13/Modules/Platform/Android/Determine-Compiler.cmake:39 (include)
  C:/Program Files/CMake/share/cmake-3.13/Modules/Platform/Android-Determine-C.cmake:1 (include)
  C:/Program Files/CMake/share/cmake-3.13/Modules/CMakeDetermineCCompiler.cmake:27 (include)
  CMakeLists.txt:45 (project)


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/stav/Desktop/SFML/build/armeabi/CMakeFiles/CMakeOutput.log".

Does anybody know what is going wrong?


EDIT:
I've just tried changing the target to x86 and it works fine. (EDIT2: not anymore, still need help)
but im still curious why armeabi wasn't working? is it no longer supported orr?


6
General / Setting vertical sync not supported
« on: June 02, 2018, 10:54:14 pm »
Hi, im on linux and im having some problems building my application and linking with sfml properly:

I have a file, main.cpp, that contains the following code:
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>

int main()
{
  sf::RenderWindow window(sf::VideoMode(800,600), "window");

  sf::Event event;
  while(window.pollEvent(event))
  {
    if(event.type == sf::Event::Closed)
      window.close();
  }


  window.display();

  return 0;
}

 

When i built & run it using the following command:
g++ main.cpp -lsfml-window -lsfml-system -lsfml-graphics -lsfml-audio -lsfml-network
./a.out
 

it doesn't show a window, instead it just prints:
Code: [Select]
Setting vertical sync not supported

Does anyone know whats happening?

(I installed sfml using the following command: apt install libsfml-dev)

Pages: [1]
anything