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.


Messages - sharethis

Pages: [1] 2 3 ... 5
1
Thank you. I think it was a cache issue.

2
Right, and the issue only occurs in release variant. In debug variant everything is fine.

3
I want automate building SFML. It already works with Visual Studio on Windows. However, on a Ubuntu 14 LTS virtual machine, specifying "SFML_USE_STATIC_STD_LIBS" results in building shared libraries in release mode, regardless of "BUILD_SHARED_LIBS" being set to false. It works fine for debug mode though.

cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=FALSE -DSFML_USE_STATIC_STD_LIBS:BOOL=TRUE
cmake --build . --config Release

What I expected was that SFML would ignore this variable completely here, since it is a Windows only feature. Do I make the wrong call or is this a bug?

4
Feature requests / Re: Why not set sf::Window style at runtime?
« on: October 08, 2014, 10:55:21 pm »
Do we have any plans to work on this?

5
General discussions / Re: CLion - A new IDE from JetBrains
« on: September 16, 2014, 05:17:51 pm »
Quote
So you're basically saying that because some other IDE (unrelated to this one in any way) was slow and unresponsive, you're going to assume that this one is slow and unresponsive too, simply because they both happen to be written in Java?
Yes, he is basically saying that and it hardly affects you so just ignore it. :-\

Unfortunately he is right, CLion's incredibly slow.

6
General / Re: How to integrate SFML's dependencies into my CMake project?
« on: September 16, 2014, 12:07:33 am »
Wow, thanks a lot. The order in the find_package command really did the trick! I'll update the wiki so that others don't have to struggle with it.

7
General / Re: How to integrate SFML's dependencies into my CMake project?
« on: September 15, 2014, 11:43:37 pm »
By the looks of it, you're not linking against sfml-system...

This is my CMakeLists.txt. It runs without any warnings. Moreover, "libsfml-system-s.a" is available under "D:\lib\SFML\lib". But I think, when I built SFML with "mingw32-make install", there showed up some red lines in the terminal. Maybe something is wrong with my SFML installation. Do you have any idea how I can debug the issue further?

# General settings
cmake_minimum_required(VERSION 2.8.4)
set(PROJECT_NAME test)
project(${PROJECT_NAME})

# Enable debug symbols by default
if (CMAKE_BUILD_TYPE STREQUAL "")
        set(CMAKE_BUILD_TYPE Debug)
endif()

# Define sources and executable
set(EXECUTABLE_NAME ${PROJECT_NAME})
set(SOURCE_FILES main.cpp)
add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES})

# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(SFML_ROOT "" CACHE FILEPATH "Path to SFML library.")
set(SFML_STATIC_LIBRARIES ON)
find_package(SFML 2 REQUIRED system window graphics network audio)
if (SFML_FOUND)
  include_directories(${SFML_INCLUDE_DIR})
  target_link_libraries(${EXECUTABLE_NAME} ${SFML_LIBRARIES})
  target_link_libraries(${EXECUTABLE_NAME} ${SFML_DEPENDENCIES})
else()
        message(SEND_ERROR "SFML library not found. Please set SFML_ROOT.")
endif()
 

8
General / Re: How to integrate SFML's dependencies into my CMake project?
« on: September 15, 2014, 11:21:08 pm »
Is it possible that the SFML built has failed to some extend? I don't understand the error messages though.

9
General / Re: How to integrate SFML's dependencies into my CMake project?
« on: September 15, 2014, 02:45:30 pm »
Thanks for your reply, I got a bit further. CMake finds all dependencies now. However, I get compiler errors now. These are the steps I performed.

1. Download a snapshot of SFML from Github and extract it.
2. Started CMake GUI and selected the exctracted folder as both source and destination.
3. Clicked "Configure" and selected "MinGW Makefiles".
4. Unchecked "BUILD_SHARED_LIBS"
    Set "CMAKE_INSTALL_PREFIX" to "D:/lib/SFML"
    Set "GLEW_INCLUDE_PATH" to "D:/lib/glew-1.11.0/include"
    Set "GLEW_LIBRARY" to "D:/lib/glew-1.11.0/lib/libglew32.a"
    Checked "SFML_USE_STATIC_STD_LIBS"
