Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

CLI SFML/MinGW FUCK

Name: Anonymous 2012-04-29 1:33

What's up /prog/, need to draw on your collective experience.

So, basically, I'm wanting to compile shit from the command line using MinGW. Beyond that, I'm learning how to include and use external libraries like SFML... Well, trying to learn.

Anyway, I've put my headers and library files in the <MinGW root>include & lib folders - so I think it's reading those. The strange part starts here...

I know that I'm using the correct version of the SFML SDK and that my source code is using members and classes that actually exist. And yet I get obfuscated stuff like this:

...dir... undefined reference to '_imp___ZN2sf6Windo5closeEv'
( this refers to a member function of the Window class - Window.isOpen() which I use in my source)

How am I getting an undefined reference? Is this something to do with the library files I'm not understanding?

Name: FIXED IT! 2012-04-30 0:08

Finally figured it out.

I had to define the macro SFML_STATIC to statically link it. I did this in the source with #define. Not sure if that's the ideal way to do it.

Then it linked with:
g++ -o main main.o -Lc:\mingw\lib\sfml -lsfml-graphics-s -lsfml-window-s -lsfml-system-s

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List