Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to link: undefined symbol _D6object__T8opEqualsTxC3gtd11GirFunctionQnTxQwZQBkFxQBexQBiZb #43

Open
berolinux opened this issue Jun 16, 2023 · 3 comments

Comments

@berolinux
Copy link

Trying to build gir-to-d 0.23.1 on an OpenMandriva Cooker system (ldc 1.33.0-beta2, glib 2.76.3, LLVM 16.0.4) results in

[20/20] Linking target girtod
FAILED: girtod 
ldc2  -of=girtod girtod.p/source_girtod.d.o girtod.p/source_gtd_DefReader.d.o girtod.p/source_gtd_GlibTypes.d.o girtod.p/source_gtd_GirAlias.d.o girtod.p/source_gtd_GirConstant.d.o girtod.p/source_gtd_GirEnum.d.o girtod.p/source_gtd_GirField.d.o girtod.p/source_gtd_GirFunction.d.o girtod.p/source_gtd_GirPackage.d.o girtod.p/source_gtd_GirStruct.d.o girtod.p/source_gtd_GirType.d.o girtod.p/source_gtd_GirVersion.d.o girtod.p/source_gtd_GirWrapper.d.o girtod.p/source_gtd_IndentedStringBuilder.d.o girtod.p/source_gtd_Log.d.o girtod.p/source_gtd_LinkedHasMap.d.o girtod.p/source_gtd_WrapException.d.o girtod.p/source_gtd_XMLReader.d.o -L=--allow-shlib-undefined -link-defaultlib-shared -O2 -L=-O2 -L=--no-undefined
ld.lld: error: undefined symbol: _D6object__T8opEqualsTxC3gtd11GirFunctionQnTxQwZQBkFxQBexQBiZb
>>> referenced by GirPackage.d
>>>               girtod.p/source_gtd_GirPackage.d.o:(_D3gtd12LinkedHasMap__T13LinkedHashMapTAyaTCQBq11GirFunctionQnZQBo4Node11__xopEqualsMxFKxSQDkQDj__TQCyTQCmTQCmZQDkQBwZb)
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
@EsoCoding
Copy link

This happends with the meson build, best way to build it is using the make file. The reason why it fails is because meson builds the files seperate, but as the make file shows the a group of files must be compiled as a batch at onces. If the make file is no solution, i might i have xmake file that does basicly the same as the make file. XMAKE is a interesting projeCT. I like it a lot more then then meson and gnumake files.

@ximion
Copy link
Contributor

ximion commented Jun 20, 2023

@berolinux This is probably once again a bug in LDC. It probably makes sense to file this issue against LDC, and as a temporary workaround set DFLAGS += --allinst in your environment (check if that resolves the issue).

@EsoCoding
Copy link

No it happends with any other D compiler, it only happends with build systems that the build seperate .o files. The make file does not do this, it creates one .o file containing all the others and then compiled it with the main file. I think somewhere in time, gir-to-d got changed changed, and so it does not build the files correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants