Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » MySql and upp 2017r1 (Error in ld -lmysql)
MySql and upp 2017r1 [message #47542] Thu, 26 January 2017 02:24 Go to next message
Melek is currently offline  Melek
Messages: 16
Registered: January 2017
Location: Honduras
Promising Member
C:/Ultimatepp/bin/mingw64/32/bin/../lib/gcc/i686-w64-mingw32 /6.2.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lmysql
collect2.exe: error: ld returned 1 exit status

Sad Sad Sad
Re: MySql and upp 2017r1 [message #47576 is a reply to message #47542] Tue, 31 January 2017 03:42 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Did you follow this part of documentation?

http://www.ultimatepp.org/srcdoc$MySql$NativeMySql$en-us.htm l

Can you verify you have your include/library paths set to your installation of mysql development library?

(it's not part of upp package IIRC)
Re: MySql and upp 2017r1 [message #47981 is a reply to message #47542] Sun, 30 April 2017 20:07 Go to previous messageGo to next message
germax is currently offline  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)

index.php?t=getfile&id=5251&private=0

executable path is set to the mysql-bin directory of course (just not room to patch another snippet into that screenshot Wink)

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 Go to previous message
germax is currently offline  germax
Messages: 20
Registered: March 2017
Location: germany
Promising Member
So, just as I expected Wink

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:


  1. Copy your libmysql.dll to your MinGW bin directory
  2. Open a console at said directory
  3. Run pexports libmysql.dll > libmysql.def *
  4. Run dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a *
  5. Copy libmysql.a back to your mysql server's lib folder *


You are done..

except for when you're encountered issues on the way Wink
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 Wink)
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 Wink)
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

Previous Topic: [Bug+Patch] when there is a space in Upp path
Next Topic: [FIXED] Console does not appear when debugging using MingGW
Goto Forum:
  


Current Time: Thu Nov 07 17:23:12 CET 2024

Total time taken to generate the page: 0.02306 seconds