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

Pages: [1]
1
General / [Windows 7][Mingw][Cmake] Once again about building
« on: September 13, 2019, 10:00:00 pm »
Hi everybody!
Once I tried to build my project statically so that I will not have to copy dll's files to my build directory.
I am using Cmake and Mingw32 on windows 7.
This is my CmakeLists.txt
#Change this if you need to target a specific CMake version
cmake_minimum_required(VERSION 2.6)

# Enable debug symbols by default
# must be done before project() statement
if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
endif()
# (you can also set it on the command line: -D CMAKE_BUILD_TYPE=Release)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

project(g)

# Set version information in a config.h file
set(myproject_VERSION_MAJOR 1)
set(myproject_VERSION_MINOR 0)
configure_file(
  "${PROJECT_SOURCE_DIR}/config.h.in"
  "${PROJECT_BINARY_DIR}/config.h"
  )
include_directories("${PROJECT_SOURCE_DIR}/inc")

# Define sources and executable
set(EXECUTABLE_NAME "g")

set(SOURCES
    ${PROJECT_SOURCE_DIR}/src/xx.cpp ${PROJECT_SOURCE_DIR}/inc/x.h
    ${PROJECT_SOURCE_DIR}/src/xx.cpp ${PROJECT_SOURCE_DIR}/inc/x.h
    ${PROJECT_SOURCE_DIR}/src/xx.cpp ${PROJECT_SOURCE_DIR}/inc/x.h
        ${PROJECT_SOURCE_DIR}/src/xx.cpp ${PROJECT_SOURCE_DIR}/inc/x.h
        ${PROJECT_SOURCE_DIR}/src/xx.cpp ${PROJECT_SOURCE_DIR}/inc/x.h
        ${PROJECT_SOURCE_DIR}/src/xx.cpp ${PROJECT_SOURCE_DIR}/inc/x.h
        ${PROJECT_SOURCE_DIR}/src/xx.cpp ${PROJECT_SOURCE_DIR}/inc/x.h
        ${PROJECT_SOURCE_DIR}/src/xx.cpp ${PROJECT_SOURCE_DIR}/inc/x.h)

add_executable(${EXECUTABLE_NAME} ${PROJECT_SOURCE_DIR}/src/main.cpp ${SOURCES})
target_link_libraries(${EXECUTABLE_NAME} ${OBJS})

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})

#Find any version 2.X of SFML
find_package(SFML 2 REQUIRED network audio graphics window system)
if(SFML_FOUND)
  include_directories(${SFML_INCLUDE_DIR})
  target_link_libraries(${EXECUTABLE_NAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
endif()

find_package( SFGUI REQUIRED )
if(SFGUI_FOUND)
        include_directories( ${SFGUI_INCLUDE_DIR} )
        target_link_libraries( ${EXECUTABLE_NAME} ${SFGUI_LIBRARY} )
endif()

# Install target
install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)

# CPack packaging
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_PACKAGE_VERSION_MAJOR "${myproject_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${myproject_VERSION_MINOR}")
include(CPack)

 

Ive changed filenames on purpose  to "xx" and "x".

This is how my SFML and SFGUI directories on "C:" looks like:

SFGUI directory:

Cmake-gui:

Powershell after run "mingw32-make.exe":
CMakeFiles\g.dir/objects.a(main.cpp.obj): In function `ZN9__gnu_cxx13new_allocatorIN3sfg5SFGUIEE9constructIS2_JEEEv
PT_DpOT0_':
c:/mingw/lib/gcc/mingw32/6.3.0/include/c++/ext/new_allocator.h:120: undefined reference to `_imp___ZN3sfg5SFGUIC1Ev'
CMakeFiles\g.dir/objects.a(main.cpp.obj): In function `ZN9__gnu_cxx13new_allocatorIN3sfg5SFGUIEE7destroyIS2_EEvPT_'
c:/mingw/lib/gcc/mingw32/6.3.0/include/c++/ext/new_allocator.h:124: undefined reference to `_imp___ZN3sfg5SFGUID1Ev'
CMakeFiles\g.dir/objects.a(GameView.cpp.obj): In function `ZN8GameView4drawEv':
/src/GameView.cpp:54: undefined reference to `_imp___ZN3sfg5SFGUI7DisplayERN2sf12RenderWindowE'
/src/GameView.cpp:57: undefined reference to `_imp___ZN3sfg7Desktop6UpdateEf'
CMakeFiles\g.dir/objects.a(GameView.cpp.obj): In function `ZN8GameView13processEventsEv':
/src/GameView.cpp:81: undefined reference to `_imp___ZN3sfg7Desktop11HandleEventERK
CMakeFiles\g.dir/objects.a(GameView.cpp.obj): In function `ZN8GameView13createWidgetsEv':
/src/GameView.cpp:154: undefined reference to `_imp___ZN3sfg6Window6CreateEc'
/src/GameView.cpp:155: undefined reference to `_imp___ZN3sfg6Window6CreateEc'
/src/GameView.cpp:156: undefined reference to `_imp___ZN3sfg5Label6CreateERKN2sf6St
/src/GameView.cpp:157: undefined reference to `_imp___ZN3sfg5Label6CreateERKN2sf6St
/src/GameView.cpp:158: undefined reference to `_imp___ZN3sfg8ComboBox6CreateEv'
/src/GameView.cpp:159: undefined reference to `_imp___ZN3sfg5Label6CreateERKN2sf6St
/src/GameView.cpp:160: undefined reference to `_imp___ZN3sfg5Frame6CreateERKN2sf6St
/src/GameView.cpp:161: undefined reference to `_imp___ZN3sfg5Frame6CreateERKN2sf6St
/src/GameView.cpp:162: undefined reference to `_imp___ZN3sfg6Button6CreateERKN2sf6S
/src/GameView.cpp:163: undefined reference to `_imp___ZN3sfg6Button6CreateERKN2sf6S
/src/GameView.cpp:164: undefined reference to `_imp___ZN3sfg3Box6CreateENS0_11Orien
/src/GameView.cpp:165: undefined reference to `_imp___ZN3sfg5Fixed6CreateEv'
/src/GameView.cpp:166: undefined reference to `_imp___ZN3sfg5Fixed6CreateEv'
/src/GameView.cpp:167: undefined reference to `_imp___ZN3sfg3Box6CreateENS0_11Orien
/src/GameView.cpp:169: undefined reference to `_imp___ZN3sfg7Context3GetEv'
/src/GameView.cpp:169: undefined reference to `_imp___ZNK3sfg7Context9GetEngineEv'
CMakeFiles\g.dir/objects.a(GameView.cpp.obj): In function `ZN8GameView17initializeWidgetsEv':
/src/GameView.cpp:176: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_p
trINS_6WidgetEERKN2sf7Vector2IfEE'
/src/GameView.cpp:177: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_p
trINS_6WidgetEERKN2sf7Vector2IfEE'
/src/GameView.cpp:178: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_p
trINS_6WidgetEERKN2sf7Vector2IfEE'
/src/GameView.cpp:179: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_p
trINS_6WidgetEERKN2sf7Vector2IfEE'
/src/GameView.cpp:180: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_p
trINS_6WidgetEERKN2sf7Vector2IfEE'
/src/GameView.cpp:181: undefined reference to `_imp___ZN3sfg3Box4PackESt10shared_pt
rINS_6WidgetEEbb'
/src/GameView.cpp:182: undefined reference to `_imp___ZN3sfg9Container3AddESt10shar
ed_ptrINS_6WidgetEE'
/src/GameView.cpp:184: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_p
trINS_6WidgetEERKN2sf7Vector2IfEE'
/src/GameView.cpp:185: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_p
trINS_6WidgetEERKN2sf7Vector2IfEE'
/src/GameView.cpp:186: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_p
trINS_6WidgetEERKN2sf7Vector2IfEE'
/src/GameView.cpp:187: undefined reference to `_imp___ZN3sfg3Box4PackESt10shared_pt
rINS_6WidgetEEbb'
/src/GameView.cpp:188: undefined reference to `_imp___ZN3sfg9Container3AddESt10shar
ed_ptrINS_6WidgetEE'
/src/GameView.cpp:190: undefined reference to `_imp___ZN3sfg7Desktop3AddESt10shared
_ptrINS_6WidgetEE'
/src/GameView.cpp:191: undefined reference to `_imp___ZN3sfg7Desktop3AddESt10shared
_ptrINS_6WidgetEE'
/src/GameView.cpp:194: undefined reference to `_imp___ZN3sfg6Window8SetStyleEc'
/src/GameView.cpp:195: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:198: undefined reference to `_imp___ZN3sfg6Window8SetStyleEc'
/src/GameView.cpp:200: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:202: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:204: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:206: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:207: undefined reference to `_imp___ZN3sfg4Misc12SetAlignmentERKN
2sf7Vector2IfEE'
/src/GameView.cpp:209: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:210: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:211: undefined reference to `_imp___ZN3sfg4Misc12SetAlignmentERKN
2sf7Vector2IfEE'
/src/GameView.cpp:212: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:213: undefined reference to `_imp___ZN3sfg4Misc12SetAlignmentERKN
2sf7Vector2IfEE'
/src/GameView.cpp:215: undefined reference to `_imp___ZN3sfg8ComboBox10AppendItemER
KN2sf6StringE'
/src/GameView.cpp:216: undefined reference to `_imp___ZN3sfg8ComboBox10AppendItemER
KN2sf6StringE'
/src/GameView.cpp:218: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:221: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationE
RKN2sf4RectIfEE'
/src/GameView.cpp:222: undefined reference to `_imp___ZN3sfg7Desktop12BringToFrontE
St10shared_ptrIKNS_6WidgetEE'
CMakeFiles\g.dir/objects.a(GameView.cpp.obj): In function `ZN3sfg7DesktopC1Ev':
C:/PROGRA~2/SFGUI/include/SFGUI/Desktop.hpp:24: undefined reference to `_imp___ZN3sfg7ContextC1Ev'
CMakeFiles\g.dir/objects.a(GameView.cpp.obj): In function `ZN3sfg6Engine11SetPropertyIfEEbRKNSt7__cxx1112basic_stri
ngIcSt11char_traitsIcESaIcEEES9_RKT_':
C:/PROGRA~2/SFGUI/include/SFGUI/Engine.inl:48: undefined reference to `_imp___ZN3sfg6Engine13SetPropertiesERKNSt7__cxx11
12basic_stringIcSt11char_traitsIcESaIcEEE'
CMakeFiles\g.dir/objects.a(UI.cpp.obj): In function `ZN2UI13createWidgetsEv':
/src/UI.cpp:35: undefined reference to `_imp___ZN3sfg5Image6CreateERKN2sf5ImageE'
/src/UI.cpp:36: undefined reference to `_imp___ZN3sfg5Image6CreateERKN2sf5ImageE'
/src/UI.cpp:37: undefined reference to `_imp___ZN3sfg5Fixed6CreateEv'
/src/UI.cpp:38: undefined reference to `_imp___ZN3sfg5Fixed6CreateEv'
/src/UI.cpp:39: undefined reference to `_imp___ZN3sfg3Box6CreateENS0_11OrientationE
f'
/src/UI.cpp:40: undefined reference to `_imp___ZN3sfg3Box6CreateENS0_11OrientationE
f'
/src/UI.cpp:41: undefined reference to `_imp___ZN3sfg6Window6CreateEc'
/src/UI.cpp:42: undefined reference to `_imp___ZN3sfg6Window6CreateEc'
/src/UI.cpp:43: undefined reference to `_imp___ZN3sfg6Button6CreateERKN2sf6StringE'

/src/UI.cpp:44: undefined reference to `_imp___ZN3sfg6Button6CreateERKN2sf6StringE'

