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

Pages: [1]
1
General / Re: CSFML on macOS (12.x) crashes on start
« on: January 13, 2023, 11:34:05 pm »
Oh... that might be the problem. I didn't build CSFML myself but instead used the pre-compiled libraries in the github releases. I didn't think I would need to compile it from source because of that.

Also I dynamically linked CSFML and used RUNPATH.

2
General / CSFML on macOS (12.x) crashes on start
« on: January 13, 2023, 08:25:34 pm »
I tried to run a CSFML program that I compiled (and obviously linked) but when I tried to create a window the program will just crash and the error I got back was:
(click to show/hide)

I don't really know what any of this means... because I'm a Windows developer. Probably not a valid excuse though.


Here is the code:
(click to show/hide)

(click to show/hide)

3
General / Having trouble statically linking SFML for macOS (LLVM)
« on: December 09, 2022, 02:46:03 pm »
I tried to statically link SFML on macOS, version 12.3 (Monterey) and I built SFML and all its dependencies from source using the built-in LLVM toolchain (Clang) with the x86_64 architecture (because i386 and arm64 wouldn't work).

Now I'm at the stage were I'm trying to create a program with SFML, and I had it the same road block every time, ld: library not found for -lcrt0.o.

I tried doing my research on this error but I haven't been able to find anything useful that would fix this issue. I think its an issue with the libraries I'm linking (or the way I'm linking them).

Compile command:
clang++  -DSFML_STATIC -m64 -O0 -g -std=c++17 -Wall -Wpedantic -Wextra  -I "./Include" -I "./Dependencies/SFML/include"    -c "Source/Application.cpp" -o "Build/Darwin/Debug/Application.o"Linking Command:[/b]clang++   -logg -lflac -lvorbis -lvorbisenc -lvorbisfile -lopenal -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lsfml-network -static -ObjC   "Build/Darwin/Debug/Application.o"  -L "./Dependencies/SFML/Darwin"   -o "Binary/Darwin/Debug/SFMLProgram"(For the keen eyes, the "-s" was omitted because the library files themselves didn't have the prefix even though I compiled the library statically.)

4
General / Re: Having trouble statically linking SFML for Windows (MSVC).
« on: November 23, 2022, 05:21:35 am »
Oh thanks, I guess I had removed that library or just failed to realize it. Whilst this didn't fully fix the issue I'm now down to 3 unresolved externals.

clang++: error: fatal error LNK1120: 3 unresolved externals
I will try to find the last library to fill this gap. Thanks for responding.

5
General / Having trouble statically linking SFML for Windows (MSVC).
« on: November 22, 2022, 08:44:33 pm »
Hello, I'm trying to make a SFML project with all the SFML libraries being static linked, I compiled SFML from source (using the latest version of MSVC and Windows SDK 10.0.19) and I've been getting errors back to back on every device I try. It always says something about clang++: fatal error LNK1120: 46 unresolved externals. I have been trying to fix this issue for several weeks and from all the research I've done I haven't been able to fix this problem.

Maybe this is a compatibility issue, who knows?

Error codes taken straight from terminal:


Makefile:12: extraneous text after 'else' directive
Linking object files ./Build/Windows/x64/Release/application.o and creating it as Binary/Windows/x64/Release/SFMLProgram.exe
clang++  -static-libgcc -static-libstdc++  -mwindows  -lsfml-graphics-s.lib -lsfml-window-s.lib -lsfml-system-s.lib -lsfml-audio-s.lib -lsfml-network-s.lib -lgdi32 -lwinmm -lopengl32 -lfreetype -lflac -lopenal32 -logg -lvorbis -lvorbisenc -lvorbisfile  "Build/Windows/x64/Release/application.o" -L./Dependencies/SFML/Windows/MSVC/x64/Release -L./Dependencies/SFML/Windows/MSVC/x64/External  -o "Binary/Windows/x64/Release/SFMLProgram.exe"
clang++: warning: argument unused during compilation: '-static-libgcc' [-Wunused-command-line-argument]
clang++: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
sfml-window-s.lib(VideoModeImpl.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplaySettingsW referenced in function "public: static class sf::VideoMode __cdecl sf::priv::VideoModeImpl::getDesktopMode(void)" (?getDesktopMode@VideoModeImpl@priv@sf@@SA?AVVideoMode@3@XZ)
sfml-window-s.lib(CursorImpl.obj) : error LNK2019: unresolved external symbol __imp_GetDC referenced in function "public: bool __cdecl sf::priv::CursorImpl::loadFromPixels(unsigned char const *,class sf::Vector2<unsigned int>,class sf::Vector2<unsigned int>)" (?loadFromPixels@CursorImpl@priv@sf@@QEAA_NPEBEV?$Vector2@I@3@1@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp_GetDC
sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol __imp_GetDC
sfml-window-s.lib(CursorImpl.obj) : error LNK2019: unresolved external symbol __imp_ReleaseDC referenced in function "public: bool __cdecl sf::priv::CursorImpl::loadFromPixels(unsigned char const *,class sf::Vector2<unsigned int>,class sf::Vector2<unsigned int>)" (?loadFromPixels@CursorImpl@priv@sf@@QEAA_NPEBEV?$Vector2@I@3@1@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp_ReleaseDC
sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol __imp_ReleaseDC
sfml-window-s.lib(CursorImpl.obj) : error LNK2019: unresolved external symbol __imp_LoadCursorW referenced in function "public: bool __cdecl sf::priv::CursorImpl::loadFromSystem(enum sf::Cursor::Type)" (?loadFromSystem@CursorImpl@priv@sf@@QEAA_NW4Type@Cursor@3@@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp_LoadCursorW
sfml-window-s.lib(CursorImpl.obj) : error LNK2019: unresolved external symbol __imp_DestroyCursor referenced in function "public: __cdecl sf::priv::CursorImpl::~CursorImpl(void)" (??1CursorImpl@priv@sf@@QEAA@XZ)
sfml-window-s.lib(CursorImpl.obj) : error LNK2019: unresolved external symbol __imp_CreateIconIndirect referenced in function "public: bool __cdecl sf::priv::CursorImpl::loadFromPixels(unsigned char const *,class sf::Vector2<unsigned int>,class sf::Vector2<unsigned int>)" (?loadFromPixels@CursorImpl@priv@sf@@QEAA_NPEBEV?$Vector2@I@3@1@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_TrackMouseEvent referenced in function "private: void __cdecl sf::priv::WindowImplWin32::cleanup(void)" (?cleanup@WindowImplWin32@priv@sf@@AEAAXXZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_TranslateMessage referenced in function "protected: virtual void __cdecl sf::priv::WindowImplWin32::processEvents(void)" (?processEvents@WindowImplWin32@priv@sf@@MEAAXXZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_DispatchMessageW referenced in function "protected: virtual void __cdecl sf::priv::WindowImplWin32::processEvents(void)" (?processEvents@WindowImplWin32@priv@sf@@MEAAXXZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_PeekMessageW referenced in function "protected: virtual void __cdecl sf::priv::WindowImplWin32::processEvents(void)" (?processEvents@WindowImplWin32@priv@sf@@MEAAXXZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_SendMessageW referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setIcon(class sf::Vector2<unsigned int> const &,unsigned char const *)" (?setIcon@WindowImplWin32@priv@sf@@UEAAXAEBV?$Vector2@I@3@PEBE@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_RegisterDeviceNotificationW referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_DefWindowProcW referenced in function "private: static __int64 __cdecl sf::priv::WindowImplWin32::globalOnEvent(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?globalOnEvent@WindowImplWin32@priv@sf@@CA_JPEAUHWND__@@I_K_J@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_CallWindowProcW referenced in function "private: static __int64 __cdecl sf::priv::WindowImplWin32::globalOnEvent(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?globalOnEvent@WindowImplWin32@priv@sf@@CA_JPEAUHWND__@@I_K_J@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_RegisterClassW referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_UnregisterClassW referenced in function "public: virtual __cdecl sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UEAA@XZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_CreateWindowExW referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_DestroyWindow referenced in function "public: virtual __cdecl sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UEAA@XZ)
sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol __imp_DestroyWindow
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_ShowWindow referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_FlashWindowEx referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::requestFocus(void)" (?requestFocus@WindowImplWin32@priv@sf@@UEAAXXZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_SetWindowPos referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_GetKeyState referenced in function "private: void __cdecl sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned __int64,__int64)" (?processEvent@WindowImplWin32@priv@sf@@AEAAXI_K_J@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_MapVirtualKeyW referenced in function "private: static enum sf::Keyboard::Key __cdecl sf::priv::WindowImplWin32::virtualKeyCodeToSF(unsigned __int64,__int64)" (?virtualKeyCodeToSF@WindowImplWin32@priv@sf@@CA?AW4Key@Keyboard@3@_K_J@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_GetCapture referenced in function "private: void __cdecl sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned __int64,__int64)" (?processEvent@WindowImplWin32@priv@sf@@AEAAXI_K_J@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_SetCapture referenced in function "private: void __cdecl sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned __int64,__int64)" (?processEvent@WindowImplWin32@priv@sf@@AEAAXI_K_J@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_ReleaseCapture referenced in function "private: void __cdecl sf::priv::WindowImplWin32::cleanup(void)" (?cleanup@WindowImplWin32@priv@sf@@AEAAXXZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_GetForegroundWindow referenced in function "public: virtual bool __cdecl sf::priv::WindowImplWin32::hasFocus(void)const " (?hasFocus@WindowImplWin32@priv@sf@@UEBA_NXZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_SetForegroundWindow referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::requestFocus(void)" (?requestFocus@WindowImplWin32@priv@sf@@UEAAXXZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_SetWindowTextW referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setTitle(class sf::String const &)" (?setTitle@WindowImplWin32@priv@sf@@UEAAXAEBVString@3@@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_GetClientRect referenced in function "public: virtual class sf::Vector2<unsigned int> __cdecl sf::priv::WindowImplWin32::getSize(void)const " (?getSize@WindowImplWin32@priv@sf@@UEBA?AV?$Vector2@I@3@XZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_GetWindowRect referenced in function "public: virtual class sf::Vector2<int> __cdecl sf::priv::WindowImplWin32::getPosition(void)const " (?getPosition@WindowImplWin32@priv@sf@@UEBA?AV?$Vector2@H@3@XZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_AdjustWindowRect referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_SetCursor referenced in function "private: void __cdecl sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned __int64,__int64)" (?processEvent@WindowImplWin32@priv@sf@@AEAAXI_K_J@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_ScreenToClient referenced in function "private: void __cdecl sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned __int64,__int64)" (?processEvent@WindowImplWin32@priv@sf@@AEAAXI_K_J@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_MapWindowPoints referenced in function "private: void __cdecl sf::priv::WindowImplWin32::grabCursor(bool)" (?grabCursor@WindowImplWin32@priv@sf@@AEAAX_N@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_ClipCursor referenced in function "private: void __cdecl sf::priv::WindowImplWin32::grabCursor(bool)" (?grabCursor@WindowImplWin32@priv@sf@@AEAAX_N@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_GetWindowLongPtrW referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_SetWindowLongPtrW referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(struct HWND__ *)" (??0WindowImplWin32@priv@sf@@QEAA@PEAUHWND__@@@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_GetWindowThreadProcessId referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::requestFocus(void)" (?requestFocus@WindowImplWin32@priv@sf@@UEAAXXZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_CreateIcon referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setIcon(class sf::Vector2<unsigned int> const &,unsigned char const *)" (?setIcon@WindowImplWin32@priv@sf@@UEAAXAEBV?$Vector2@I@3@PEBE@Z)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_DestroyIcon referenced in function "public: virtual __cdecl sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UEAA@XZ)
sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp_ChangeDisplaySettingsW referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
sfml-window-s.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp_CreateWindowExA referenced in function "private: void __cdecl sf::priv::WglContext::createSurface(class sf::priv::WglContext *,class sf::Vector2<unsigned int> const &,unsigned int)" (?createSurface@WglContext@priv@sf@@AEAAXPEAV123@AEBV?$Vector2@I@3@I@Z)
sfml-window-s.lib(JoystickImpl.obj) : error LNK2019: unresolved external symbol __imp_RegCloseKey referenced in function "class sf::String __cdecl `anonymous namespace'::getDeviceName(unsigned int,struct tagJOYCAPSW)" (?getDeviceName@?A0xdc48ea95@@YA?AVString@sf@@IUtagJOYCAPSW@@@Z)
sfml-window-s.lib(JoystickImpl.obj) : error LNK2019: unresolved external symbol __imp_RegOpenKeyExW referenced in function "class sf::String __cdecl `anonymous namespace'::getDeviceName(unsigned int,struct tagJOYCAPSW)" (?getDeviceName@?A0xdc48ea95@@YA?AVString@sf@@IUtagJOYCAPSW@@@Z)
sfml-window-s.lib(JoystickImpl.obj) : error LNK2019: unresolved external symbol __imp_RegQueryValueExW referenced in function "class sf::String __cdecl `anonymous namespace'::getDeviceName(unsigned int,struct tagJOYCAPSW)" (?getDeviceName@?A0xdc48ea95@@YA?AVString@sf@@IUtagJOYCAPSW@@@Z)
Binary\Windows\x64\Release\SFMLProgram.exe : fatal error LNK1120: 46 unresolved externals
clang++: error: linker command failed with exit code 1120 (use -v to see invocation)
make: *** [Makefile:409: Binary/Windows/x64/Release/SFMLProgram.exe] Error 1120


The part(s) of the Makefile responsible for compiling and linking.


Library Setup

ifeq ($(msvc),1)
            linkerLibraries += \
               -L./Dependencies/SFML/Windows/MSVC/x64/Release \
               -L./Dependencies/SFML/Windows/MSVC/x64/External \

            linkerFlags += \
               -lsfml-graphics-s.lib \
               -lsfml-window-s.lib \
               -lsfml-system-s.lib \
               -lsfml-audio-s.lib \
               -lsfml-network-s.lib \
               -lgdi32 \
               -lwinmm \
               -lopengl32 \
               -lfreetype \
               -lflac \
               -lopenal32 \
               -logg \
               -lvorbis \
               -lvorbisenc \
               -lvorbisfile \

         else
                        ...



Compling and Linking.


.PHONY: all
all: $(binaryDirectory)/$(executableName)

#Link executable
$(binaryDirectory)/$(executableName):$(objects)
   @$(call echo,Linking object files $(objects) and creating it as $@)
   @$(call ReplaceDirectory,$(@D))
   $(cxxCompiler) $(linkerFlags) "$^" $(linkerLibraries) -o "$@"

#Compile sources
$(buildDirectory)/%.o:$(sourceDirectory)/%.cpp
   @$(call echo,Compiling: $< and creating it as $@)
   @$(call ReplaceDirectory,$(@D))
   $(cxxCompiler) $(cPreProcessorFlags) $(cFlags) $(includes) -c "$<" -o "$@"

#Include automatically generated dependencies
-include $(dependencies)


C++ compiler: clang++ (15..1 x64-windows-msvc)

For the record I did add the "SFML_STATIC" pre-processor flag when compiling.

Pages: [1]
anything