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

Author Topic: Trouble building SFGUI  (Read 2361 times)

0 Members and 1 Guest are viewing this topic.

johnnywz00

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Trouble building SFGUI
« on: June 26, 2024, 10:10:37 pm »
I'm no low-level genius, and I've stumbled my way through CMake a couple of times, but I have no idea if I'm misconfiguring something or missing a step.
I used CMake GUI to generate Unix makefile, then in terminal I navigated to the build dir and entered a bare "make" command.
Can someone explain to me this (attached screenshot) Terminal error during the build process of SFGUI 0.4.0? Running MacOS 10.14.2. Thanks...
« Last Edit: June 27, 2024, 12:14:20 am by johnnywz00 »

johnnywz00

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Re: Trouble building SFGUI
« Reply #1 on: June 27, 2024, 01:00:04 am »
[EDIT: this allows the build process to complete, but the library does not seem to be fully functional in use]

Good news! I found at least a partial solution in a different thread. I have successfully built and installed SFGUI on MacOS 10.14.2 (although I haven't given it a test run yet). The problem revolved around a CoreFoundation framework in the OS, and the solution (such as it is) is to comment out certain lines in the CMakeLists.txt file.
That is to say, you can use CMake to do "configure" and "generate" (I used Unix makefiles, not XCode projects, so this solution may only apply to this approach).
Then, (before using "make"), navigate to the main SFGUI folder and open the file "CMakeLists.txt".
Here:

elseif( APPLE )
108    #find_library( COREFOUNDATION_LIBRARY CoreFoundation )
109   #mark_as_advanced( COREFOUNDATION_LIBRARY )

111   #add_library( CoreFoundation SHARED IMPORTED )
112   #set_target_properties(
113   #   CoreFoundation PROPERTIES
114   #      IMPORTED_LOCATION "${COREFOUNDATION_LIBRARY}"
115   #      INTERFACE_INCLUDE_DIRECTORIES "/System/Library/Frameworks/CoreFoundation.framework/Headers"
116   #)
   
118   #target_link_libraries( ${TARGET} PUBLIC CoreFoundation )
   set( SHARE_PATH "${CMAKE_INSTALL_PREFIX}/share/SFGUI" )
   set( LIB_PATH "lib" )
elseif( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux" )

all of the hashtag comment symbols were added by me, and if you comment out those numbered lines, save the file, then you can open Terminal and go to the build folder and execute "make".

Mods, is this info worth posting somewhere prominent for all Mac users of SFGUI to be aware of?
Thanks!
« Last Edit: June 27, 2024, 02:05:14 am by johnnywz00 »

johnnywz00

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Re: Trouble building SFGUI
« Reply #2 on: June 27, 2024, 02:07:03 am »
I have been running some of the SFGUI samples, and no text appears in any of them, including Hello World!. I am going to assume that this is because I commented out the inclusion of CoreFoundation without specifying anything as a replacement?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Trouble building SFGUI
« Reply #3 on: June 27, 2024, 09:54:59 am »
I've just updated the SFGUI CI and it seems to build fine on macOS, then again the CI isn't on the very ancient macOS 10

Not sure if there's something to consider when using macOS 10 in regards to the core foundation library.

When I use a web search to look for "can't map file corefoundation.framework" I do get some results, have you looked at them already?

I have been running some of the SFGUI samples, and no text appears in any of them, including Hello World!. I am going to assume that this is because I commented out the inclusion of CoreFoundation without specifying anything as a replacement?
Most likely, unless it just fails to load the specific font.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

johnnywz00

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Re: Trouble building SFGUI
« Reply #4 on: June 27, 2024, 05:34:39 pm »
I believe you may have been right about the font loading.  When I get time, I will try to build my own small test app with SFGUI, rather than relying on the examples, and see if things work (at least in the majority). If so, then perhaps the comment-out approach will indeed be an option that Mac users will want to be aware of (within whatever range of my OS version that produces similar behavior).
Thanks!