/src/UI.cpp:45: undefined reference to `_imp___ZN3sfg6Button6CreateERKN2sf6StringE'

/src/UI.cpp:46: undefined reference to `_imp___ZN3sfg6Button6CreateERKN2sf6StringE'

/src/UI.cpp:47: undefined reference to `_imp___ZN3sfg6Button6CreateERKN2sf6StringE'

CMakeFiles\g.dir/objects.a(UI.cpp.obj):/src/UI.cpp:48: more undefined referenc
es to `_imp___ZN3sfg6Button6CreateERKN2sf6StringE' follow
CMakeFiles\g.dir/objects.a(UI.cpp.obj): In function `ZN2UI17initializeWidgetsEv':
/src/UI.cpp:56: undefined reference to `_imp___ZN3sfg5Image8SetImageERKN2sf5ImageE'

/src/UI.cpp:57: undefined reference to `_imp___ZN3sfg5Image8SetImageERKN2sf5ImageE'

/src/UI.cpp:58: undefined reference to `_imp___ZN3sfg6Widget8SetStateENS0_5StateE'
/src/UI.cpp:59: undefined reference to `_imp___ZN3sfg6Widget8SetStateENS0_5StateE'
/src/UI.cpp:60: undefined reference to `_imp___ZN3sfg8ComboBox6CreateEv'
/src/UI.cpp:61: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_ptrINS_6
WidgetEERKN2sf7Vector2IfEE'
/src/UI.cpp:62: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_ptrINS_6
WidgetEERKN2sf7Vector2IfEE'
/src/UI.cpp:63: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_ptrINS_6
WidgetEERKN2sf7Vector2IfEE'
/src/UI.cpp:64: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_ptrINS_6
WidgetEERKN2sf7Vector2IfEE'
/src/UI.cpp:65: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_ptrINS_6
WidgetEERKN2sf7Vector2IfEE'
/src/UI.cpp:67: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4
RectIfEE'
/src/UI.cpp:69: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4
RectIfEE'
/src/UI.cpp:71: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4
RectIfEE'
/src/UI.cpp:73: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4
RectIfEE'
/src/UI.cpp:75: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4
RectIfEE'
/src/UI.cpp:76: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_ptrINS_6
WidgetEERKN2sf7Vector2IfEE'
/src/UI.cpp:77: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_ptrINS_6
WidgetEERKN2sf7Vector2IfEE'
/src/UI.cpp:78: undefined reference to `_imp___ZN3sfg5Fixed3PutESt10shared_ptrINS_6
WidgetEERKN2sf7Vector2IfEE'
/src/UI.cpp:80: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4RectIfEE'
/src/UI.cpp:81: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4RectIfEE'
/src/UI.cpp:83: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4RectIfEE'
/src/UI.cpp:84: undefined reference to `_imp___ZN3sfg3Box4PackESt10shared_ptrINS_6WidgetEEbb'
/src/UI.cpp:85: undefined reference to `_imp___ZN3sfg3Box4PackESt10shared_ptrINS_6WidgetEEbb'
/src/UI.cpp:86: undefined reference to `_imp___ZN3sfg9Container3AddESt10shared_ptrINS_6WidgetEE'
/src/UI.cpp:87: undefined reference to `_imp___ZN3sfg9Container3AddESt10shared_ptrINS_6WidgetEE'
/src/UI.cpp:88: undefined reference to `_imp___ZN3sfg7Desktop3AddESt10shared_ptrINS_6WidgetEE'
/src/UI.cpp:89: undefined reference to `_imp___ZN3sfg7Desktop3AddESt10shared_ptrINS_6WidgetEE'
/src/UI.cpp:90: undefined reference to `_imp___ZN3sfg7Desktop3AddESt10shared_ptrINS_6WidgetEE'
/src/UI.cpp:91: undefined reference to `_imp___ZN3sfg6Window8SetStyleEc'
/src/UI.cpp:92: undefined reference to `_imp___ZN3sfg6Window8SetTitleERKN2sf6StringE'
/src/UI.cpp:93: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4RectIfEE'
/src/UI.cpp:94: undefined reference to `_imp___ZN3sfg6Window8SetTitleERKN2sf6StringE'
/src/UI.cpp:96: undefined reference to `_imp___ZN3sfg6Window8SetStyleEc'
/src/UI.cpp:98: undefined reference to `_imp___ZN3sfg6Widget13SetAllocationERKN2sf4RectIfEE'
/src/UI.cpp:99: undefined reference to `_imp___ZN3sfg6Widget4ShowEb'
CMakeFiles\g.dir/objects.a(UI.cpp.obj): In function `operator()':
/src/UI.cpp:104: undefined reference to `_imp___ZN3sfg7Desktop12BringToFrontESt10shared_ptrIKNS_6WidgetEE'
/src/UI.cpp:105: undefined reference to `_imp___ZN3sfg6Widget4ShowEb'
/src/UI.cpp:106: undefined reference to `_imp___ZN3sfg6Widget8SetStateENS0_5StateE'
/src/UI.cpp:109: undefined reference to `_imp___ZN3sfg6Widget4ShowEb'
/src/UI.cpp:110: undefined reference to `_imp___ZN3sfg6Widget8SetStateENS0_5StateE'
/src/UI.cpp:117: undefined reference to `_imp___ZN3sfg6Widget4ShowEb'
/src/UI.cpp:118: undefined reference to `_imp___ZN3sfg6Widget8SetStateENS0_5StateE'
/src/UI.cpp:119: undefined reference to `_imp___ZN3sfg7Desktop12BringToFrontESt10shared_ptrIKNS_6WidgetEE'
/src/UI.cpp:128: undefined reference to `_imp___ZNK3sfg8ComboBox15GetSelectedTextEv'
CMakeFiles\g.dir/objects.a(UI.cpp.obj): In function `ZN2UI11bindSignalsEv':
/src/UI.cpp:103: undefined reference to `_imp___ZN3sfg6Window13OnCloseButtonE'
/src/UI.cpp:103: undefined reference to `_imp___ZN3sfg6Object9GetSignalERj'
/src/UI.cpp:107: undefined reference to `_imp___ZN3sfg6Signal7ConnectESt8functionIFvvEE'
/src/UI.cpp:108: undefined reference to `_imp___ZN3sfg6Widget11OnLeftClickE'
/src/UI.cpp:108: undefined reference to `_imp___ZN3sfg6Object9GetSignalERj'
/src/UI.cpp:111: undefined reference to `_imp___ZN3sfg6Signal7ConnectESt8functionIFvvEE'
/src/UI.cpp:112: undefined reference to `_imp___ZN3sfg6Widget11OnLeftClickE'
/src/UI.cpp:112: undefined reference to `_imp___ZN3sfg6Object9GetSignalERj'
/src/UI.cpp:114: undefined reference to `_imp___ZN3sfg6Signal7ConnectESt8functionIFvvEE'
/src/UI.cpp:116: undefined reference to `_imp___ZN3sfg6Widget11OnLeftClickE'
/src/UI.cpp:116: undefined reference to `_imp___ZN3sfg6Object9GetSignalERj'
/src/UI.cpp:121: undefined reference to `_imp___ZN3sfg6Signal7ConnectESt8functionIFvvEE'
/src/UI.cpp:122: undefined reference to `_imp___ZN3sfg6Widget11OnLeftClickE'
/src/UI.cpp:122: undefined reference to `_imp___ZN3sfg6Object9GetSignalERj'
/src/UI.cpp:125: undefined reference to `_imp___ZN3sfg6Signal7ConnectESt8functionIFvvEE'
/src/UI.cpp:127: undefined reference to `_imp___ZN3sfg8ComboBox8OnSelectE'
/src/UI.cpp:127: undefined reference to `_imp___ZN3sfg6Object9GetSignalERj'
/src/UI.cpp:129: undefined reference to `_imp___ZN3sfg6Signal7ConnectESt8functionIFvvEE'
CMakeFiles\g.dir/objects.a(UI.cpp.obj): In function `ZN2UI12addMapToListENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE':
/src/UI.cpp:133: undefined reference to `_imp___ZN3sfg8ComboBox10AppendItemERKN2sf6StringE'
CMakeFiles\g.dir/objects.a(UI.cpp.obj): In function `ZN2UI4drawEv':
/src/UI.cpp:138: undefined reference to `_imp___ZN3sfg5SFGUI7DisplayERN2sf12RenderWindowE'
/src/UI.cpp:139: undefined reference to `_imp___ZN3sfg7Desktop6UpdateEf'
CMakeFiles\g.dir/objects.a(UI.cpp.obj): In function `ZN2UI13processEventsEv':
/src/UI.cpp:146: undefined reference to `_imp___ZN3sfg7Desktop11HandleEventERKN2sf5EventE'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\g.dir\build.make:318: recipe for target 'g.exe' failed
mingw32-make[2]: *** [g.exe] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/g.dir/all' failed
mingw32-make[1]: *** [CMakeFiles/g.dir/all] Error 2
Makefile:150: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
 

