www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DSFML linking fails

reply Dmitriy <dmitriy.mihaylichenko gmail.com> writes:
Hello.

I'm using https://github.com/Jebbs/DSFML library

My env Windows 10 (x64), utils: mingw32-make, MinGW Makefiles, 
dub, dmd, ldc2, also tried with Visual Studio 2017 compilers 
(nmake, NMake Files)

I compiled build.exe util from this repository, copied SFML 
(include content) to SFML folder
and building the libraries. build passed ok, I've got 
dsfml-window.lib, dsfml-system.lib and others in lib folder.

The problem when I build my project using these libraries. The 
problem in linking:

lld-link: error: <root>: undefined symbol: sfErr_redirect
lld-link: error: <root>: undefined symbol: sfFont_getTexture
lld-link: error: <root>: undefined symbol: 
sfFont_getUnderlineThickness
lld-link: error: <root>: undefined symbol: 
sfFont_getUnderlinePosition
lld-link: error: <root>: undefined symbol: sfFont_getLineSpacing
lld-link: error: <root>: undefined symbol: sfFont_getKerning
lld-link: error: <root>: undefined symbol: sfFont_getGlyph
lld-link: error: <root>: undefined symbol: sfFont_destroy
lld-link: error: <root>: undefined symbol: sfFont_copy
lld-link: error: <root>: undefined symbol: sfFont_loadFromStream
lld-link: error: <root>: undefined symbol: sfFont_loadFromMemory
lld-link: error: <root>: undefined symbol: sfFont_loadFromFile
lld-link: error: <root>: undefined symbol: sfFont_construct
lld-link: error: <root>: undefined symbol: sfImage_flipVertically
lld-link: error: <root>: undefined symbol: 
sfImage_flipHorizontally
lld-link: error: <root>: undefined symbol: sfImage_getSize
lld-link: error: <root>: undefined symbol: sfImage_getPixelsPtr
lld-link: error: <root>: undefined symbol: sfImage_getPixel
lld-link: error: <root>: undefined symbol: sfImage_setPixel

my dub.json file next:

"sourcePaths": [
		"src"
	],
	"importPaths": [
		"src", "bin"
	],
	"targetPath": "bin",
	"version": "1.0.0",
	"configurations": [
		{
			"targetType": "executable",
			"name": "default",
			"mainSourceFile": "src/main.d"
		}
	],
	"dependencies": {},
	"libs": [
		"lib/dsfml-system",
		"lib/dsfml-graphics",
		"lib/dsfml-audio",
		"lib/dsfml-window",
		"lib/dsfml-network"
	]

What am I doing wrong, who use this lib, please help.
Dec 24 2018
next sibling parent Dmitriy <dmitriy.mihaylichenko gmail.com> writes:
I opened dsfml-system.lib file, and found 1.txt file there, it 
contains the line:

src\DSFMLC\System\CMakeFiles\dsfmlc-system.dir\Err.cpp.obj    
_sfErr_redirect

but when linking it looking for the:

lld-link: error: <root>: undefined symbol: sfErr_redirect

without a _ symbol on the beginning
Dec 24 2018
prev sibling next sibling parent reply number <putimalitze gmx.de> writes:
On Monday, 24 December 2018 at 10:08:25 UTC, Dmitriy wrote:
 Hello.

 I'm using https://github.com/Jebbs/DSFML library

 ...

 The problem when I build my project using these libraries. The 
 problem in linking:
Did you look at http://dsfml.com/docs/firstprogram.html ? I remember having to link also the dsfmlc-.. libraries.
Dec 24 2018
parent Dmitriy <dmitriy.mihaylichenko gmail.com> writes:
On Monday, 24 December 2018 at 11:07:09 UTC, number wrote:
 On Monday, 24 December 2018 at 10:08:25 UTC, Dmitriy wrote:
 Hello.

 I'm using https://github.com/Jebbs/DSFML library

 ...

 The problem when I build my project using these libraries. The 
 problem in linking:
Did you look at http://dsfml.com/docs/firstprogram.html ? I remember having to link also the dsfmlc-.. libraries.
The build description in the http://dsfml.com is outdated. On github is the newest version, he made build.d script to compile all sources include C-code and D-code, so now C-code compiles and merging with D-code compiled into each .lib file
Dec 24 2018
prev sibling parent bauss <jj_1337 live.dk> writes:
On Monday, 24 December 2018 at 10:08:25 UTC, Dmitriy wrote:
 Hello.

 I'm using https://github.com/Jebbs/DSFML library

 [...]
Create an issue here: https://github.com/Jebbs/DSFML/issues
Dec 25 2018