Hi,
I'm very fresh when it comes to coding and just recently installed SFML (and the test code provided on the tutorial page worked).
Now when i tried to draw font or an image on screen im getting this error (this one's font error)
"undefined reference to `_imp___ZN2sf4Font12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'|"
My code looks like this:
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace std;
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600, sf::Style::Default), "RPG Game");
window.setVerticalSyncEnabled(true);
sf::Text message;
sf::Font font;
font.loadFromFile("28 Days Later.ttf");
message.setFont(font);
message.setString("Hello world");
message.setCharacterSize(100);
message.setColor(sf::Color::White);
while(window.isOpen()){
sf::Event event;
while(window.pollEvent(event)){
if(event.type == sf::Event::Closed){
window.close();
}
}
window.clear(sf::Color::Black);
//draw
window.display();
}
return 0;
}
here is the line that gets error
font.loadFromFile("28 Days Later.ttf");
I've copied the font file to the bin folder, then to the folder where the exe is and finally to the project folder. Didnt work anyway.
I would appreciate any help i can get.
I'm using Codeblocks 16.01 (and the default compiler installed with it) and sfml 2.4.0