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 - Spirro

Pages: [1] 2 3 ... 5
1
Graphics / Re: Unable to open file
« on: January 05, 2018, 07:23:20 am »
You didn't mention what IDE you are using to develope, but the path you have in your source may not be the path your IDE is using.  I think for VS the search path for files starts in the main directory of your project, but not 100% on that.  So your exe is looking for your lib in it's exe directory/assets/graphics/background.png.  Your IDE probably has a different start to that path.

2
General / Re: problem with .exe file ( Code::blocks )
« on: August 31, 2017, 07:28:13 am »
I thought it did not work because I had not inserted the static libraries.  so i tried with this settings
(DEBUG)
sfml-graphics-sd
sfml-window-sd
sfml-system-sd
sfml-audio-sd
sfml-network-sd
For this part the libs are -s-d, so you misspelled them.  That would explain this attempt at compiling.  Can't give any real help on the other issue.

3
General / Re: Problem with SFML test code
« on: April 24, 2016, 06:54:58 am »
http://prnt.sc/aw1mtk

Is that right? Sorry if I did a dumb mistake but I'm new into this stuff... (I keep getting the error)

You make no mention of your OS or compiler.  If you are using Visual Studios then that linking order should be ok, but if you are using MinGW as a compiler it probably won't work.  Review these pages as they list the dependencies of each SFML module:
http://www.sfml-dev.org/tutorials/2.3/start-vc.php
and
http://www.sfml-dev.org/tutorials/2.3/start-cb.php

You may need to shift your linking order to get things to compile correctly.  If you want better explanations to your issues then follow this guide:
http://en.sfml-dev.org/forums/index.php?topic=5559.0
or perhaps one more knowledgeable than me can link to.

4
General / Interesting SFML related find...
« on: April 13, 2016, 11:11:02 pm »
I've been digging around the net on unrelated things, but found something today.   http://opendungeons.github.io/ lists SFML as a dependency and distributes the network, audio, and system SFML modules.  Rendering is done with Ogre and other libs for other things, but another example of SFMLs usefulness.

5
General / Re: SFML version to use?
« on: April 08, 2016, 07:57:00 pm »
I am unfamiliar with which version you would download for the GCC that is distributed with Code Blocks, but since you have GCC already installed you can compile it yourself and it will work just fine.  To compile look here:
http://www.sfml-dev.org/tutorials/2.3/compile-with-cmake.php

To make sure you compiled it right look here:
http://www.sfml-dev.org/tutorials/2.3/start-cb.php

to see how to set Code Blocks up to use SFML.

6
General / Re: Distribute linux binary using SFML
« on: April 04, 2016, 04:51:27 pm »
When I launch my app on Ubuntu 14.04: it doesn't find libsfml-graphics.so.2.3 because it doesn't exist (only version 2.1 exist). Do you suggest I insert SFML 2.3 directly on my package and I reference it with -rpath option ?
Yes.

Quote
Here others questions which could help me to understand better:
* If I create an binary using SFML 2.3. Could I execute it with SFML 2.1 without re-compile it ?
Yes you should be able to because the API hasn't changed, but how some of the features are implemented has.  So if you run your game binary and it uses a lower version of SFML it may not behave as expected, so distributing your development version of SFML with the binary is your best option so that it runs as expected.

Quote
* Why in Ubuntu 14.04, the package name is "libsfml-graphics2" (which refer to version 2.1) and on Unbutu 15.10, the package name is "libsfml-graphics2.3v5". Shouldn't we have same package name: "libsfml-graphics2" ?

It's up to the people that maintain the packages for Ubuntu.  They do what they think is best/needed.  If you want it changed you can get in contact with them.  But you'd be fine compiling SFML for yourself and distributing those libs with your program.

7
General / Re: Distribute linux binary using SFML
« on: April 03, 2016, 06:39:00 pm »
My question:
* Is it possible to compile a binary which can run on all Linux distributions having libsfml-graphics2* ? How ?
* Which dependency I need to specify for my binary ?

Thank you in advance.

You can set a primary search path at compile/link time with -R or -rpath.  When the application is run, whatever path you set at compile/link time will get searched first.  If the lib isn't found then the system paths will be searched.  You can do a search for how to use those commands.

Dependencies will depend on what SFML libraries you used for your application.  You can get full lists of what each module depends on in the tutorial pages.  If you can't figure out the exact list you need then one option would be to just make a virtual box and put your app in that.  Run it and it will complain about what it cant find then add libs till it works.
 

8
Graphics / Re: Codelite and SFML
« on: March 17, 2016, 03:19:49 am »
I added in all of the libs (dependencies included).

just to make sure I did things right:

sfml-graphics-s-d
freetype
jpeg
sfml-window-s-d
opengl32
gdi32
sfml-audio-s-d
openal32
FLAC
vorbisenc
vorbisfile
vorbis
ogg
sfml-network-s-d
ws2_32
sfml-system-s-d
winmm

I think you probably should take a little break to clear out some of the frustration this is causing.  Looking at your list here and the list one the page linked above you didn't get things quite right.  Also, the example code has no need of the audio or network modules so putting them in is not helping anything.  Cut those out then look at the modified list here and the listing on the page linked before.

Everything you need is there.  Somehow you're just making things harder for yourself so take a little break.

9
Graphics / Re: Codelite and SFML
« on: March 17, 2016, 01:19:44 am »
Libraries: sfml-graphics-s-d;sfml-graphics-s;sfml-window-s-d;sfml-window-s;sfml-audio-s-d;sfml-audio-s;sfml-network-s-d;sfml-system-s;sfml-system-s-d

I keep getting errors about the graphics..

Release and debug builds use different versions of libraries.  I don't know which you are trying to do, release or debug, but you are including both sets of libs.  If you are doing a release build you only use the libs with the -s extension.  For debug use the -s-d files.

You also did not include what those SFML libraries require as dependencies.   Look at the page I linked above.  You are using sfml-graphics-s-d, the static debug link library.  On the sited page it lists that SFML module needs opengl32, freetype, and jpeg.  So add those after sfml-graphics-s-d in your include list.  Then for the other sfml modules do the same.  Find out their dependencies from that list and add them if they are not already added by you.

Now IF you include the right sfml libs in order(as listed on the above linked page) with their dependencies(again, listed on the above page) in order, and have SFML_STATIC listed where it needs to be in the CodeLite IDE it will compile.

Just keep playing with it.

10
Graphics / Re: Codelite and SFML
« on: March 16, 2016, 11:28:02 pm »
I have everything built now! Stay with me here as I am going to ask a series of possibly useless questions:

Does this mean that sfml is compiled?
If you made 4 passes then yes.  You have Release, Release static, Debug, Debug static

Quote
Do I need to start a project and link the libs and add the include path?
Yes.  Look at the documentation of your development environment to know how/where to plug in the locations of the SFML or other libs you are using for your project so it can find and use them.

Quote
When adding in the libs I know there is a certain order, does this apply with the debug libs as well?
Yes, both debug and release will use the same order to build using G++ and derivatives(that includes TDM).

And again, you appear to be doing a static build so look at this page http://www.sfml-dev.org/tutorials/2.3/start-cb.php near the bottom where it lists the dependencies of each of the SFML libraries.  When you cloned SFML from GIT you got those dependencies in the 'extlibs' folder.  Look there for what your environment complains about not finding.

11
Graphics / Re: Codelite and SFML
« on: March 16, 2016, 08:59:46 pm »
I have one part that I do not quite know how to do:
Quote
  Now go one by one in creating the other library types (debug/static).

I believe I have followed all the way to there, but I'm not sure how to do that..

Side question:
Inside of my build folder should I have my "lib ... .a" as well as the "sfml- ... -2.dll" and in the bin folder just have the "sfml- ... -2.dll"?

Creating the other library types is easy.  You have already set things up.  If you first made the release build, then after typing 'make install' on your command line, go back to cmake-gui and uncheck the box for 'BUILD_SHARED_LIBS', hit 'Configure' then 'Generate' and go back to the command line then  'make' and 'make install' again. That will create the static release libraries.  Then as Exploit3r said, change 'Release' to 'Debug' and repeat the steps you did for BOTH release builds.  The shared and static libs.

By using 'make install' what happens is all the binaries/includes will be copied to the folder you specified in cmake.  That just makes it much easier for you to find them.  Set them up how you want.  Leave them as is, move them and setup a directory structure easier for you to link with or configure in Codelite.  Doesn't matter.  The only things you are concerned about after the process is finished is where the binaries and includes are so you can configure linking for your compiler install.  Leave them there or move them.  Doesn't matter. 

After the compilation of SFML, the source of SFML is no longer needed.  You can ignore it and leave it there or delete it.  Just don't delete your binaries or you have to clone the repository again and rebuild it.

For the '.a' and '.dll' files I normally just dump them all in the same folder so that when I set up an IDE I only have to remember one directory for the library I am using.  Make your own preffered method of use and do it.  It's that simple.

