SFML community forums

Help => General => Topic started by: el0x on November 01, 2018, 08:09:30 pm

Title: Problems with compiling a Code::Blocks project
Post by: el0x on November 01, 2018, 08:09:30 pm
I've been trying to create an SFML project for quite a while now, but it isn't working no matter what i do.

Here is the build log after running the program:


-------------- Build: Debug in sfml_test (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -L..\..\..\..\..\SFML\SFML-2.5.1\lib -o bin\Debug\sfml_test.exe obj\Debug\main.o   -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lopengl32 -lfreetype -lwinmm -lgdi32 -mwindows
..\..\..\..\..\SFML\SFML-2.5.1\lib/libsfml-system-s-d.a(Err.cpp.obj): In function `sync':
D:/Programming/C++/Releases/_Sources/SFML/src/SFML/System/Err.cpp:87: undefined reference to `_imp____acrt_iob_func'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
 



I use SFML version 2.5.1 and Windows 10 operating system

Here are the program's settings:

Global > Search Directories > Compiler:
..\..\..\..\..\SFML\SFML-2.5.1\include


Global > Search Directories > Linker:
..\..\..\..\..\SFML\SFML-2.5.1\lib

Global >Compiler settings > #defines:
SFML_STATIC

Debug > Linker settings > Link libraries:
sfml-graphics-s-d
sfml-window-s-d
sfml-system-s-d
opengl32
freetype
winmm
gdi32
 

Release > Linker settings > Link libraries:
sfml-graphics-s
sfml-window-s
sfml-system-s
opengl32
freetype
winmm
gdi32
 


Any ideas what might be wrong here?
Title: Re: Problems with compiling a Code::Blocks project
Post by: Stauricus on November 02, 2018, 01:39:05 pm
did you download a Visual C++ version of SFML? or a GCC version?
Title: Re: Problems with compiling a Code::Blocks project
Post by: el0x on November 02, 2018, 01:44:45 pm
the GCC version
Title: Re: Problems with compiling a Code::Blocks project
Post by: Stauricus on November 02, 2018, 05:50:29 pm
try removing the -s and -d flags from the link libraries, just to see if it will work
Title: Re: Problems with compiling a Code::Blocks project
Post by: eXpl0it3r on November 03, 2018, 12:11:36 am
Googling the symbol gave me some threads about MSYS2 or MinGW issues.

Don't forget that your compiler needs to match 100% the one used to build the SFML binaries.
Title: Re: Problems with compiling a Code::Blocks project
Post by: sciarya on November 16, 2018, 11:35:51 am
my suggestion to you; though it may sound harsh!
what is your purpose of learning this sfml? if it is for learning purpose, first try to learn allegro; it's set up is kinda easy. And there is also a book related to it called All In one book of game programming.
After that you will develop a brain level of using SFML, then come here after few months again!