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

Author Topic: Problems with compiling a Code::Blocks project  (Read 2568 times)

0 Members and 1 Guest are viewing this topic.

el0x

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Problems with compiling a Code::Blocks project
« 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?

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Problems with compiling a Code::Blocks project
« Reply #1 on: November 02, 2018, 01:39:05 pm »
did you download a Visual C++ version of SFML? or a GCC version?
Visit my game site (and hopefully help funding it? )
Website | IndieDB

el0x

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Problems with compiling a Code::Blocks project
« Reply #2 on: November 02, 2018, 01:44:45 pm »
the GCC version

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Problems with compiling a Code::Blocks project
« Reply #3 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
Visit my game site (and hopefully help funding it? )
Website | IndieDB

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10818
    • View Profile
    • development blog
    • Email
Re: Problems with compiling a Code::Blocks project
« Reply #4 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

sciarya

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Problems with compiling a Code::Blocks project
« Reply #5 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!

 

anything