comp.lang.ada
 help / color / mirror / Atom feed
* Vulkan Ada binding and linking error on Windows 10
@ 2016-10-10 21:29 joakimds
  2016-10-11 10:43 ` G.B.
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: joakimds @ 2016-10-10 21:29 UTC (permalink / raw)


Hi!

The development progress on an Ada binding to Vulkan is now halted due to the following linker error on Windows 10:
gprbuild -PD:\projects\vulkan\examples\query_vulkan_for_information\default.gpr main.adb -p -j4 -d
gcc -c main.adb
gcc -c vk.ads
gprlib.exe vulkan_ada.lexch
ar.exe cr D:\projects\vulkan\lib\libvulkan_ada.a D:\projects\vulkan\obj\vk.o
ranlib.exe libvulkan_ada.a
gprbind main.bexch
gnatbind main.ali
gcc -c b__main.adb
gcc main.o -LC:/VulkanSDK/1.0.21.1/Bin32/ -lvulkan-1 -o main.exe
main.o:main.adb:(.text+0x104): undefined reference to `vkCreateInstance'
collect2.exe: error: ld returned 1 exit status
gprbuild: link of main.adb failed

The source code can be found here:
https://github.com/joakim-strandberg/vulkan

It is under the /examples/query_vulkan_for_information/ directory that the source code for the application that does not pass the linker stage can be found. I am using GNAT GPL 2016 on Windows 10.

An equivalent C++ application can found here:
https://github.com/joakim-strandberg/temp_cpp_vulkan
The C++ application builds without error. Why doesn't the Ada application build? Is there anyone on comp.lang.ada that can shed light on this?

For somebody totally new to Vulkan one can imagine Vulkan as "the latest version of OpenGL". To get started an update of the graphics driver to a new version that supports Vulkan may be needed followed by installation of the Vulkan SDK. More information can be found here:
https://lunarg.com/

Best regards,
Joakim Strandberg

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Vulkan Ada binding and linking error on Windows 10
  2016-10-10 21:29 Vulkan Ada binding and linking error on Windows 10 joakimds
@ 2016-10-11 10:43 ` G.B.
  2016-10-11 17:57   ` joakimds
  2016-10-14 14:20 ` Olivier Henley
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: G.B. @ 2016-10-11 10:43 UTC (permalink / raw)


On 10.10.16 23:29, joakimds@kth.se wrote:
> ranlib.exe libvulkan_ada.a
> gprbind main.bexch
> gnatbind main.ali
> gcc -c b__main.adb
> gcc main.o -LC:/VulkanSDK/1.0.21.1/Bin32/ -lvulkan-1 -o main.exe

A shot from the hip: -lvulkan-1 does not match libvulkan_ada.a,
That's assuming that your gcc can link using .a files.
I guess you did notice that.

-- 
"HOTDOGS ARE NOT BOOKMARKS"
Springfield Elementary teaching staff

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Vulkan Ada binding and linking error on Windows 10
  2016-10-11 10:43 ` G.B.
@ 2016-10-11 17:57   ` joakimds
  2016-10-11 19:03     ` joakimds
  0 siblings, 1 reply; 9+ messages in thread
From: joakimds @ 2016-10-11 17:57 UTC (permalink / raw)


> A shot from the hip: -lvulkan-1 does not match libvulkan_ada.a,
> That's assuming that your gcc can link using .a files.
> I guess you did notice that.

Thanks for the suggestion. However, the reference to `vkCreateInstance' still remains unresolved:

gcc main.o -LC:/VulkanSDK/1.0.21.1/Bin32/ -lvulkan-1 -lvulkan_ada -o main.exe
main.o:main.adb:(.text+0x104): undefined reference to `vkCreateInstance'
collect2.exe: error: ld returned 1 exit status
gprbuild: link of main.adb failed

Not sure why the C++ version of the application links with the C-library but the Ada version does not... to be continued...

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Vulkan Ada binding and linking error on Windows 10
  2016-10-11 17:57   ` joakimds
@ 2016-10-11 19:03     ` joakimds
  0 siblings, 0 replies; 9+ messages in thread
From: joakimds @ 2016-10-11 19:03 UTC (permalink / raw)


I have managed to get past the linker stage by changing

