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

Pages: [1]
1
General / Re: Program immediate closes
« on: March 05, 2017, 03:44:52 am »
I was wrong, it's the sfml libraries that were failing.
I copied and pasted a cmake file from some tutorial and it worked, there must have been some small mistake that I missed.
Edit: Never mind, still not working.
cmake_minimum_required(VERSION 3.2)
project(SFMLDemo)

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

set(SOURCE_FILES main.cpp)
add_executable(SFMLDemo ${SOURCE_FILES})

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules")
find_package(SFML REQUIRED system window graphics network audio)
if (SFML_FOUND)
    include_directories(${SFML_INCLUDE_DIR})
    target_link_libraries(SFMLDemo ${SFML_LIBRARIES})
endif()

2
General / Re: Program immediate closes
« on: March 05, 2017, 01:26:06 am »
clion does almost everything through cmake, do I need to change anything in there? I'm still fairly new to cmake.

3
General / Re: Program immediate closes
« on: March 05, 2017, 01:19:17 am »
It probably should do that but it's clear that it hasn't done that because after moving the files to the working directory I can run it from clion just fine.

4
General / Re: Program immediate closes
« on: March 05, 2017, 12:36:05 am »
That helped me figure out what was wrong, I needed libgcc_s_dw2-1.dll, libstdc++-6.dll, and libwinpthread-1.dll
It works when I move those files into the launch directory but what is the proper solution for this?

5
General / Re: Program immediate closes
« on: March 04, 2017, 11:02:10 pm »
Unless I'm misunderstanding I don't think it's that, if I just try to run it it does so internally and produces an error, However if I run in debug mode it does produce a console.

Video for clarity: https://www.dropbox.com/s/usqh3l7bz4m8gwp/2017-03-05_10-59-15.mp4?dl=0
Video shows exactly what happens when I launch it as well as launching with an endless while loop at the end and front of the code

6
General / Re: Program immediate closes
« on: March 04, 2017, 02:24:38 pm »
So long as the sfml code is reachable it just closes, even if I put something such as getch() in front of all of it. I have also attempted the generic window code and that has exactly the same result.
Edit: Even break points do nothing

7
General / Program immediate closes
« on: March 04, 2017, 02:04:13 pm »
I have some fairly basic code that was copied from the tutorials and I can't seem to get anything to work properly, It's just exiting with exit code 0.
I'm using Windows 10, Clion, and 32bit MinGW that was provided on the download page with the 32bit SFML counterpart.
Image for reference: http://i.imgur.com/704iEjm.png
I've tried with multiple modules however this is the code I'm currently attempting to use:
#include "conio.h"
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>

int main()
{
    sf::Clock clock; // starts the clock
    sf::Time elapsed1 = clock.getElapsedTime();
    std::cout << elapsed1.asSeconds() << std::endl;
    clock.restart();
    sf::Time elapsed2 = clock.getElapsedTime();
    std::cout << elapsed2.asSeconds() << std::endl;
    getch();
    return 0;
}
 

The only ways I have managed to make this run is by removing the SFML code or by making it unreachable.

As of writing this it's 2am and I have been attempting this for 8-10 hours, so I'll be sleeping for the next few hours.
If my explanation of what happens is inadequate (as they often are) I can make a short video in the morning.

Pages: [1]