5. Clicked "Configure" again, and then "Generate".
6. Ran "mingw32-make install" inside the extracted folder.

However, I get these compiler errors with the CMakeLists.txt from the tutorial and the FindSFML.cmake from the official repository. I took the example code from the compilation tutorial.

"D:\program\JetBrains\CLion 138.1965.18\bin\cmake\bin\cmake.exe" --build C:\Users\main\.clion10\system\cmake\generated\dff727e\dff727e\Debug --target test -- -j 6
Linking CXX executable test.exe
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x124): undefined reference to `sf::Clock::Clock()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x129): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x12f): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x461): undefined reference to `sf::err()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x54c): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x552): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x57e): undefined reference to `sf::seconds(float)'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x5f4): undefined reference to `sf::err()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x6f6): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x6fc): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x715): undefined reference to `sf::Clock::restart()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x75b): undefined reference to `sf::Clock::Clock()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x760): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x769): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x7d4): undefined reference to `sf::err()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x8e1): undefined reference to `sf::err()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x9b4): undefined reference to `sf::Clock::Clock()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x9bc): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x9c2): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xa9e): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xaa4): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xabe): undefined reference to `sf::operator!=(sf::Time, sf::Time)'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xacc): undefined reference to `sf::Clock::getElapsedTime() const'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xae6): undefined reference to `sf::operator-(sf::Time, sf::Time)'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xaf2): undefined reference to `sf::sleep(sf::Time)'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xaf9): undefined reference to `sf::Clock::restart()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xb06): undefined reference to `sf::err()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xc56): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xc5c): undefined reference to `sf::Time::Zero'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xc75): undefined reference to `sf::Clock::restart()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xd82): undefined reference to `sf::err()'
D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0xe94): undefined reference to `sf::err()'
d:/program/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: D:\lib\SFML\lib\libsfml-window-s.a(Window.cpp.obj): bad reloc address 0x17 in section `.text.unlikely'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\test.dir\build.make:96: recipe for target 'test.exe' failed
mingw32-make.exe[3]: *** [test.exe] Error 1
CMakeFiles\Makefile2:59: recipe for target 'CMakeFiles/test.dir/all' failed
mingw32-make.exe[2]: *** [CMakeFiles/test.dir/all] Error 2
CMakeFiles\Makefile2:71: recipe for target 'CMakeFiles/test.dir/rule' failed
mingw32-make.exe[1]: *** [CMakeFiles/test.dir/rule] Error 2
Makefile:105: recipe for target 'test' failed
mingw32-make.exe: *** [test] Error 2

10
General / Re: How to integrate SFML's dependencies into my CMake project?
« on: September 15, 2014, 10:56:13 am »
SFML ships all thd dependencies on Wibdows for a reason, i.e. so you don't havr to build them yourself.

Is there a reason that the extlibs are not shipped with the precompiled versions of SFML that you can download from the website, but only with the repository? So I think I have to either build SFML or build it's dependencies. Or I have to download both, the release archive and the repository and copy them together into the same directory?

For linking the dependecies via CMake you could look at SFML's example projects, they link SFML. Or you could look at Thor's examples, they use SFML as well.
If I recall right, when you tell the FindSFML.cmake to search the static SFML libs, it will add the SFML dependencies to a CMake variable - just take a look on how FindSFML.cmake has been implemented.

But thanks for pointing out Thor, it looks clear and is a good reference. There is a variable SFML_DEPENDENCIES that contain a list of the libraries. That's great. I just have to make SFML find the libraries now.

11
General / Re: How to integrate SFML's dependencies into my CMake project?
« on: September 15, 2014, 03:07:46 am »
Can someone experienced with CMake please give me an advice on how to handle SFML's dependencies? I already tried to build all of them myself, but CMake linked just the *.dll.a files. Moreover, it seems like building them is not needed since binaries are included in the SFML repository. Also it would be easier for other developers on Windows to just install SFML instead all of it's dependencies, too.

12
General / Re: clion and sfml?
« on: September 14, 2014, 03:43:09 pm »
Yes, I'm using SFML with the recently released CLion preview. You should definitely start learning CMake as CLion uses this as project files. I just posted a question regarding static linking. However, I got SFML working with CLion sucessfully when linking dynamically. You can see the steps there.

