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

Pages: [1]
1
C / How to get the width of sfText in pixel?
« on: June 13, 2012, 05:22:55 pm »
Hello,

how can I get the width of a sfText in pixels? In another topic (C++), someone refers to text.GetRect().getWidth(), but there's no sfText_getRect() function in the C binding.

(Edit: I'm using CSFML-2.0-rc)

I'm thankful for any reply.

2
C / Re: Problems builind an application with sfml2
« on: June 12, 2012, 10:13:39 pm »
CSFML depends on SFML, did you install it first?
You're so right! I read over the "c" in libcsfml-graphics.so.2 and thought they're the required libraries. I really didn't notice that I need other ones.   :-[

Thanks for your help.

3
C / Re: Problems builind an application with sfml2
« on: June 12, 2012, 09:07:30 pm »
Hello again,

I also tried to compile my main.c test without IDE (I think it's easier to solve the problem this way, but I still dunno what to do), following this tutorial (just with gcc instead of g++).  My file, main.c, is located in CSFML-2.0-rc, so it's in the same folder as include, lib and share are.

Compile:
Quote
$ gcc -c main.c -Iinclude

Build executable:
Quote
$ gcc main.o -o sfml-app -Llib -lcsfml-graphics

/usr/bin/ld: warning: libsfml-graphics.so.2, needed by lib/libcsfml-graphics.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libsfml-window.so.2, needed by lib/libcsfml-graphics.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libsfml-system.so.2, needed by lib/libcsfml-graphics.so, not found (try using -rpath or -rpath-link)
lib/libcsfml-graphics.so: undefined reference to `sf::Window::getPosition() const'
lib/libcsfml-graphics.so: undefined reference to `sf::String::toAnsiString(std::locale const&) const'
...
So it's the same result, just without the overhead from the IDE.

The error message tells me to use the -rpath option, but I neither know how to use it nor what exactly the option does. Since the error is not related to runtime (isn't it?), why must I set the "runtime" path?

EDIT: I tried to involve the -rpath option this way:
Quote
daniel@daniel-desktop:~/CSFML-2.0-rc$ gcc main.o -o sfml-app -Llib -lcsfml-graphics -Wl,-rpath /home/daniel/CSFML-2.0-rc/lib
But it's still the same error.

4
C / Problems builind an application with sfml2
« on: June 11, 2012, 10:20:50 pm »
Hello,

I think this problem is not related to the library itself, but I'm hoping to get some support here anyway. I got the RC (C-binding) from the download section and copied the folder to my project location. After I included the libraries and include directory to my project properties in Netbeans, it now generates following gcc call to compile the application:

Quote
gcc -o dist/Debug/GNU-Linux-x86/netspace build/Debug/GNU-Linux-x86/main.o -Lsfml/lib -Wl,-rpath sfml/lib -lcsfml-audio -lcsfml-graphics -lcsfml-network -lcsfml-system -lcsfml-window

ld's response is this:
Quote
/usr/bin/ld: warning: libsfml-graphics.so.2, needed by sfml/lib/libcsfml-graphics.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libsfml-window.so.2, needed by sfml/lib/libcsfml-graphics.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libsfml-system.so.2, needed by sfml/lib/libcsfml-graphics.so, not found (try using -rpath or -rpath-link)
And tons of undefined reference, like
Quote
sfml/lib/libcsfml-graphics.so: undefined reference to `sf::Window::getPosition() const'

How to solve this? The -rpath option is set to sfml/lib, the location of all *.so and *.so.2 files (so they're in the -rpath). Why doesn't ld find those libraries?

Thanks for any response

Pages: [1]