SFML程序崩溃

时间:2016-04-01 11:38:28

标签: c++ crash sfml clion

我最近在我的Windows 10机器上下载了SFML库,我试图将库静态链接到我的项目,但是我收到了这个错误。

cmake_minimum_required(VERSION 3.3)
project(Orc_Group_assig)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(SOURCE_FILES main.cpp)
add_executable(Orc_Group_assig ${SOURCE_FILES})
set(SFML_ROOT C:/SFML)
set(CMAKE_MODULE_PATH "C:/SFML/cmake/Modules" ${CMAKE_MODULE_PATH})
add_definitions(-DSFML_STATIC)
set(SFML_STATIC_LIBRARIES ON)
find_package(SFML 2.3.2 REQUIRED  graphics window network audio system )
if(SFML_FOUND)
    include_directories(${SFML_INCLUDE_DIR})
    target_link_libraries(Orc_Group_assig ${SFML_LIBRARIES})
    target_link_libraries(Orc_Group_assig ${SFML_DEPENDECIES})
else()
    message("FREAKING ERROR")
endif()

问题是,在文档中说:

  

在Windows和Mac OS X上,提供了所有必需的依赖项   直接使用SFML,因此您无需下载/安装任何内容。   编译将开箱即用。

我还检查并在SFML / lib中找到了所需的库。但由于某些原因,cmake无法找到它们。这是CMakeList:

<ul class="pager">
  <?php if ( get_previous_post() != null ) : ?>
    <li class="previous">
      <span class="nav-previous">
        <?php 
          $singular_nav_previous_text = apply_filters( 'tc_singular_nav_previous_text', _x( '&larr;' , 'Previous post link' , 'customizr' ) );
          previous_post_link( '%link' , '<span class="meta-nav">' . $singular_nav_previous_text . '</span> %title' ); 
        ?>
      </span>
    </li>
  <?php endif; ?>
  <?php if ( get_next_post() != null ) : ?>
    <li class="next">
      <span class="nav-next">
        <?php
          $singular_nav_next_text = apply_filters( 'tc_singular_nav_next_text', _x( '&rarr;' , 'Next post link' , 'customizr' ) );
          next_post_link( '%link' , '%title <span class="meta-nav">' . $singular_nav_next_text . '</span>' ); 
          ?>
      </span>
    </li>
  <?php endif; ?>
</ul>

我该怎么做才能让它发挥作用?

0 个答案:

没有答案