Info about my version of mingw32:
mingw32-gcc.exe (MinGW.org GCC-6.3.0-1) 6.3.0

I downloaded SFML and SFGUI from repository and build it by myself.
My project was working when i had .lib files. After several experiments with cmake, sfml, sfgui and mingw I cant build SFML to get .lib files. I dont know how this is possible but I only get ".a" files or ".dll" or "-s.a" files.
Do You have idea what I am doing wrong? :D

Another findings:
I built sfml with cmake and mingw32 and I set "build shared" to "False" and examples from SFML are not working. Window for "pong" is showing for a one second and then closes. Strange :D

2
Ok guys Ive found the bug :D
Ive been reseting unique_ptr that was still in use. Stupid bug.
Thank You

3
Hello,
I am creating simple application with SFML. Yesterday Ive found funny "bug".
In my program I create views i.e. "MainMenuView", "GameView". Each of them holds reference to renderWindow. Game controller holds view as unique_ptr. My application stuck when I pass reference of renderWindow to new "View" and then delete this unique_ptr.
I fixed this using shared_ptr instead of reference. Is this a known issue? Am I doing something wrong?
class mainMenuView : public IView
{
public:
mainMenuView (sf::RenderWindow& w) : window(w) {}
void draw(); // drawing main menu
private:
sf::RenderWindow& window;
}

class gameView : public IView
{
public:
gameView (sf::RenderWindow& w) : window(w) {}
void draw(); // drawing map, units etc...
private:
sf::RenderWindow& window;
}

class gameController
{
public:
gameController(sf::RenderWindow& w) : window(w)
{
  std::unique_ptr<mainMenuView > uiView(new mainMenuView (window));
  currentView_ = std::move(uiView);
}
void createGame()
{
std::unique_ptr<GameView> gView(new GameView(window)); // If I wouldn't store this unique_ptr anywhere the game will stop and It doesnt work anymore
}
private:
std::unique_ptr<IView> currentView;
sf::RenderWindow& window;
}

main()
{
sf::RenderWindow w();
gameController gc(w);
game loop
{
    gc->processSignals....
    gc->update.....
    gc->draw....
}
}
 
Remember that this is only pseudo-code.

Pages: [1]
anything