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.


Topics - erus

Pages: [1]
1
General / Hello world will not link, mingw
« on: February 06, 2012, 10:34:26 pm »
Building against the current git head, which compiled fine with cmake and mingw

Code: [Select]
#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime().AsSeconds() < 5.f)
    {
        std::cout << Clock.GetElapsedTime().AsSeconds() << std::endl;
        sf::Sleep(sf::Seconds(0.5f));
    }

    return 0;
}


and compiling with:
Code: [Select]
g++ -I/c/sfml/include -L/c/sfml/lib -lsfml-system test.cpp

I get the following error:
Code: [Select]
C:\Users\tommo\Desktop\ga>g++ -I/c/sfml/include -L/c/sfml/lib -lsfml-system test.cpp
C:\Users\tommo\AppData\Local\Temp\cck7pgPY.o:test.cpp:(.text+0x16): undefined reference to `_imp___ZN2sf5ClockC1Ev'
C:\Users\tommo\AppData\Local\Temp\cck7pgPY.o:test.cpp:(.text+0x26): undefined reference to `_imp___ZNK2sf5Clock14GetElapsedTimeEv'
C:\Users\tommo\AppData\Local\Temp\cck7pgPY.o:test.cpp:(.text+0x3c): undefined reference to `_imp___ZNK2sf4Time9AsSecondsEv'
C:\Users\tommo\AppData\Local\Temp\cck7pgPY.o:test.cpp:(.text+0x73): undefined reference to `_imp___ZN2sf7SecondsEf'
C:\Users\tommo\AppData\Local\Temp\cck7pgPY.o:test.cpp:(.text+0x81): undefined reference to `_imp___ZN2sf5SleepENS_4TimeE'
C:\Users\tommo\AppData\Local\Temp\cck7pgPY.o:test.cpp:(.text+0x8f): undefined reference to `_imp___ZNK2sf5Clock14GetElapsedTimeEv'
C:\Users\tommo\AppData\Local\Temp\cck7pgPY.o:test.cpp:(.text+0xa5): undefined reference to `_imp___ZNK2sf4Time9AsSecondsEv'
collect2: ld returned 1 exit status


Has anyone else had any luck compiling with mingw?

Pages: [1]