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

undefined reference to `fmt_dxt_decode' #326

Closed
thief-sty opened this issue Nov 13, 2019 · 5 comments
Closed

undefined reference to `fmt_dxt_decode' #326

thief-sty opened this issue Nov 13, 2019 · 5 comments

Comments

@thief-sty
Copy link
Contributor

ld throws an error when attempting to compile an executable from C code generated by hashlink through the following command:

gcc main.c -o ../main -I.  \
/usr/share/hashlink/sdl.hdll    \
/usr/share/hashlink/ui.hdll     \
/usr/share/hashlink/fmt.hdll    \
/usr/share/hashlink/openal.hdll \
/usr/share/hashlink/ui.hdll     \
/usr/share/hashlink/uv.hdll     \
-lhl -lSDL2 -lm -lopenal -lGL

(as stated here)

Here's the error message:

/usr/bin/ld: /tmp/cc5bQv9y.o: in function `hxd_Pixels_convert':
main.c:(.text+0x211d9): undefined reference to `fmt_dxt_decode'
/usr/bin/ld: main.c:(.text+0x2139f): undefined reference to `fmt_dxt_decode'
/usr/bin/ld: /tmp/cc5bQv9y.o: in function `hl_Mikktspace_compute':
main.c:(.text+0x16197a): undefined reference to `fmt_compute_mikkt_tangents'
/usr/bin/ld: /tmp/cc5bQv9y.o:(.data.rel+0x6418): undefined reference to `fmt_dxt_decode'
/usr/bin/ld: /tmp/cc5bQv9y.o:(.data.rel+0x6428): undefined reference to `fmt_compute_mikkt_tangents'
collect2: error: ld returned 1 exit status

How should I link fmt in this case?

@ncannasse
Copy link
Member

ncannasse commented Nov 13, 2019 via email

@booti386
Copy link
Contributor

This issue is fixed by #327

@thief-sty
Copy link
Contributor Author

thief-sty commented Nov 13, 2019

Thanks for the very quick fix. It does fix the problem for dxt.c but the one about mikkt.c stays:

/usr/bin/ld: /tmp/ccyPEGig.o: in function `hl_Mikktspace_compute':
main.c:(.text+0x170099): undefined reference to `fmt_compute_mikkt_tangents'
/usr/bin/ld: /tmp/ccyPEGig.o:(.data.rel+0x6428): undefined reference to `fmt_compute_mikkt_tangents'

I would like to make a merge request for that but I'd need the mikktspace.h header, which I guess I could get from there but then I'd probably have to build the whole repo, and I don't know Houdini at all.

@ncannasse
Copy link
Member

ncannasse commented Nov 13, 2019 via email

@thief-sty
Copy link
Contributor Author

Fixed it with #328.

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