Strange console messages when using TGUI 0.8.8 and SFML 2.5.1

Started by jfknyc, 21 July 2020, 04:25:12

jfknyc

(For context, I use XCode, and the project name is "Vigor2.")

I've begun using TGUI for my SFML projects, as it looks very interesting and powerful. I followed the homebrew installation instructions, adding -ltgui to Other Linker Flags in the build settings. However, when I try to use TGUI at all, I get some strange console messages.

Quote
objc[63774]: Class SFApplication is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2e78) and /usr/local/opt/sfml/lib/libsfml-window.2.5.dylib (0x100ba6198). One of the two will be used. Which one is undefined.
objc[63774]: Class SFApplicationDelegate is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2ef0) and /usr/local/opt/sfml/lib/libsfml-window.2.5.dylib (0x100ba6210). One of the two will be used. Which one is undefined.
objc[63774]: Class SFOpenGLView is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2f18) and /usr/local/opt/sfml/lib/libsfml-window.2.5.dylib (0x100ba6238). One of the two will be used. Which one is undefined.
objc[63774]: Class SFSilentResponder is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2f90) and /usr/local/opt/sfml/lib/libsfml-window.2.5.dylib (0x100ba62b0). One of the two will be used. Which one is undefined.
objc[63774]: Class SFWindow is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2fb8) and /usr/local/opt/sfml/lib/libsfml-window.2.5.dylib (0x100ba62d8). One of the two will be used. Which one is undefined.
objc[63774]: Class SFBlackView is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf3030) and /usr/local/opt/sfml/lib/libsfml-window.2.5.dylib (0x100ba6350). One of the two will be used. Which one is undefined.
objc[63774]: Class SFWindowController is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf3058) and /usr/local/opt/sfml/lib/libsfml-window.2.5.dylib (0x100ba6378). One of the two will be used. Which one is undefined.
objc[63774]: Class SFViewController is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf30a8) and /usr/local/opt/sfml/lib/libsfml-window.2.5.dylib (0x100ba63c8). One of the two will be used. Which one is undefined.
objc[63774]: Class SFApplication is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2e78) and /Users/(my username)/Library/Developer/Xcode/DerivedData/Vigor2-guhwhorcosfnsqcxuglttibdbzyk/Build/Products/Debug/Vigor2.app/Contents/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window (0x10037ee78). One of the two will be used. Which one is undefined.
objc[63774]: Class SFApplicationDelegate is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2ef0) and /Users/(my username)/Library/Developer/Xcode/DerivedData/Vigor2-guhwhorcosfnsqcxuglttibdbzyk/Build/Products/Debug/Vigor2.app/Contents/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window (0x10037eef0). One of the two will be used. Which one is undefined.
objc[63774]: Class SFOpenGLView is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2f18) and /Users/(my username)/Library/Developer/Xcode/DerivedData/Vigor2-guhwhorcosfnsqcxuglttibdbzyk/Build/Products/Debug/Vigor2.app/Contents/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window (0x10037ef18). One of the two will be used. Which one is undefined.
objc[63774]: Class SFSilentResponder is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2f90) and /Users/(my username)/Library/Developer/Xcode/DerivedData/Vigor2-guhwhorcosfnsqcxuglttibdbzyk/Build/Products/Debug/Vigor2.app/Contents/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window (0x10037ef90). One of the two will be used. Which one is undefined.
objc[63774]: Class SFWindow is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf2fb8) and /Users/(my username)/Library/Developer/Xcode/DerivedData/Vigor2-guhwhorcosfnsqcxuglttibdbzyk/Build/Products/Debug/Vigor2.app/Contents/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window (0x10037efb8). One of the two will be used. Which one is undefined.
objc[63774]: Class SFBlackView is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf3030) and /Users/(my username)/Library/Developer/Xcode/DerivedData/Vigor2-guhwhorcosfnsqcxuglttibdbzyk/Build/Products/Debug/Vigor2.app/Contents/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window (0x10037f030). One of the two will be used. Which one is undefined.
objc[63774]: Class SFWindowController is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf3058) and /Users/(my username)/Library/Developer/Xcode/DerivedData/Vigor2-guhwhorcosfnsqcxuglttibdbzyk/Build/Products/Debug/Vigor2.app/Contents/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window (0x10037f058). One of the two will be used. Which one is undefined.
objc[63774]: Class SFViewController is implemented in both /usr/local/lib/libsfml-window.2.5.dylib (0x100bf30a8) and /Users/(my username)/Library/Developer/Xcode/DerivedData/Vigor2-guhwhorcosfnsqcxuglttibdbzyk/Build/Products/Debug/Vigor2.app/Contents/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window (0x10037f0a8). One of the two will be used. Which one is undefined.
sfml-graphics requires support for OpenGL 1.1 or greater
Ensure that hardware acceleration is enabled if available

Additionally, TGUI widgets never show up on the window (though their connect methods do work) unless I draw an SFML drawable to the window before calling gui.draw(). I don't even have to give it a size or position, but unless I do that, the TGUI widgets are nowhere to be seen.

As I mentioned, I'm completely new to TGUI and I'm excited to start using it as soon as possible. Help figuring out one or both of my issues would be very appreciated.

Thanks!

texus

It seems like you have 2 SFML versions installed on your computer (probably one installed manually and another installed via homebrew, possibly while installing tgui). One is installed in /usr/local/lib/ and the other is installed in /usr/local/opt/sfml/. The TGUI homebrew package was build with one of those (the one from homebrew) and will require exactly that one SFML version in order to work, so you have to uninstall the other one.

jfknyc

Thanks; you appear to be right. Which version do you suggest I uninstall, the one I installed or the one homebrew did while installing TGUI?

texus

You should remove the one you installed yourself. They are likely identical versions and it won't matter which one is removed, but the homebrew TGUI package is build with the homebrew SFML version so you can be certain that those are compatible.

jfknyc

Quote from: texus on 21 July 2020, 15:04:04
You should remove the one you installed yourself. They are likely identical versions and it won't matter which one is removed, but the homebrew TGUI package is build with the homebrew SFML version so you can be certain that those are compatible.
Thanks; I have, though now I get this error message:

Quote
dyld: Library not loaded: @rpath/libsfml-window.2.5.dylib
  Referenced from: /usr/local/opt/sfml/lib/libsfml-graphics.2.5.dylib
  Reason: image not found
(lldb)

texus

Is there a libsfml-window.2.5.dylib file in /usr/local/opt/sfml/lib/?
You could try reinstalling sfml with homebrew, maybe something broke when uninstalling the other version?

jfknyc

Quote from: texus on 21 July 2020, 15:30:11
Is there a libsfml-window.2.5.dylib file in /usr/local/opt/sfml/lib/?
You could try reinstalling sfml with homebrew, maybe something broke when uninstalling the other version?
There is.
I installed SFML with the frameworks method. Do you know what I'd need to do to uninstall it?

texus

Not really, I don't even have a mac :)
You can probably just delete the .framework file (if you can find the folder where it gets installed to). Although I don't think the framework would be causing conflicts.

Have a look at https://stackoverflow.com/a/61536481 for a random recent guide on installing sfml. Maybe you still have some wrong directories in the library path?