12
Graphics / Re: Codelite and SFML
« on: March 15, 2016, 06:50:32 pm »
I have been watching this thread and still have a hard time seeing how this is causing you a problem, so I redid my usual steps and am typing out how I do it.  This assumes you already have cmake and a git client installed on your machine, and in your path variable.  Omit steps you see as superfluous.  Also note that this is on windows so the '/' is used instead of'\', but both work.

First, I make a folder named Repositories.  Inside Repositories I make a GIT folder(I use other source control types so this just puts them all in one place for me.).  Open the git folder and on any white space(where files would normally be listed) hit control-shift and right click(on white space).  Click 'Open command window here' from the context menu that pops up.  Now type 'git clone https://github.com/SFML/SFML.git' and let it finish.  If git is not in your path then, in the command window, type 'set PATH=%PATH%;your_git_folder/bin' and try cloning again.

Second, open cmake-gui.  If cmake-gui is not in your path then type  'set PATH=%PATH%;your_cmake-install_folder/bin' and then run 'cmake-gui'.In the 'Where is the source code:' field browse to where you cloned SFML.  For me that is 'D:/Repositories/GIT/SFML'.  Now copy that and put it in the 'Where to build the
binaries:' field and add to the end of it '/build'.  Click configure and it will ask you if you want to create the build directory.  Click yes.  Now a selection window comes up to ask you which generator to create for the project.  There really is no need to choose 'Codelite' or 'Codeblocks',  just choose 'MinGW makefiles'.  Those will work for your TDM install and click 'Finish'.  Cmake will then check and be sure it can find everything.  Your TDM install /bin dir needs to be in your path.  If it is not, close cmake and in the command window put 'set PATH=%PATH%;your_TDM-install_folder/bin' then run cmake-gui again.

Third, set the 'CMAKE_INSTALL_PREFIX' to your build folder path you set above and add on '/bin'.  All this does is copy all the binaries/headers to the 'bin' folder so you can locate them easier.  Then, hit configure again and then 'Generate'.  This, at default, will build the release libraries and put them in the 'bin' folder you set for 'CMAKE_INSTALL_PREFIX'.  Go to your build folder and type 'mingw32-make' and the build process should begin.  You can type 'mingw32-make -j' to use as many threads as your cpu supports to build, but for some things that causes compile problems so I just leave off '-j' by habbit to avoid errors.  Once that is finished, type 'mingw32-make install'.  This will copy all the binaries to the 'bin' folder.  Now go one by one in creating the other library types (debug/static).  All of them will be found in the bin folder.

Now you can load up Codelite, start a project, set all your lib paths, and it should all work.

This is just how I do it.  Others do it differently, but the end results are the same.

Also take not of what eXploit3r wrote.  Static builds have more lib requirements.

13
General / Re: [Visual Studio 2015] Unresolved External Symbols
« on: March 12, 2016, 09:08:51 pm »
Looks to me like you need to look at http://www.sfml-dev.org/tutorials/2.3/start-vc.php again.  You show you included the correct SFML libs, but those libs require other includes for themselves on static builds.  Look at that page again where it lists each SFML lib and what it depends on like opengl32.lib, freetype.lib, etc...  You probably forgot those things.

14
General / Re: Simple problem (sfml didnt work)
« on: January 27, 2016, 05:00:39 pm »
this problem i have when i start simple project
you can say that i stupid because dont read carrefully
i read many posts but this dint help me
i show do all in instructions
I have sfml_static
     wrote sfml-graphics-s.lib   
               sfml-window-s.lib
               sfml-system-s.lib
 and other instructions
 if i clear -s in the end of liblary
i have this

Can you help me?
Thank you

Read the dependency list here http://www.sfml-dev.org/tutorials/2.3/start-vc.php again.  You are not including everything you need for a static link.  If you don't want a static link then remove SFML_STATIC from the preprocessor and remove -s from your libraries to link against.

15
Graphics / Re: Linker errors
« on: December 10, 2015, 12:57:15 am »
I finally took the Visual Studio 14 2015 64 version, I have what It was told in the related page and followed instructions on a youtube video.
But I get two errors:
-#include <SFML/Graphics.hpp>': skipped when looking for precompiled header use
-unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
The second one didn't want to stop, even by including the stadfx.h, what should I do ? it's confusing.

I will just say what others would here.  Youtube videos are rarely up to date.  Please follow the guides here:
http://www.sfml-dev.org/tutorials/2.3/compile-with-cmake.php

From my personal experience it is best to compile SFML on my own using the above guide.  That way I know the resulting binaries will work with my tool chain.

Pages: [1] 2 3 ... 5