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

Pages: [1]
1
General / Re: SFML static linking
« on: July 12, 2019, 05:50:15 pm »
Still error, but this time seems it looks different.

#define SFML_STATIC

#include <iostream>
#include "SFML/Window.hpp"

int main() {
    sf::Window window(sf::VideoMode(800, 600), "test");
}
 

d:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\CyberOni\AppData\Local\Temp\ccAI5dco.o:main.cpp:(.text+0x7c): undefined reference to `sf::String::String(char const*, std::locale const&)'
d:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\CyberOni\AppData\Local\Temp\ccAI5dco.o:main.cpp:(.text+0xa0): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
d:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\CyberOni\AppData\Local\Temp\ccAI5dco.o:main.cpp:(.text+0xd7): undefined reference to `sf::Window::Window(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
d:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\CyberOni\AppData\Local\Temp\ccAI5dco.o:main.cpp:(.text+0xf8): undefined reference to `sf::Window::~Window()'
 
If I'm adding -DSFML_STATIC to compiler flags it gives me the same error message.

2
General / SFML static linking
« on: July 11, 2019, 01:12:01 pm »
I have such C++ code
#include <iostream>
#include "SFML/Window.hpp"

#define SFML_STATIC

int main() {
        sf::Window window(sf::VideoMode(800, 600), "test");
}
 

And such Makefile
CC                              := g++
DEBUG_FLAGS     := -mwindows
RELEASE_FLAGS   := -s -O3 -w -mwindows

BIN             := bin
SRC             := src
INCLUDE := -Iinclude
LIB             := -Llib

LIBRARIES := -lsfml-window-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32

EXECUTABLE      := main.exe

all: $(SRC)/*
        $(CC) $(DEBUG_FLAGS) $(INCLUDE) $(LIB) $(LIBRARIES) $^ -o $(BIN)/$(EXECUTABLE)

release: $(SRC)/*
        $(CC) $(RELEASE_FLAGS) $(INCLUDE) $(LIB) $(LIBRARIES) $^ -o $(BIN)/$(EXECUTABLE)

clean:
        $(RM) $(BIN)/$(EXECUTABLE)

run:
        ./$(BIN)/$(EXECUTABLE)
 

But I can't compile and I am geting such error
g++ -mwindows -Iinclude -Llib -lsfml-window-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32 src/main.cpp -o bin/main.exe
d:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\CyberOni\AppData\Local\Temp\ccLj2xOO.o:main.cpp:(.text+0x7c): undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
d:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\CyberOni\AppData\Local\Temp\ccLj2xOO.o:main.cpp:(.text+0xa2): undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
d:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\CyberOni\AppData\Local\Temp\ccLj2xOO.o:main.cpp:(.text+0xdb): undefined reference to `_imp___ZN2sf6WindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
d:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\CyberOni\AppData\Local\Temp\ccLj2xOO.o:main.cpp:(.text+0xfe): undefined reference to `_imp___ZN2sf6WindowD1Ev'
collect2.exe: error: ld returned 1 exit status
Makefile:15: recipe for target 'all' failed
make: *** [all] Error 1
 

Pages: [1]
anything