SFML community forums

Help => General => Topic started by: reDo on February 15, 2011, 08:39:31 am

Title: Application without huge dll files
Post 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
Code: [Select]
-lsfml-system -s
...
...

But it doesnt work.
Title: Application without huge dll files
Post by: Laurent on February 15, 2011, 08:46:46 am
Which compiler / OS / version of SFML? Which errors?
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 09:10:35 am
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
Title: Application without huge dll files
Post by: Laurent on February 15, 2011, 09:25:16 am
-s is not a linker option, it's a suffix for SFML libraries
Code: [Select]
-lsfml-system-s
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 09:47:05 am
When I use -s as you said
Code: [Select]
-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 `....
..."
Title: Application without huge dll files
Post by: Hiura on February 15, 2011, 10:09:51 am
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.
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 10:15:54 am
(http://i52.tinypic.com/axk65x.png) which .a have to I link also?
Title: Application without huge dll files
Post by: Hiura on February 15, 2011, 10:27:05 am
Maybe I was wrong – we'll see later.

You have skip a point of the tutorial :
Quote
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:
Title: Application without huge dll files
Post by: Laurent on February 15, 2011, 10:44:48 am
Remove SFML_DYNAMIC from your preprocessor options.
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 10:45:05 am
I used
Code: [Select]
-lsfml-graphics-s
-lsfml-window-s
-lsfml-system-s

and the same errors :(
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 11:00:14 am
I removed SFML_DYNAMIC from #defines but I get the same errors
Title: Application without huge dll files
Post by: Laurent on February 15, 2011, 11:19:06 am
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.
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 11:32:22 am
So I am using 2.0 instead of 1.6?
Title: Application without huge dll files
Post by: Laurent on February 15, 2011, 11:40:19 am
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.
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 12:19:00 pm
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)
Title: Application without huge dll files
Post by: Laurent on February 15, 2011, 12:19:47 pm
And... ? Does it work or not?
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 12:25:27 pm
It not work  :cry:, Here is my project http://www.megaupload.com/?d=WGGOFVFO if it help
Title: Application without huge dll files
Post by: Laurent on February 15, 2011, 12:34:37 pm
Do you still have exactly the same errors as before?
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 12:36:30 pm
yes undefined reference
Title: Application without huge dll files
Post by: Laurent on February 15, 2011, 12:44:29 pm
Quote
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 ;)
Title: Application without huge dll files
Post by: reDo on February 15, 2011, 05:44:46 pm
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)
Title: Application without huge dll files
Post by: Contadotempo on February 16, 2011, 01:07:24 am
This might be a silly suggestion but have you tried to recompile SFML?
I had the same problem (or similar) and recompiling solved it.
Title: Application without huge dll files
Post by: Laurent on February 16, 2011, 07:43:59 am
It's crazy, "_imp___" symbols cannot exist if you don't define SFML_DYNAMIC.

I'll try to take a look at your project.

Quote
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).
Title: Application without huge dll files
Post by: reDo on February 17, 2011, 06:37:10 pm
Did you check it already please? Do you create such project like SFML Project in CodeBlocks?
Title: Application without huge dll files
Post by: Laurent on February 17, 2011, 06:58:50 pm
The project looks ok, now I need to find time to actually test it.
Title: Application without huge dll files
Post by: reDo on February 18, 2011, 07:43:35 am
Ok I will wait  :)