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

Pages: [1]
1
General / Re: Static linking in MS VS2019
« on: December 27, 2022, 08:27:51 pm »
Have you also added the path to the SFML headers (the include folder)?

[SOLVED]

Thank you for your response.
I have included headers, before I decided to go STATIC, everything worked just fine. Without headers it would not compile dynamically as well.

I have just located the problem.
Apparently static linking does not include by default some additional system libraries that are needed.
I had to add OPENGL32.LIB and FREETYPE.LIB.
Strangely dynamic linking worked without it.




2
General / [SOLVED] Static linking in MS VS2019
« on: December 27, 2022, 07:56:06 pm »
Hi everyone,

I have read all threads about static linking, and nothing works.
I have added preprocessor directive SFML_STATIC
I have such libs included :
sfml-graphics-s.lib;
sfml-window-s.lib;
sfml-system-s.lib;
sfml-network-s.lib;
sfml-audio-s.lib;
kernel32.lib;
user32.lib;
gdi32.lib;
winspool.lib;
comdlg32.lib;
advapi32.lib;
shell32.lib;
ole32.lib;
oleaut32.lib;
uuid.lib;
odbc32.lib;
odbccp32.lib;
winmm.lib;
%(AdditionalDependencies)

and still I have errors:
Build started...
1>------ Build started: Project: Game1, Configuration: Release Win32 ------
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glFlush@0
1>sfml-graphics-s.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol _glFlush@0
1>sfml-graphics-s.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol _glGetIntegerv@8
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glGetIntegerv@8
1>sfml-graphics-s.lib(GLExtensions.cpp.obj) : error LNK2001: unresolved external symbol _glGetIntegerv@8
1>sfml-graphics-s.lib(TextureSaver.cpp.obj) : error LNK2001: unresolved external symbol _glGetIntegerv@8
1>sfml-graphics-s.lib(RenderTextureImplFBO.cpp.obj) : error LNK2001: unresolved external symbol _glGetIntegerv@8
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glGetTexImage@20
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glLoadIdentity@0
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glLoadIdentity@0
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glLoadMatrixf@4
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glLoadMatrixf@4
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glMatrixMode@4
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glMatrixMode@4
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glTexImage2D@36
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glTexParameteri@12
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glBindTexture@8
1>sfml-graphics-s.lib(TextureSaver.cpp.obj) : error LNK2001: unresolved external symbol _glBindTexture@8
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glCopyTexSubImage2D@32
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glDeleteTextures@8
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glGenTextures@8
1>sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol _glTexSubImage2D@36
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Init_FreeType
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Done_FreeType
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_New_Face
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_New_Memory_Face
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Open_Face
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Done_Face
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Set_Pixel_Sizes
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Load_Char
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Get_Kerning
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Select_Charmap
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Get_Char_Index
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_MulFix
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Get_Glyph
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Glyph_To_Bitmap
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Done_Glyph
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Outline_Embolden
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Bitmap_Embolden
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Stroker_New
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Stroker_Set
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Stroker_Done
1>sfml-graphics-s.lib(Font.cpp.obj) : error LNK2001: unresolved external symbol _FT_Glyph_Stroke
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glBlendFunc@8
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glClear@4
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glClearColor@16
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glDisable@4
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glEnable@4
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glPopAttrib@0
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glPopMatrix@0
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glPushAttrib@4
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glPushMatrix@0
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glViewport@16
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glColorPointer@16
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glDisableClientState@4
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glDrawArrays@12
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glEnableClientState@4
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glPopClientAttrib@0
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glPushClientAttrib@4
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glTexCoordPointer@16
1>sfml-graphics-s.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol _glVertexPointer@16
1>sfml-graphics-s.lib(GLExtensions.cpp.obj) : error LNK2001: unresolved external symbol _glGetError@0
1>sfml-graphics-s.lib(GLExtensions.cpp.obj) : error LNK2001: unresolved external symbol _glGetString@4
1>sfml-window-s.lib(GlContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__glEnable@4
1>sfml-window-s.lib(GlContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__glGetError@0
1>sfml-window-s.lib(GlContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__glGetIntegerv@8
1>sfml-window-s.lib(GlContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__glGetString@4
1>sfml-window-s.lib(GlContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__glIsEnabled@4
1>sfml-window-s.lib(WglContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
1>sfml-window-s.lib(WglContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4
1>sfml-window-s.lib(WglContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__wglGetProcAddress@4
1>sfml-window-s.lib(WglContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
1>sfml-window-s.lib(WglContext.cpp.obj) : error LNK2001: unresolved external symbol __imp__wglShareLists@8
1>D:\_GAMEDEV\WARCABY\Release\Game1.exe : fatal error LNK1120: 64 unresolved externals
1>Done building project "Game1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Funny thing is, that if I include libs without -s, there are no errors about libs, but there is one:
Build started...
1>------ Build started: Project: Game1, Configuration: Release Win32 ------
1>Game1.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1>D:\_GAMEDEV\WARCABY\Release\Game1.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "Game1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Can anyone have a look and explain what is going on ?

Regards


3
General / Re: Why does this link chain not work (SFML static link)
« on: December 27, 2022, 06:37:00 pm »
I have  a problem with static linking and I just found this thread.
I added a preprocessor directive SFML_STATIC, and -s to all names of libraries.
Unfortunately I got lots of unresolved symbols.
When I removed the -s, it seems to be ok, except of 2 unresolved symbols sf::Color::White, and RenderStates::Default.
I am confused, preprocessor directive does not work ? Since the static libs are not linked properly, and when I switch back to dynamic libs, it is linking ok. Not exactly ok, because of 2 symbols that are unresolved.
One of them, sf::Color::White, I just replaced with sf::Color(255,255,255,255), and it's ok, but RenderStates::Default is still unresolved. Replacing it with a constant that I peek in headers would be a bit stupid. I wonder what's the reason that these symbols are undefined after adding preprocessor directive SFML_STATIC.
I have changed the order of libraries, but number of errors did not decrease, so the advice from above did not help.
Can anybody explain to me how to make properly static linking  ?

Pages: [1]