SFML community forums

Help => General => Topic started by: Hawy on June 07, 2009, 08:13:17 pm

Title: Probably a noob error
Post by: Hawy on June 07, 2009, 08:13:17 pm
Hello

When i try to add the following to my program

Code: [Select]
sf::Sprite test;

It replies

  variable 'vtable for sf::Sprite' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.

What am I doing wrong.

I can use the following without a problem(that i know of)

Code: [Select]
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML window");

 sf::Image Image;
 Image.LoadFromFile("backgrounds/selectscreen.bmp");
Title: Probably a noob error
Post by: Laurent on June 07, 2009, 08:20:33 pm
Read the "getting started" tutorial and stop when you see SFML_DYNAMIC.
Title: Probably a noob error
Post by: nitram_cero on June 08, 2009, 06:40:36 pm
Quote from: "Laurent"
Read the "getting started" tutorial and stop when you see SFML_DYNAMIC.


Everyone makes this mistake, I did it myself.

Isn't there a way to get it from the compiler configuration? I know it's compiler specific, but there should be a way to avoid this.

Maybe a charitable soul could contribute this? I would if I knew how.
Title: Probably a noob error
Post by: Laurent on June 08, 2009, 06:59:20 pm
There's no way. Static and dynamic builds need different import keywords, I can only make one the default. I can't see any other way than the preprocessor to select the other one. And many other libraries use this solution.

I can't do anything against people who don't read the tutorials or spend 2 minutes to search the forum ;)
Title: Probably a noob error
Post by: Hawy on June 09, 2009, 04:32:31 pm
I had to  switch form devc++ to code blocks to get it work =P
Title: Probably a noob error
Post by: Laurent on June 09, 2009, 05:09:39 pm
This is not a solution, you're just hiding the problem.
Title: Probably a noob error
Post by: Hawy on June 09, 2009, 05:41:06 pm
Why am i hiding the problem? :D
I got it to work with codeblocks when i followed the tutorial.I just couldnt find the place to add SFML_DYNAMIC. in devc++.
Title: Probably a noob error
Post by: Laurent on June 09, 2009, 11:26:32 pm
Well, Dev-C++ is kind of dead, there's no reason to choose it over the currently developped IDEs such as Code::Blocks or QtCreator. Plus, there are screenshots in the tutorial for how to setup the project if you use code::Blocks ;)
Title: Probably a noob error
Post by: nitram_cero on June 10, 2009, 05:50:22 pm
Quote from: "Laurent"

I can't do anything against people who don't read the tutorials or spend 2 minutes to search the forum ;)


Heheh, I was just saying... as I imagined your face answering again and again the same question :D

Maybe an "IMPORTANT READ ME ZOMG!!!1.txt" file in the dlls directories could save you some trouble
 :P (just kidding)