1
General / Hello world will not link, mingw
« on: February 07, 2012, 09:37:25 am »
I just needed to put the libraries after the source files :|
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.
#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;
}
g++ -I/c/sfml/include -L/c/sfml/lib -lsfml-system test.cpp
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