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

Pages: [1]
1
General / SFML 2.0 linking issue
« on: December 04, 2011, 06:37:37 pm »
I meant in the 1.6 getting started tutorial, sorry :) Same place I lifted the sample code.

2
General / SFML 2.0 linking issue
« on: December 04, 2011, 04:12:38 pm »
I'd misunderstood what that was for - I have recompiled with that set to FALSE now.

Adding that define solved it - the project builds perfectly now - thanks :D

SFML_STATIC isn't mentioned in the tutorial, incidentally... which would be why I didn't put it in.

3
General / SFML 2.0 linking issue
« on: December 04, 2011, 03:30:14 pm »
I'm relatively new to C++ etc, so I'm sure I'm doing something wrong or missing something, but I'm having trouble getting SFML 2.0 to work.

I'm using Code::Blocks 10.05 as my IDE, and my compiler is MinGW (the TDM-GCC distribution, version 4.6.1).

I have followed the installation tutorial, and have compiled both the Debug and Release versions (static) without errors. (There were some errors initially, as the TDM install does not include the files libgdi32.a, libopengl32.a, libwinmm.a or libws2_32.a - they were present in the SFML 1.6 zip though so I copied them over from there, and then everything worked fine.)

In CMake, I have set BUILD_SHARED_LIBS to FALSE, STATIC_STD_LIBS to TRUE, and have altered the two compiler exes to x86_64-w64-mingw32-g++.exe and x86_64-w64-mingw32-gcc.exe, to match what I use in code::blocks, as per the TDM instructions. I have done it with the default g++.exe and gcc.exe with identical results.

In Code::Blocks I started a new project, copied in the code from the 1.6 tutorial:
Code: [Select]
#include <SFML/System.hpp>
#include <iostream>

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

    return 0;
}


and I have set up search directories (compiler points to \include, linker points to \lib) in the global settings, and in the project build options I have set link options -lsfml-system-s-d for debug and -lsfml-system-s for release. I have no #defines set.

When I build for debug I get the following errors:
Code: [Select]
D:/Development/Projects/SFML Test/main.cpp:6: undefined reference to `__imp__ZN2sf5ClockC1Ev'
D:/Development/Projects/SFML Test/main.cpp:9: undefined reference to `__imp__ZNK2sf5Clock14GetElapsedTimeEv'
D:/Development/Projects/SFML Test/main.cpp:10: undefined reference to `__imp__ZN2sf5SleepEj'
D:/Development/Projects/SFML Test/main.cpp:7: undefined reference to `__imp__ZNK2sf5Clock14GetElapsedTimeEv'


and for release:
Code: [Select]
obj\Release\main.o:main.cpp:(.text.startup+0x19): undefined reference to `__imp__ZN2sf5ClockC1Ev'
obj\Release\main.o:main.cpp:(.text.startup+0x20): undefined reference to `__imp__ZNK2sf5Clock14GetElapsedTimeEv'
obj\Release\main.o:main.cpp:(.text.startup+0x2f): undefined reference to `__imp__ZN2sf5SleepEj'


I am stumped!

Pages: [1]
anything