|
|
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » MySql and upp 2017r1 (Error in ld -lmysql)
|
|
Re: MySql and upp 2017r1 [message #47981 is a reply to message #47542] |
Sun, 30 April 2017 20:07 |
germax
Messages: 20 Registered: March 2017 Location: germany
|
Promising Member |
|
|
Since this is the latest rendition of the all popular mingw vs mysql error...
I'll reuse this thread.
Exact same error as OP
here are my settings (as closely taken from the SQL_MySql reference - example I am trying to get running)
executable path is set to the mysql-bin directory of course (just not room to patch another snippet into that screenshot )
Well...
Anyone?
that other german guy
[Updated on: Sun, 30 April 2017 20:12] Report message to a moderator
|
|
|
Re: MySql and upp 2017r1 [message #47984 is a reply to message #47542] |
Mon, 01 May 2017 16:02 |
germax
Messages: 20 Registered: March 2017 Location: germany
|
Promising Member |
|
|
So, just as I expected
Anyways;
for those of you that have the exact same Problem..
the mysql - lib folder is missing a file libmysql.a
that you must create yourself I'm afraid
(dl'ed files off the internet won't work well, since they must exactly match the mysql version installed)
Fear not it's not difficult at all:
five simple steps:
- Copy your libmysql.dll to your MinGW bin directory
- Open a console at said directory
- Run pexports libmysql.dll > libmysql.def *
- Run dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a *
- Copy libmysql.a back to your mysql server's lib folder *
You are done..
except for when you're encountered issues on the way
first: upp's mingw (at least mine) is not coming with pexports,
you can grab a MinGW standalone off sourceforge and use that instead,
or you could use dlltool itself to create the def file (hopefully to your likings )
like so:
dlltool --export-all-symbols --dllname libmysql.dll --output-def libmysql.def
or if you have an older minGW laying around that came with MinGW utils reimp or you're able to trace that down
just use that on the libmysql.lib file (not the dll )
reimp -d libmysql.lib
Now that you got this, the next thing you might trip is making a non-zero sized libmysql.a file
I know I did.
Check your windows environment variables (path to be exact)
if you're like me it's not too short at all..
inspect it thoroughly!
Make sure your mingw-bin path is in there,
AND make sure no interfering path is listed before that (in my case it was an old symbian tool chain (CSL ARM)))
if in doubt check all listed paths for mingw files.. and remove them for now (or permanently.. it's up to you)
when your path variable is cleaned try again creating the libmysql.a file.
once the libmysql.a is of non zero size you can go on an use that
The last step (in case needed) [I didn't]
is rather trivial again... once your compiler throws errors refering to mysql..
like
mysql_fetch_row@4 or
mysql_set_character_set@8
or alike
open your def file and append the respective @# part to it
(change mysql_fetch_row to my_sql_fetch_row@4 and mysql_set_character_set to mysql_set_character_set@8 etc.pp)
redo step 4 (make a new libmysql.a file with dlltool)
copy it over to your mysql library folder and you're finally through.
I hope this info helps a handfull of you.
that other german guy
[Updated on: Mon, 01 May 2017 16:04] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu Nov 07 17:23:12 CET 2024
Total time taken to generate the page: 0.02306 seconds
|
|
|