pragma Import (C, Create_Instance, "vkCreateInstance"); ---> pragma Import (StdCall, Create_Instance, "vkCreateInstance");

Now I have other issues but in run-time. Hopefully I can sort it out soon. To be continued...

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Vulkan Ada binding and linking error on Windows 10
  2016-10-10 21:29 Vulkan Ada binding and linking error on Windows 10 joakimds
  2016-10-11 10:43 ` G.B.
@ 2016-10-14 14:20 ` Olivier Henley
  2016-10-14 21:02   ` Luke A. Guest
  2016-10-20 20:27   ` joakimds
  2016-10-14 23:40 ` mariloup.champagne
  2016-10-14 23:42 ` Olivier Henley
  3 siblings, 2 replies; 9+ messages in thread
From: Olivier Henley @ 2016-10-14 14:20 UTC (permalink / raw)


Hi Joakim!

Have you check Lucretia's work? 

https://github.com/Lucretia/adavulkan

How does your binding differs?

Thx!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Vulkan Ada binding and linking error on Windows 10
  2016-10-14 14:20 ` Olivier Henley
@ 2016-10-14 21:02   ` Luke A. Guest
  2016-10-20 20:27   ` joakimds
  1 sibling, 0 replies; 9+ messages in thread
From: Luke A. Guest @ 2016-10-14 21:02 UTC (permalink / raw)


Olivier Henley <olivier.henley@gmail.com> wrote:
> Hi Joakim!
> 
> Have you check Lucretia's work? 
> 
> https://github.com/Lucretia/adavulkan
> 
> How does your binding differs?
> 
> Thx!
> 
> 

I haven't published mine yet. There's room for multiple versions.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Vulkan Ada binding and linking error on Windows 10
  2016-10-10 21:29 Vulkan Ada binding and linking error on Windows 10 joakimds
  2016-10-11 10:43 ` G.B.
  2016-10-14 14:20 ` Olivier Henley
@ 2016-10-14 23:40 ` mariloup.champagne
  2016-10-14 23:42 ` Olivier Henley
  3 siblings, 0 replies; 9+ messages in thread
From: mariloup.champagne @ 2016-10-14 23:40 UTC (permalink / raw)


kk, didnt know your repo wasnt complete. my bad.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Vulkan Ada binding and linking error on Windows 10
  2016-10-10 21:29 Vulkan Ada binding and linking error on Windows 10 joakimds
                   ` (2 preceding siblings ...)
  2016-10-14 23:40 ` mariloup.champagne
@ 2016-10-14 23:42 ` Olivier Henley
  3 siblings, 0 replies; 9+ messages in thread
From: Olivier Henley @ 2016-10-14 23:42 UTC (permalink / raw)


kk. did not notice your repo was not complete. my bad.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Vulkan Ada binding and linking error on Windows 10
  2016-10-14 14:20 ` Olivier Henley
  2016-10-14 21:02   ` Luke A. Guest
@ 2016-10-20 20:27   ` joakimds
  1 sibling, 0 replies; 9+ messages in thread
From: joakimds @ 2016-10-20 20:27 UTC (permalink / raw)


Den fredag 14 oktober 2016 kl. 16:20:23 UTC+2 skrev Olivier Henley:
> Hi Joakim!
> 
> Have you check Lucretia's work? 
> 
> https://github.com/Lucretia/adavulkan
> 
> How does your binding differs?
> 
> Thx!

Hi Olivier!

Yes, I've been aware of his repository. Even though Lucretia hasn't updated his repository in over 6 months it has been useful to me when making a Vulkan binding.

I agree with Lucretia, there's room for multiple versions and look forward to see his version when it's good and ready.

With the corrections to the Vulkan binding I made tonight it is finally possible to make at least one call to the Vulkan API successfully (the Vk.Create_Instance (..) function).

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-10-20 20:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-10 21:29 Vulkan Ada binding and linking error on Windows 10 joakimds
2016-10-11 10:43 ` G.B.
2016-10-11 17:57   ` joakimds
2016-10-11 19:03     ` joakimds
2016-10-14 14:20 ` Olivier Henley
2016-10-14 21:02   ` Luke A. Guest
2016-10-20 20:27   ` joakimds
2016-10-14 23:40 ` mariloup.champagne
2016-10-14 23:42 ` Olivier Henley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox