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

Pages: [1]
1
General / Re: SFML Integration in QTCreator with CMake
« on: March 23, 2019, 06:47:55 pm »
Yep.

2
General / Re: SFML Integration in QTCreator with CMake
« on: March 23, 2019, 05:34:14 pm »
I did. I copied
sfml-system-2.dll
and
sfml-window-2.dll
into my build directory.

3
General / Re: SFML Integration in QTCreator with CMake
« on: March 23, 2019, 04:37:05 am »
Update:

I ran CMake again to configure it to build static libraries and included

set(SFML_STATIC_LIBRARIES TRUE)


in my CMakeLists.txt file and, voila, the program runs and I have a window!

I'm still curious to know what I was doing wrong with dynamic libraries, though.

4
General / Re: SFML Integration in QTCreator with CMake
« on: March 23, 2019, 01:59:52 am »
I've advanced the problem a bit, but still can't get a simple program to run.

I did the following, in order:

1) Got SFML source from github
2) Ran CMake, producing mingw32 makefile
3) Ran mingw32-make in the build directory, successfully building SFML
4) Created a QTCreator project, picked mingw32 as the compiler
5) Produced the following CMakeLists.txt:

cmake_minimum_required(VERSION 3.1)

project(LearnCMake)
set(SFML_DIR D:/Programming/Libraries/SFML)
find_package(SFML COMPONENTS window system REQUIRED)
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} sfml-window sfml-system)


6) Successfully built the program with QTCreator

When I run the project from QTCreator, it says:

"The program has unexpectedly finished."


Do I need to move/copy the libraries of interest out of the SFML build directory and into my project or something? So many hours... so close...

@eXplo0it3r:  Following your response and some other reading, I've made sure to use the same compiler for both. My SFML libraries are located at D:\Programming\Libraries\SFML\lib

Pages: [1]