vkel icon indicating copy to clipboard operation
vkel copied to clipboard

Fails to build on Ubuntu Linux 14.04 LTS

Open andallas opened this issue 9 years ago • 3 comments

At work so I can't in a pull request yet.

On the /r/Vulkan thread about this repo, a user mentioned a fix to get this building on Ubuntu Linux 14.04 LTS:

https://www.reddit.com/r/vulkan/comments/47c5mn/vkel_simple_dynamic_vulkan_extension_loader/d0bxjbe

Specifically, it just needs to include: #include <dlfcn.h>

and then use this command to build: gcc -std=c99 -fPIC -shared -o libvkel.so vkel.c

andallas avatar Feb 24 '16 18:02 andallas

Much appreciated! I knew there was something I overlooked.

ghost avatar Feb 24 '16 19:02 ghost

Here is the output from gcc when building without the -std=c99 flag:

$ gcc -fPIC -shared -o libvkel.so vkel.c
vkel.c: In function ‘vkelIsSupported’:
vkel.c:158:4: error: ‘for’ loop initial declarations are only allowed in C99 mode
    for (uint32_t i = 0; i < count; i++)
    ^
vkel.c:158:4: note: use option -std=c99 or -std=gnu99 to compile your code

Here is the output from gcc when building without the -fPIC flag:

$ gcc -std=c99 -shared -o libvkel.so vkel.c
/usr/bin/ld: /tmp/ccsTRZmQ.o: relocation R_X86_64_32S against `.rodata' can not be used
when making a shared object; recompile with -fPIC
/tmp/ccsTRZmQ.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

m00head avatar Feb 25 '16 10:02 m00head

I'll look into it, I'm in the process of rewriting vkelIsSupported, as it kinda doesn't differentiate between instance and device.

vallentin avatar Feb 26 '16 11:02 vallentin