Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [Windows 7][Mingw][Cmake] Once again about building  (Read 1410 times)

0 Members and 1 Guest are viewing this topic.

sharky

  • Newbie
  • *
  • Posts: 3
    • View Profile
[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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: [Windows 7][Mingw][Cmake] Once again about building
« Reply #1 on: September 16, 2019, 10:51:13 am »
You should try to focus on one problem at a time and not try and figure out five things at the same time.

The linker errors you get is because it's still looking for imported symbols (thus the _imp__) which means, it's looking for shared libraries (aka DLL). If you link SFGUI statically, you also have to define SFGUI_STATIC similar to how it's done with SFML. Since you use CMake you should set the CMake variable SFGUI_STATIC_LIBRARIES before looking for the SFGUI libraries, that way it will look for the static libraries and automatically set the SFGUI_STATIC define.

As for SFML, don't forget that SFML 2.5 was migrated. The FindSFML.cmake script doesn't exist anymore in the SFML repository and the one provided by SFGUI may not always work.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/