jrmarino / AdaBase

Thick database bindings to MySQL, PostgreSQL and SQLite for Ada
ISC License
32 stars 3 forks source link

Linker error: cannot find -lmysql #6

Open ToyMakerUSMC opened 2 years ago

ToyMakerUSMC commented 2 years ago

Please advise

/gnat/2021/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.1/ld.exe: cannot find -lmysql

Much obliged

ToyMakerUSMC

jrmarino commented 2 years ago

You didn't give much context (for example, what executable can't find mysql client library). However, generically, the error means that either you don't have mysql installed, or it's not installed in a standard system library search path.

The fix is to link with "-R" or "-Wl,-rpath," so the dynamic linker (ld) can find the library.

On Sat, Jun 11, 2022 at 10:23 AM ToyMakerUSMC @.***> wrote:

Please advise

/gnat/2021/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.1/ld.exe: cannot find -lmysql

Much obliged

ToyMakerUSMC

— Reply to this email directly, view it on GitHub https://github.com/jrmarino/AdaBase/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAISZ5VIBKYZCBIY7FGR3ZLVOSVQRANCNFSM5YQHOHXQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ToyMakerUSMC commented 2 years ago

Well, you are absolutely correct, and my apologies. This is out of my league. I only have 30 years working with Ada. Guess I need a few more decades and a couple of additional PhD's under my belt.

What appears to me at this time is: sometimes you adjust directories in the GPR file and sometimes you don't. The instructions on build and install are less than clear to me. So, leaving things exactly as the distribution package, and unzipping the files into the directory

D:\GNAT|Adabase
D:\GNAT\AdaBase>gprbuild

Adabase.prg built without modifications or incident.

However, moving to the testcases, there are some obvious problems with the default configuration.

D:\GNAT\AdaBase\testcases>gprbuild common.gpr common.gpr:1:06: imported project file "adabase" not found gprbuild: "common.gpr" processing failed

So, one would assume that somethings need adjustments and somethings don't. This is WAY over my head. So thanks for trying, and maybe I'll give it some time to mature both the documentation and the code. Meanwhile, Ada and MySQL do not play well together, and the client will be disappointed, but well acquainted with the recovery cycle.

jrmarino commented 2 years ago

hmm, my response didn't get posted. I wrote this last monday:

How are you installing adabase?  Are you just using the github source?
You may not have the adabase.gpr file in the search path. 
Back when I wrote this, the file was placed in "/<prefix>/lib/gnat" (in unix-like system). 
Now the default location used by gprbuild is /<prefix>/share/gpr".
The fixes aren't hard but you need to understand how gprbuild works.
ToyMakerUSMC commented 2 years ago

I accept that this is open-source. The source code is elegant and well designed. the management of projects, instructions on implementation and configuration are more confusing that helpful That has nothing to do with gprbuild. The reason for my dismissal of that specific comment is that if gprbuild has the proper, well coded gpr file, then it would build the executable. I have permuted of every search path, directory tree, and path command. At no point can any of the test cases build from the gpr file as delivered. So, while the gpr's are supposed to be instructive, they are not. Even statements like 'for Object_Dir use "obj/" & Common.driver;' produce errors. Your guidance to use yet another directory which is not stated in any of the documentation, and not in the library as downloaded, leads me to wonder if the code can actually work in any environment other than your own server. I can use the source code files, but little else. Certainly not the gpr's, nor the directory structures. A significant disappointment.

As for how I installed adabase, there were ZERO instructions or guidances.

jrmarino commented 2 years ago

Sorry. gprbuild changed since adabase was written. There was a reason for my question. If you installed adabase via ravenports, then the examples should just work (and if they don't then they need to be adjusted for the new gprbuild). If you installed the source from git then it would be up to you to get the directories right, especially since the files wouldn't be in their expected installed locations.

they were just examples to show how adabase could be used.

On Wed, Jul 13, 2022 at 5:35 PM ToyMakerUSMC @.***> wrote:

I accept that this is open-source. The source code is elegant and well designed. the management of projects, instructions on implementation and configuration are more confusing that helpful That has nothing to do with gprbuild. The reason for my dismissal of that specific comment is that if gprbuild has the proper, well coded gpr file, then it would build the executable. I have permuted of every search path, directory tree, and path command. At no point can any of the test cases build from the gpr file as delivered. So, while the gpr's are supposed to be instructive, they are not. Even statements like 'for Object_Dir use "obj/" & Common.driver;' produce errors. Your guidance to use yet another directory which is not stated in any of the documentation, and not in the library as downloaded, leads me to wonder if the code can actually work in any environment other than your own server. I can use the source code files, but little else. Certainly not the gpr's, nor the directory structures. A significant disappointment.

As for how I installed adabase, there were ZERO instructions or guidances.

— Reply to this email directly, view it on GitHub https://github.com/jrmarino/AdaBase/issues/6#issuecomment-1183749015, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAISZ5R35C4QUA27YOIBP6TVT5AD3ANCNFSM5YQHOHXQ . You are receiving this because you commented.Message ID: @.***>

jrmarino commented 2 years ago

re-reading the original post, I can see it wasn't installed via ravenports (or freebsd ports as it was originally) because you're running it on a windows environment. The gpr file can't know where libmysql is installed in that environment. For unix platforms it's normally on the standard library search path. I did build and run adabase on windows but I can't remember exactly what I did, if I modified the gpr files or not. It was a few years ago.

On Thu, Jul 14, 2022 at 1:49 PM John Marino (Github) @.***> wrote:

Sorry. gprbuild changed since adabase was written. There was a reason for my question. If you installed adabase via ravenports, then the examples should just work (and if they don't then they need to be adjusted for the new gprbuild). If you installed the source from git then it would be up to you to get the directories right, especially since the files wouldn't be in their expected installed locations.

they were just examples to show how adabase could be used.

On Wed, Jul 13, 2022 at 5:35 PM ToyMakerUSMC @.***> wrote:

I accept that this is open-source. The source code is elegant and well designed. the management of projects, instructions on implementation and configuration are more confusing that helpful That has nothing to do with gprbuild. The reason for my dismissal of that specific comment is that if gprbuild has the proper, well coded gpr file, then it would build the executable. I have permuted of every search path, directory tree, and path command. At no point can any of the test cases build from the gpr file as delivered. So, while the gpr's are supposed to be instructive, they are not. Even statements like 'for Object_Dir use "obj/" & Common.driver;' produce errors. Your guidance to use yet another directory which is not stated in any of the documentation, and not in the library as downloaded, leads me to wonder if the code can actually work in any environment other than your own server. I can use the source code files, but little else. Certainly not the gpr's, nor the directory structures. A significant disappointment.

As for how I installed adabase, there were ZERO instructions or guidances.

— Reply to this email directly, view it on GitHub https://github.com/jrmarino/AdaBase/issues/6#issuecomment-1183749015, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAISZ5R35C4QUA27YOIBP6TVT5AD3ANCNFSM5YQHOHXQ . You are receiving this because you commented.Message ID: @.***>

jrmarino commented 2 years ago

How are you installing adabase? Are you just using the github source? You may not have the adabase.gpr file in the search path. Back when I wrote this, the file was placed in "//lib/gnat" (in unix-like system). Now the default location used by gprbuild is //share/gpr". The fixes aren't hard but you need to understand how gprbuild works.

John

On Mon, Jun 13, 2022 at 12:01 PM ToyMakerUSMC @.***> wrote:

Well, you are absolutely correct, and my apologies. This is out of my league. I only have 30 years working with Ada. Guess I need a few more decades and a couple of additional PhD's under my belt.

What appears to me at this time is: sometimes you adjust directories in the GPR file and sometimes you don't. The instructions on build and install are less than clear to me. So, leaving things exactly as the distribution package, and unzipping the files into the directory

D:\GNAT|Adabase D:\GNAT\AdaBase>gprbuild

Adabase.prg built without modifications or incident.

However, moving to the testcases, there are some obvious problems with the default configuration.

D:\GNAT\AdaBase\testcases>gprbuild common.gpr common.gpr:1:06: imported project file "adabase" not found gprbuild: "common.gpr" processing failed

So, one would assume that somethings need adjustments and somethings don't. This is WAY over my head. So thanks for trying, and maybe I'll give it some time to mature both the documentation and the code. Meanwhile, Ada and MySQL do not play well together, and the client will be disappointed, but well acquainted with the recovery cycle.

— Reply to this email directly, view it on GitHub https://github.com/jrmarino/AdaBase/issues/6#issuecomment-1154164555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAISZ5UOSBJFOWZV745K37TVO5SNJANCNFSM5YQHOHXQ . You are receiving this because you commented.Message ID: @.***>