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

Author Topic: static compile errors  (Read 5744 times)

0 Members and 1 Guest are viewing this topic.

aussiedwarf

  • Newbie
  • *
  • Posts: 2
    • View Profile
static compile errors
« on: December 06, 2009, 04:53:14 pm »
Hi all, I decided to try out CSFML today. Unfortunatly I get sompile errors whenever I try static compiling. I'm using MinGW in windows7. Using the command "gcc main.c -Wall -o main.exe -lcsfml-system" works fine but when with lcsfml-system-s i get the following errors

Code: [Select]

D:/MinGW/lib/libcsfml-system-s.a(Clock.o):Clock.cpp:(.text+0x1e): undefined reference to `__gxx_personality_sj0'

D:/MinGW/lib/libcsfml-system-s.a(Clock.o):Clock.cpp:(.text+0x34): undefined reference to `_Unwind_SjLj_Register'

D:/MinGW/lib/libcsfml-system-s.a(Clock.o):Clock.cpp:(.text+0x59): undefined reference to `sf::Clock::Clock()'

D:/MinGW/lib/libcsfml-system-s.a(Clock.o):Clock.cpp:(.text+0x64): undefined reference to `_Unwind_SjLj_Unregister'

D:/MinGW/lib/libcsfml-system-s.a(Clock.o):Clock.cpp:(.text+0x9a): undefined reference to `_Unwind_SjLj_Resume'

D:/MinGW/lib/libcsfml-system-s.a(Clock.o):Clock.cpp:(.text+0xb5): undefined reference to `sf::Clock::GetElapsedTime() const'

D:/MinGW/lib/libcsfml-system-s.a(Clock.o):Clock.cpp:(.text+0xc5): undefined reference to `sf::Clock::Reset()'

D:/MinGW/lib/libcsfml-system-s.a(Sleep.o):Sleep.cpp:(.text+0x5): undefined reference to `sf::Sleep(float)'




Heres my code for refrence
Code: [Select]

#include <stdio.h>
#include <stdlib.h>

#include <SFML/System.h>

/*
 *
 */
int main()
{

sfClock* clock = sfClock_Create();

while (sfClock_GetTime(clock) < 5.f)
{
printf("time is %f\n", sfClock_GetTime(clock));
sfSleep(0.5f);
}



sfClock_Destroy(clock);

return(0);
}


Normal SFML works fine. What am I doing wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
static compile errors
« Reply #1 on: December 06, 2009, 05:15:34 pm »
CSFML is statically linked to SFML, so if you statically link CSFML as well then you end up linking your app to SFML, which needs a C++ linker (g++).

I'd say this is not a good idea at all ;)
Laurent Gomila - SFML developer

aussiedwarf

  • Newbie
  • *
  • Posts: 2
    • View Profile
static compile errors
« Reply #2 on: December 06, 2009, 05:30:16 pm »
Makes sense. Thanks for the quick reply.

 

anything