SFML community forums

Help => Graphics => Topic started by: lane on March 08, 2016, 05:45:55 am

Title: Codelite and SFML
Post by: lane on March 08, 2016, 05:45:55 am
Hello,
I am new to SFML and I am trying to learn to load and draw a .png to a window. I am using the Codelite IDE with TDM-GCC-32 compiler. here is my code:

#include <SFML/Graphics.hpp>
#include "Game.h"
#include <iostream>

using namespace std;



int main(int argc, char* argv[])
{
        sf::Texture texture;
        if(!texture.loadFromFile("texture.png"))
                return 1;
       
        sf::Sprite sprite;
        sprite.setTexture(texture);
       
       
        sf::RenderWindow window(sf::VideoMode(500, 500), "SFML works!");
        while (window.isOpen()) { //Game Loop
               
                        sf::Event event; //Process Events
                       
                                while (window.pollEvent(event))
                                {
                                        if (event.type == sf::Event::Closed) { //Close Window: exit
                                                window.close();
                                        }
                                       
                                               
                                        if(event.type == sf::Event::KeyPressed){  //Gets WSAD key strokes
                                               
                                                if(event.key.code == sf::Keyboard::W){
                                                        cout<<"you hit the W key" << endl;
                                                        window.draw(sprite);
                                                }
                                               
                                                if(event.key.code == sf::Keyboard::A){
                                                        cout<<"you hit the A key" << endl;
                                                }
                                               
                                                if(event.key.code == sf::Keyboard::S){
                                                        cout<<"you hit the S key" << endl;
                                                }
                                               
                                                if(event.key.code == sf::Keyboard::D){
                                                        cout<<"you hit the D key" << endl;
                                                }
                                       
                                        }
                               
                                }
                       
               
       

 }//End of Game Loop
       
       
return 0;
}

My Error message tells of an undefined reference to my 'loadfromfile' line.
build log:

C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-32/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ SFML - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Projects/SFML'
C:/TDM-GCC-32/bin/g++.exe -o ./Debug/SFML @"SFML.txt" -L. -LC:/SFML-2.3.2-windows-gcc-4.8.1-tdm-32-bit/SFML-2.3.2/lib  -lsfml-graphics -lsfml-window -lsfml-system
./Debug/main.cpp.o: In function `main':
C:/Projects/SFML/main.cpp:12: undefined reference to `sf::Texture::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sf::Rect<int> const&)'

collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[1]: *** [Debug/SFML] Error 1
SFML.mk:78: recipe for target 'Debug/SFML' failed
mingw32-make.exe[1]: Leaving directory 'C:/Projects/SFML'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====2 errors, 0 warnings====
 

Any help with this issue would be awesome!

Thanks,
lane
Title: Re: Codelite and SFML
Post by: G. on March 08, 2016, 07:16:44 am
Probably the same problem/solution (http://en.sfml-dev.org/forums/index.php?topic=19793.0). ;)
Title: Re: Codelite and SFML
Post by: lane on March 09, 2016, 01:53:30 am
Thank you for that! :)

but I must ask, can I still use my compiler or will I need a new one? (or which download package should I use)
Title: Re: Codelite and SFML
Post by: G. on March 09, 2016, 04:58:27 am
If there isn't an SFML package compiled for your version of GCC in the download list (http://www.sfml-dev.org/download/sfml/2.3.2/), then you'll have to compile SFML by yourself. (it's not very hard (http://www.sfml-dev.org/tutorials/2.3/compile-with-cmake.php))
You don't need to change your compiler.
Title: Re: Codelite and SFML
Post by: lane on March 10, 2016, 12:12:11 am
Once again thank you for your help! Maybe I'm flat out dumb, but I am not understanding this tutorial for the cmake http://www.sfml-dev.org/tutorials/2.3/compile-with-cmake.php (http://www.sfml-dev.org/tutorials/2.3/compile-with-cmake.php). Are there any other resources for this??? It 'sort of' tells you what to do, but when I try it, it doesn't work. :(
Quote
On Windows, if you want to use GCC (MinGW), you can temporarily add the MinGW\bin directory to the PATH and then run CMake from the command shell:

> set PATH=%PATH%;your_mingw_folder\bin
> cmake -G"MinGW Makefiles" ./build

I have already set my Path environment variable to TDM-GCC-32\bin, no problem. Then it says run this cmake.. that is where I am lost, I have no clue, not to mention that my MinGW cmd prompt does understand the command cmake.. Any help with this would be absolutely awesome!

Thanks,
lane
Title: Re: Codelite and SFML
Post by: victorlevasseur on March 10, 2016, 12:20:31 am
Maybe if you install CMake it will work a bit better...
Title: Re: Codelite and SFML
Post by: lane on March 10, 2016, 01:04:56 am
ahhhh... ;)
Title: Re: Codelite and SFML
Post by: lane on March 10, 2016, 01:40:16 am
I'm usually not one to give up, but I've been trying to get a simple graphics api for a few weeks or so and there has been no luck for me. I have been reading tutorials that make no sense or are outdated. When I can't accomplish simple tasks, I think it's time to just stop. Thank you for the help I have received with this, but I am just done with trying to make things work, when they never do..

Thanks,
lane
Title: Re: Codelite and SFML
Post by: Hapax on March 10, 2016, 02:11:09 am
Don't give up. SFML's worth it ;)

How set are you on your exact compiler? :P

Just so you know, this is CMake's website (https://cmake.org/).

I actually had trouble with compiling SFML. It's disheartening (I think CMake hates me for no reason) but don't give up. Maybe your compiler is in this list (https://www.nightlybuilds.ch/project/show/1/SFML/)? Click "Compilers" to see the compiler names more clearly. The builds are newer than latest release build but are not - currently - the latest master (on GitHub) (https://github.com/SFML/SFML).
Title: Re: Codelite and SFML
Post by: lane on March 10, 2016, 11:46:23 pm
my compiler is this one http://tdm-gcc.tdragon.net/download (http://tdm-gcc.tdragon.net/download).

I have no idea if this helps...

...

yup..
I am using Codelite 9.1.0  8)
TDM-GCC-32 v. 5.1.0

Thanks for the support all..
Title: Re: Codelite and SFML
Post by: Hapax on March 11, 2016, 05:24:40 pm
I am using ... TDM-GCC-32 v. 5.1.0
Then, you can download pre-built binaries for v.2.3.2+ (+ is because it's slightly newer than the 2.3.2 release) - as well as some other libraries - from:
https://www.nightlybuilds.ch/compiler/show/17/MinGW-Builds-510r0-32/

Only other options would be to build SFML yourself or downgrade your compiler to match (identically) to a release version  :-\
Title: Re: Codelite and SFML
Post by: lane on March 12, 2016, 05:37:27 am
Okay, I appreciate your help Hapax! :)

Let me ask this, I went to the link (https://www.nightlybuilds.ch/compiler/show/17/MinGW-Builds-510r0-32/ (https://www.nightlybuilds.ch/compiler/show/17/MinGW-Builds-510r0-32/)). Do I need to download the compiler at the top of the screen, then download the SFML choice in the table?  :-\
Title: Re: Codelite and SFML
Post by: Hapax on March 12, 2016, 06:28:50 am
I was guessing that it matched the compiler that you're using (because it is GCC and version 5.1.0).
Looking at it again, I've realised that I made an error. You're using TDM, right? (there isn't a pre-built version for TDM after version 481).
Title: Re: Codelite and SFML
Post by: lane on March 12, 2016, 09:20:47 pm
Okay,

One more question. Let me just restart (compiler wise).

When I go to get a compiler to compile SFML with Codelite, I need to go to the SFML Downloads page download the GCC 4.8.1 TDM (SJLJ) - 32-bit one, then go and get that compiler? If I do this, will I be able to use SFML to create a window and add a picture, etc.?

For all that I want at this point, is something to work.
Title: Re: Codelite and SFML
Post by: dabbertorres on March 12, 2016, 10:10:30 pm
If you want to compile SFML, you simply get the SFML's source code and build it with whatever compiler you want.

If you don't want to compile SFML, you need to get a version that was built with the same compiler you want to use.
Title: Re: Codelite and SFML
Post by: lane on March 13, 2016, 10:29:53 pm
Okay, I just watched a video that really helped me (https://www.youtube.com/watch?v=THRWxm6QD7k (https://www.youtube.com/watch?v=THRWxm6QD7k)). I made the Workspace file and opened it up with Codelite. I built the project/workspace and it ran fine, but when I went to look for the libs in the lib folder, they weren't there. Do I need these lib files? When I opened up the workspace it had all of the header and cpp files there, but I'm not sure where the libs are. Any help with this?
Title: Re: Codelite and SFML
Post by: lane on March 14, 2016, 10:44:42 pm
Do I need to make a new project in the workspace??

Any help? :-\
Title: Re: Codelite and SFML
Post by: lane on March 15, 2016, 05:15:02 am
Well, I decided to build SFML in Cmake for Code::Blocks (I have that IDE but would rather use Codelite). I got everything to work, I built the files I compiled it, I got the lib files. But now when I try out a project from the examples folder, I get all of these errors...
Build log:

-------------- Build: Debug in TrophyHunter (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -L"C:\sfml build\lib" -o bin\Debug\TrophyHunter.exe obj\Debug\main.o   -lsfml-window-s -lsfml-graphics-s -lsfml-audio-s -lsfml-main -lsfml-system-s
obj\Debug\main.o: In function `main':
C:/Projects/TrophyHunter/main.cpp:27: undefined reference to `glClearDepth@8'

C:/Projects/TrophyHunter/main.cpp:28: undefined reference to `glClearColor@16'
C:/Projects/TrophyHunter/main.cpp:31: undefined reference to `glEnable@4'

C:/Projects/TrophyHunter/main.cpp:32: undefined reference to `glDepthMask@4'
C:/Projects/TrophyHunter/main.cpp:35: undefined reference to `glDisable@4'

C:/Projects/TrophyHunter/main.cpp:36: undefined reference to `glDisable@4'
C:/Projects/TrophyHunter/main.cpp:39: undefined reference to `glViewport@16'

C:/Projects/TrophyHunter/main.cpp:42: undefined reference to `glMatrixMode@4'
C:/Projects/TrophyHunter/main.cpp:43: undefined reference to `glLoadIdentity@0'

C:/Projects/TrophyHunter/main.cpp:45: undefined reference to `glFrustum@48'
C:/Projects/TrophyHunter/main.cpp:95: undefined reference to `glEnableClientState@4'

C:/Projects/TrophyHunter/main.cpp:96: undefined reference to `glEnableClientState@4'
C:/Projects/TrophyHunter/main.cpp:97: undefined reference to `glVertexPointer@16'

C:/Projects/TrophyHunter/main.cpp:98: undefined reference to `glColorPointer@16'
C:/Projects/TrophyHunter/main.cpp:101: undefined reference to `glDisableClientState@4'

C:/Projects/TrophyHunter/main.cpp:102: undefined reference to `glDisableClientState@4'
C:/Projects/TrophyHunter/main.cpp:124: undefined reference to `glViewport@16'

C:/Projects/TrophyHunter/main.cpp:128: undefined reference to `glClear@4'
C:/Projects/TrophyHunter/main.cpp:131: undefined reference to `glMatrixMode@4'

C:/Projects/TrophyHunter/main.cpp:132: undefined reference to `glLoadIdentity@0'
C:/Projects/TrophyHunter/main.cpp:133: undefined reference to `glTranslatef@12'

C:/Projects/TrophyHunter/main.cpp:134: undefined reference to `glRotatef@16'
C:/Projects/TrophyHunter/main.cpp:135: undefined reference to `glRotatef@16'

C:/Projects/TrophyHunter/main.cpp:136: undefined reference to `glRotatef@16'
C:/Projects/TrophyHunter/main.cpp:139: undefined reference to `glDrawArrays@12'

C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x205): undefined reference to `glGetString@4'
C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x216): undefined reference to `glGetString@4'

C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0xf33): undefined reference to `glGetIntegerv@8'
C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0xf49): undefined reference to `glGetIntegerv@8'

C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0xf51): undefined reference to `glGetError@0'
C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0xf96): undefined reference to `glEnable@4'

C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0xfcd): undefined reference to `glGetIntegerv@8'
C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x100e): undefined reference to `glGetIntegerv@8'

C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x104f): undefined reference to `glGetString@4'
C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x10fe): undefined reference to `glGetIntegerv@8'

C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x19d3): undefined reference to `glGetIntegerv@8'
C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x19f0): undefined reference to `glGetIntegerv@8'

C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x19f8): undefined reference to `glGetError@0'
C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x1a5f): undefined reference to `glEnable@4'

C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x1a8d): undefined reference to `glGetIntegerv@8'
C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x1ad2): undefined reference to `glGetIntegerv@8'

C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x1b0f): undefined reference to `glGetString@4'
C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj):GlContext.cpp:(.text+0x1bb9): undefined reference to `glGetIntegerv@8'

C:/TDM-GCC-32/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: C:\sfml build\lib/libsfml-window-s.a(GlContext.cpp.obj): bad reloc address 0x5d in section `.text$_ZNSt8_Rb_treeIPN2sf4priv9GlContextES3_St9_IdentityIS3_ESt4lessIS3_ESaIS3_EE16_M_insert_uniqueERKS3_[__ZNSt8_Rb_treeIPN2sf4priv9GlContextES3_St9_IdentityIS3_ESt4lessIS3_ESaIS3_EE16_M_insert_uniqueERKS3_]'
C:/TDM-GCC-32/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 3 second(s))
44 error(s), 0 warning(s) (0 minute(s), 3 second(s))
 

I "think" it has to do with the opengl due to the undefined references starting with gl..

If any of you out there know how to fix this I would be very, very happy!
Title: AW: Codelite and SFML
Post by: eXpl0it3r on March 15, 2016, 07:46:02 am
Check the latest official tutorial. You need to link SFML's dependencies, when.linking statically.

You also need to link the debug libraries in debug mode (-s-d) suffix.
Title: Re: Codelite and SFML
Post by: G. on March 15, 2016, 10:29:43 am
Slight typo BTW eXpl0it3r meant -s-d, not -s-f.
Title: AW: Codelite and SFML
Post by: eXpl0it3r on March 15, 2016, 10:47:33 am
Woops, thanks! :D
Title: Re: Codelite and SFML
Post by: Spirro 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.
Title: Re: Codelite and SFML
Post by: lane on March 16, 2016, 03:25:17 am
Spirro, Thank You so much!

You're post has worked so far! 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"?
Title: AW: Codelite and SFML
Post by: eXpl0it3r on March 16, 2016, 07:44:27 am
Change the settings in CMake. For debug builds change the "Release" string to "Debug".

It's highly recommended to run make install, that way everything needed will be copied nicely.
Title: Re: Codelite and SFML
Post by: lane on March 16, 2016, 07:53:53 pm
can you elaborate just a little bit? I don't want to screw up now.. ;)

I know how to do the release and debug part, but do I leave the "Where the source code is:" and the "Where to build the binaries:" the same?

And umm,

Quote
It's highly recommended to run make install, that way everything needed will be copied nicely.

What exactly does this mean?

sorry if I am asking dumb questions, I just want to finish this already.
Title: Re: Codelite and SFML
Post by: Spirro 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.
Title: Re: Codelite and SFML
Post by: lane on March 16, 2016, 11:06:22 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?
Do I need to start a project and link the libs and add the include path?
When adding in the libs I know there is a certain order, does this apply with the debug libs as well?

Thanks
Title: Re: Codelite and SFML
Post by: Spirro 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.
Title: Re: Codelite and SFML
Post by: lane on March 17, 2016, 01:04:39 am
 >:( I am feeling dumber every minute!

I went to go link up my libs and includes and I even added the SFML_STATIC macro, but no luck.

This is how I have it set up.

Include path: C:/Repositories/GIT2/build/bin/include
Library path: C:/Repositories/GIT2/build/lib
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..
Title: Re: Codelite and SFML
Post by: Spirro 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.
Title: Re: Codelite and SFML
Post by: lane on March 17, 2016, 03:07:08 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

That is how I have it inside of my Libraries. When I try to run the example code that is in the Code::Blocks SFML tutorial, I still have issues with graphics, specifically ImageLoader.cpp and jpeg. :'(

lane
Title: Re: Codelite and SFML
Post by: Spirro 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.
Title: Re: Codelite and SFML
Post by: lane on March 17, 2016, 04:34:12 am
you know what. I got it to work (I think)

Instead of statically linking it, I used the .dll s

in my Library I put just the sfml-... and then the dependencies. I then went to where the executable was being made and put the .dll s there. I think it all works, for I used the Pong example from the examples folder and got it to work!

Thank You All Very Much! I look forward to being able to code with SFML.

 8)
lane