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

Pages: [1]
1
General / Re: Problem with undefined references
« on: March 31, 2018, 04:07:18 pm »
I figured it out so here is the solution if others have the same issue:
The problem was that codeblocks 17 is uncompatible with parts of sfml, so i had to download codeblocks 16 from sourceforge and it worked.

Codeblocks link:
https://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01mingw-setup.exe/download

2
General / Problem with undefined references
« on: March 31, 2018, 03:49:20 pm »
Hi,
I recently set up Codeblocks and sfml and have been getting this error:
Code: [Select]
mingw32-g++.exe -Wall -std=c++14 -fexceptions -std=c++14 -g -std=c++14 -IC:\Users\Zenarii\Documents\Libraries\CPP\SFML-2.4.2\include -IC:\Users\Zenarii\Documents\Libraries\CPP\SFML-2.4.2\include -c C:\Users\Zenarii\Documents\CPP\BlockBreak\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\Users\Zenarii\Documents\Libraries\CPP\SFML-2.4.2\lib -LC:\Users\Zenarii\Documents\Libraries\CPP\SFML-2.4.2\lib -o bin\Debug\BlockBreak.exe obj\Debug\main.o   -lsfml-graphics -lsfml-audio -lsfml-network -lsfml-window -lsfml-system -lsfml-graphics-d -lsfml-audio-d -lsfml-network-d -lsfml-window-d -lsfml-system-d
obj\Debug\main.o: In function `main':
C:/Users/Zenarii/Documents/CPP/BlockBreak/main.cpp:14: undefined reference to `_imp___ZN2sf7Texture12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_4RectIiEE'
C:/Users/Zenarii/Documents/CPP/BlockBreak/main.cpp:15: undefined reference to `_imp___ZN2sf7Texture12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_4RectIiEE'
C:/Users/Zenarii/Documents/CPP/BlockBreak/main.cpp:16: undefined reference to `_imp___ZN2sf7Texture12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_4RectIiEE'
C:/Users/Zenarii/Documents/CPP/BlockBreak/main.cpp:17: undefined reference to `_imp___ZN2sf7Texture12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_4RectIiEE'
collect2.exe: error: ld returned 1 exit status
when trying to build this code (there is more this is just the part creating the error)
Code: [Select]
#include <SFML/Graphics.hpp>

int main() {

  sf::RenderWindow app(sf::VideoMode(800,600), "Break Out!");

  //load textures
  sf::Texture block, paddle, background, ball;
  block.loadFromFile("images/block.png");
  paddle.loadFromFile("images/paddle.png");
  background.loadFromFile("images/background.png");
  ball.loadFromFile("images/background.png");
When searching the issue I found resources that said to reinstall SFML but that didn't work for me. Additionally the tutorial i followed also supplied this code: https://pastebin.com/DdeQ6vQw which worked fine.

Thanks for any help

Pages: [1]