Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Not working...  (Read 4797 times)

0 Members and 1 Guest are viewing this topic.

Cuban-Pete

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Not working...
« on: June 21, 2011, 02:32:54 pm »
Hi,

I would like to use SFML, but after trying days I give up. My reasons:

- 1.6 has ATI bug
- 2.0 has -gluperspective32 bug, compiler keeps giving error
- 2.0 examples don't even work. what the hell. they close right away after starting or won't compile

I'm on win7 64bit with ATI HD4870.

I wanted to make a program that can be used on all operating systems, but this is just not working...

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
Not working...
« Reply #1 on: June 21, 2011, 02:43:23 pm »
I have the same setup and it works fine. Even SFML 1.6.

Try to give more detail about your problem. For example, what did you use to compile?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Not working...
« Reply #2 on: June 21, 2011, 02:48:22 pm »
Quote
- 1.6 has ATI bug

Which can easily be worked around by linking statically.

Quote
- 2.0 has -gluperspective32 bug, compiler keeps giving error

This is not a known bug, and SFML doesn't use gluPerspective anyway (only in examples).
Did you just forgot to link to glu32 in your project?

Quote
- 2.0 examples don't even work. what the hell. they close right away after starting or won't compile

They do compile and work. Please give us more details if they fail on your machine.

So did you just post to complain, or do you want us to find out what you did wrong? ;)
Laurent Gomila - SFML developer

Cuban-Pete

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Not working...
« Reply #3 on: June 21, 2011, 03:12:38 pm »
Thanks for the quick reply. I posted because I want it to work, but hate it not for working...  :roll:

About the 2.0 bugs (some more details):
- download today SFML 2.0 snapshot
- used Cmake with visual studio 2008 compiler
- did BUILD ALL (on release)
- went to the examples and opened (for example) window.vcproj
- set it on release and compiled:

Quote
1>Window.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function _main
1>C:\Users\Lars\Desktop\sfml\examples\window\Release\window.exe : fatal error LNK1120: 1 unresolved externals


Under linker (additional libraries):
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
..\..\lib\Release\sfml-main.lib
..\..\lib\Release\sfml-window.lib
..\..\lib\Release\sfml-system.lib
glu32.lib
opengl32.lib
winmm.lib

Ok. other example I tried to run, win32. It compiles, all went ok. I copy:
sfml-graphics-2.dll
sfml-system-2.dll
sfml-window-2.dll
and start the program. I see a window with grey background... 'woom' and it's gone again. No messages, nothing. Also running from console, no messages. --- wait, revert that. the images were missing. fixed that, the example did run! WOOOO  :D  

I would like to make a program with opengl, so that glu bug is still a problem. Do you guys also have a tutorial on how to statically link 2.0, that would be nice.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Not working...
« Reply #4 on: June 21, 2011, 03:21:39 pm »
To statically link SFML 2, yuo must define SFML_STATIC in the proeprocessor options of your project. And link to the "-s" variants of the SFML libraries.

Your problem with GLU is weird, you link to glu32.lib so the gluPerspective function should be found. Maybe you have a crappy version of GLU that conflicts with the "official" one? :?
Laurent Gomila - SFML developer

Cuban-Pete

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Not working...
« Reply #5 on: June 21, 2011, 03:48:14 pm »
Thanks, that fixed it. I copied glu.h and glu32.lib from a different pc with VS2010 and cleaned up the GL folder (contained also freeglut stuff)  :)

Only problem now is that I did a new cmake and compile for the -s libraries, but I did not get an sfml-main-s.lib.  :?

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Not working...
« Reply #6 on: June 21, 2011, 04:18:04 pm »
Laurent

I thought SFML_STATIC was only for SFML 1.6 ?

If it is for SFML 2, how do I get the -s files (they aren't created by CMake/VS2005) ???


Thanks
Ed
SFML 2.1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Not working...
« Reply #7 on: June 21, 2011, 04:38:52 pm »
Quote
Only problem now is that I did a new cmake and compile for the -s libraries, but I did not get an sfml-main-s.lib

There's no sfml-main-s, sfml-main is always static.

Quote
I thought SFML_STATIC was only for SFML 1.6 ?

SFML 1.6 has SFML_DYNAMIC.

Quote
If it is for SFML 2, how do I get the -s files (they aren't created by CMake/VS2005) ???

Read the tutorial ;)
Laurent Gomila - SFML developer

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Not working...
« Reply #8 on: June 21, 2011, 04:46:40 pm »
GOT IT!

That was my problem (in the other thread) - I was mixing static and dynamic. I missed unticking the BUILD_SHARED_LIBS option.

So now I have recompiled SFML and it all works - no crazy heap allocation errors!

I will go and close the other thread now.

Thanks!
SFML 2.1

Cuban-Pete

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Not working...
« Reply #9 on: June 21, 2011, 05:00:09 pm »
Quote from: "Laurent"
To statically link SFML 2, yuo must define SFML_STATIC in the proeprocessor options of your project.


How do I do that? I googled all over the place "static library visual studio", but got nothing with an answer.

I also have a problem that running my .exe (still with .dll's) on vista pc, it gives an "program did not work" message - after exiting - the program. I read on the forum that recompiling SFML would fix this. I hope that helps.

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
Not working...
« Reply #10 on: June 21, 2011, 05:16:05 pm »
Quote from: "Cuban-Pete"

How do I do that? I googled all over the place "static library visual studio", but got nothing with an answer.

On your project properties, select C/C++ and then Preprocessor on the left list, and on the Preprocessor Definitions add SFML_STATIC


Cuban-Pete

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Not working...
« Reply #11 on: June 21, 2011, 05:19:11 pm »
Awesome, it works! Thanks you very much for the clear image contadotempo.  :D

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Not working...
« Reply #12 on: June 22, 2011, 07:51:34 am »
There's the same image in the SFML tutorials... ;)
Laurent Gomila - SFML developer

 

anything