13
General / How to integrate SFML's dependencies into my CMake project?
« on: September 14, 2014, 02:35:30 pm »
I use MinGW32 and want to link to SFML statically. This is are the steps I have done.
  • Download official SFML release for MinGW and copied it to D:\lib\SFML-2.1.
  • Set up a CMake project according to this guide.
  • Added set(SFML_ROOT D:/lib/SFML-2.1) to my CMakeLists.txt.
At this step, it compiles and runs fine when I copy all SFML DLLs in the same folder as my executable. However, I want static linking. Therefore, I also added set(SFML_STATIC_LIBRARIES ON) to my CMakeLists.txt. This causes the following error:

Error: SFML found but some of its dependencies are missing ( FreeType GLEW libjpeg OpenAL libsndfile)

So I have to link to all those dependencies myself. On Windows, it is painful to compile them myself. Because of that, it's tempting to use the already compiled dependencies from the SFML repository.

What is the best way to integrate those libraries into my CMake project?

14
General / Re: Need help for compiling on Visual Studio 14 CTP
« on: September 09, 2014, 07:42:34 pm »
I switched over to Visual Studio 14 CTP because it adds support for std::integer_sequence which I want to use. As far as my experience goes, the CTP releases are already stable enough for a free time project. Is there a practical reason against combining the libs of one framework like SFML?

Thanks for pointing that CMake nightly already has support for VS14. This time, I also checked the option to add SFML examples to directly test if it works. Four of the examples failed to build because of linker errors for freetype.lib and jpeg.lib. Therefore, I downloaded the sources of the newest versions of both libraries and compiled them using VS14 in release mode with /MT. After copying those two libs to SFML\extlibs\libs-msvc\x86, only the opengl, pong and shader examples still fail to build. I already build newest GLEW because the failing examples are all OpenGL related, but it didn't help.

This is the part of the build log that shows the linker error. They're pretty similar to this problem description.

freetype.lib(ftbase.obj) : error LNK2001: unresolved external symbol __imp__strncpy
freetype.lib(truetype.obj) : error LNK2001: unresolved external symbol __imp__strstr
MSVCRT.lib(chandler4gs.obj) : error LNK2001: unresolved external symbol __except_handler4_common
C:\SFML\examples\pong\Release\pong.exe : fatal error LNK1120: 3 unresolved externals
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
freetype.lib(ftbase.obj) : error LNK2001: unresolved external symbol __imp__strncpy
freetype.lib(truetype.obj) : error LNK2001: unresolved external symbol __imp__strstr
MSVCRT.lib(chandler4gs.obj) : error LNK2001: unresolved external symbol __except_handler4_common
C:\SFML\examples\shader\Release\shader.exe : fatal error LNK1120: 3 unresolved externals
  jpeg.lib(jerror.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
  jpeg.lib(jerror.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
  Generating code
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
freetype.lib(ftbase.obj) : error LNK2001: unresolved external symbol __imp__strncpy
freetype.lib(truetype.obj) : error LNK2001: unresolved external symbol __imp__strstr
MSVCRT.lib(chandler4gs.obj) : error LNK2001: unresolved external symbol __except_handler4_common
C:\SFML\examples\opengl\Release\opengl.exe : fatal error LNK1120: 3 unresolved externals

15
General / Need help for compiling on Visual Studio 14 CTP
« on: September 09, 2014, 12:19:10 am »
Hi guys,

I'm trying to use SFML with the newest Visual Studio version, 14 CTP. In order to compile it, I downloaded the newest snapshot from Github and generated project files for Visual Studio 13, which got upgraded on opening. After building the static SFML libraries, I combined them into one library using lib.exe.

The problem is that I get 4 linker errors when I try to compile a simple test program that only creates a sf::RenderWindow.

sfml.lib(jerror.obj) : error LNK2019: unresolved external symbol _fprintf referenced in function _output_message
sfml.lib(jerror.obj) : error LNK2019: unresolved external symbol ___iob_func referenced in function _output_message
sfml.lib(jerror.obj) : error LNK2019: unresolved external symbol _sprintf referenced in function _format_message
sfml.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol _sscanf referenced in function _jinit_memory_mgr

I think the issue is about libjpeg. How can I debug this problem?

Pages: [1] 2 3 ... 5
anything