From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: is getting OpenGL to work with Ada a lost cause? Date: Sun, 3 Aug 2014 13:56:19 +0200 Organization: cbb software GmbH Message-ID: <1lvqvd5q7gxl0.1ezs9o63cnam4$.dlg@40tude.net> References: <64ff459f-98c0-4fab-bcdd-d9fafe3311e6@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: qHNcUCBwwd01dPSBp/L1cg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:21420 Date: 2014-08-03T13:56:19+02:00 List-Id: On Sun, 3 Aug 2014 03:27:28 -0700 (PDT), jsquirek@gmail.com wrote: > Yes, I was referring to the fact that although bindings are easy to come > across, finding a project that links to the proper dlls in Windows can be > difficult if you are not familiar with how Windows works. Yes, but that is not Ada stuff. All the mess with OpenGL libraries was created by OpenGL providers and maintainers. Ada cannot heal all wounds of the world. > Especially since > the Glut and SDL libraries will have to be the right bit size and > generally downloaded and linked to separately. > > e.g. This is not straight forward. > project My_Project is > --... > Switch_Linker :=( > External("WinDir") & "\System32\opengl32.dll", > ".\SDL32.dll" -- Must be downloaded from https://www.libsdl.org/download-2.0.php > package Linker is > for Default_Switches("Ada") use Switch_Linker; > end Linker; > end My_Project; When you are working with bindings it is better to create a library project for the bindings. There are basically two proper ways (and many IMO wrong ones) to reference an external library: 1. An external library project to "with" in the bindings project: project opengl32 is for Externally_Built use "true"; for Source_Files use (); for Library_Dir use "."; for Library_Name use "opengl32"; for Library_Kind use "dynamic"; end opengl32; with "opengl32.gpr"; project My_Bindings is ... end My_Bindings; 2. Linker_Options in the bindings project: project My_Bindings is ... package Linker is for Linker_Options use ("-lopengl32"); end Linker; end My_Bindings; Any application project would simply with "my_bindings.gpr"; this will adjust the linker options as necessary. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de