SFML community forums
Help => General => Topic started by: reDo on February 15, 2011, 08:39:31 am
-
I made a game but I am using window, graphics and system. Their DLL files have 12,5 mb, so is there any way how to link it to exe please :roll: ? I tried use -s
-lsfml-system -s
...
...
But it doesnt work.
-
Which compiler / OS / version of SFML? Which errors?
-
Win XP Home Edition , MinGW, CodeBlocks 10.5, no errors but when I try to run program without DLL files, "Not found sfml-graphics", SFML 1.6
-
-s is not a linker option, it's a suffix for SFML libraries
-lsfml-system-s
-
When I use -s as you said
-lsfml-system-s
-lsfml-window-s
-lsfml-graphics-s
I get a lot of errors
"undefined reference to `....
undefined reference to `....
undefined reference to `....
undefined reference to `....
..."
-
You cut the interesting part of the error. :P
But I guess it's reference against OpenGL and the other lib used by SFML. When statically linking against SFML you also need to link against these libs.
-
(http://i52.tinypic.com/axk65x.png) which .a have to I link also?
-
Maybe I was wrong – we'll see later.
You have skip a point of the tutorial :
When linking to multiple SFML libraries, make sure you link them in the right order, as it's important for MinGW. The rule is the following : if library XXX depends on (uses) library YYY, put XXX first and then YYY. An exemple with SFML : sfml-graphics depends on sfml-window, and sfml-window depends an sfml-system. The link options would be as follows :
-lsfml-graphics
-lsfml-window
-lsfml-system
:wink:
-
Remove SFML_DYNAMIC from your preprocessor options.
-
I used
-lsfml-graphics-s
-lsfml-window-s
-lsfml-system-s
and the same errors :(
-
I removed SFML_DYNAMIC from #defines but I get the same errors
-
You can't have undefined references to "_imp___" stuff if you don't define SFML_DYNAMIC. Unless you use SFML 2, but you said you use 1.6.
Try "rebuild all", just in case.
-
So I am using 2.0 instead of 1.6?
-
I don't know... I'm not inside your hard disk ;)
It seems like you don't really understand what you did and what to do now. Remove everything related to SFML, download it again, install it and retry from scratch. And make sure that you understand every step of the process ;)
Ps: please don't post wide screenshots, it makes the topic less convenient to navigate on smaller screens because of the horizontal scrollbar.
-
I deleted SFML from CodeBlocks include, bin and lib. Pictures of settings of my project now.
(http://i55.tinypic.com/dzgxdz.jpg)
(http://i52.tinypic.com/zn50ns.jpg)
(http://i52.tinypic.com/5u21hi.jpg)
(http://i55.tinypic.com/2vl3c0p.jpg)
-
And... ? Does it work or not?
-
It not work :cry:, Here is my project http://www.megaupload.com/?d=WGGOFVFO if it help
-
Do you still have exactly the same errors as before?
-
yes undefined reference
-
yes undefined reference
... to the exact same symbols?
Please try to write more details in your answers, if I have to ask 3 questions every time you give a new information, I'm afraid you're not going yo have your solution today ;)
-
I will try :roll: Here is list of errors with settings on the pictures, I have set that codeblocks show me only 50 errors
EDIT I created the project like Empty Project in CodeBlocks
(http://i55.tinypic.com/i74ro7.png)
-
This might be a silly suggestion but have you tried to recompile SFML?
I had the same problem (or similar) and recompiling solved it.
-
It's crazy, "_imp___" symbols cannot exist if you don't define SFML_DYNAMIC.
I'll try to take a look at your project.
This might be a silly suggestion but have you tried to recompile SFML?
I had the same problem (or similar) and recompiling solved it.
I don't think so. The problem here is that its project setup somehow makes the linker expect imported functions, which are not in static libraries (imported == dynamic libs).
-
Did you check it already please? Do you create such project like SFML Project in CodeBlocks?
-
The project looks ok, now I need to find time to actually test it.
-
Ok I will wait :)