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.


Topics - astr0wiz

Pages: [1]
1
C / Entry Point Not Found - Completely flummoxed
« on: October 02, 2016, 09:07:34 pm »
Here is the extremely simple test code I am attempting to run:

#include <SFML/Graphics.h>


int main()
{
    sfVideoMode mode = {400, 400, 32};
    sfRenderWindow* window;

    window = sfRenderWindow_create(mode, "CSFML Test", sfResize | sfClose, NULL);

    while (sfRenderWindow_isOpen(window))
    {
        sfRenderWindow_display(window);
    }
    return 0;
}

It compiles just fine in Code::Blocks.  When I run, I get the following popup:



Having successfully created several C++ SFML projects, I find myself at a complete loss.  I have no idea why that particular entry point wasn't found.  I suspected it was with opengl32.dll, so I copied it into the bin directory of the executable, but nothing changed.

Any suggestions?

Edit:
I am using the latest version of CSFML, compiled on my machine after running CMake and then using Code::Blocks to build it all.

2
C / [SOLVED] Compiling CSFML 2.3 in Windows Revisited
« on: October 01, 2016, 06:20:55 pm »
I have a Windows 10 machine and I am trying to build CSFML 2.3.  I have loaded SFML 2.4, and so this is what I am referencing.  I took the FindSFML.cmake file out of the SFML Modules directory and I placed it in the CMake Modules directory.  So far, so good.  CMake finds SFML just fine.

However, I now have a problem locating the dependent DLLs.  Here is the message:
Quote
CMake Error at D:/apps/CMake/share/cmake-3.6/Modules/FindSFML.cmake:358 (message):
  SFML found but some of its dependencies are missing ( FreeType libjpeg
  OpenAL Ogg Vorbis VorbisFile VorbisEnc FLAC)
Call Stack (most recent call first):
  src/SFML/CMakeLists.txt:26 (find_package)

These libraries are located in my System32 directory.  Now, when I compile SFML via CodeBlocks, I add these dependencies to the linker settings, but I do not need to define their location.  Just the names.

So, in order for CMake to see these dependencies, what should I do?  Copy the DLLs somewhere?  Modify a CMake setting?  Download the SDKs for the missing dependencies?

Note:
I took a look at the FindSFML.cmake script and I noticed that the dependencies are found via a macro which uses the paths in the variable FIND_SFML_PATHS.  My thinking is that I could either copy the DLLs into one of the specified paths or add C:/Windows/System32 in the FIND_SFML_PATHS list.

Any and all help will be greatly appreciated.


Update:

Copying FindSFML.cmake to the ${CMAKE_ROOT}/share/cmake-3.6/Modules directory is the first step in getting CMake to successfully configure CSFML.

The second thing to do is modify the FindSFML.cmake file so it can find the SFML dependencies.

The version of SFML (source) I have is version 2.4.0.  I do not know about previous distributions, but in this distribution the dependencies are under ${SFML_ROOT}/extlibs.  The cmake file does not look here, so it had to be tweaked.  Here is the relevant snippet from the original code in FindSFML.cmake:

    macro(find_sfml_dependency output friendlyname)
        # No lookup in environment variables (PATH on Windows), as they may contain wrong library versions
        find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH)
        if(${${output}} STREQUAL "${output}-NOTFOUND")
            unset(output)
            set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}")
        endif()
    endmacro()

The key part is the definition for PATH_SUFFIXES, which in the original file is assigned the value "lib".  By changing this to "extlibs", CMake finds everything just swell:

    find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES extlibs NO_SYSTEM_ENVIRONMENT_PATH)
    ----------------------------------------------------------------------------^^^^^^^----------------------------
  :)

So, the CMake issue has been solved.  Now I will see what happens when I attempt to compile...

Pages: [1]
anything