Jump to page: 1 2 3
Thread overview
mysql-native: newbie questions
Feb 17, 2014
salvari
Feb 18, 2014
simendsjo
Feb 18, 2014
Steve Teale
Feb 18, 2014
simendsjo
Apr 06, 2014
Martin Nowak
Feb 18, 2014
salvari
Feb 18, 2014
John J
Feb 18, 2014
simendsjo
Feb 19, 2014
John J
Apr 06, 2014
salvari
Apr 06, 2014
Nick Sabalausky
Apr 06, 2014
Martin Nowak
Apr 07, 2014
Nick Sabalausky
Apr 07, 2014
Sönke Ludwig
Feb 18, 2014
Nick Sabalausky
Feb 18, 2014
simendsjo
Feb 18, 2014
salvari
Apr 07, 2014
Steve Teale
Apr 08, 2014
simendsjo
Apr 08, 2014
Nick Sabalausky
Apr 08, 2014
simendsjo
Apr 08, 2014
Steve Teale
Apr 08, 2014
simendsjo
Apr 08, 2014
Steve Teale
Apr 08, 2014
Nick Sabalausky
Apr 09, 2014
Steve Teale
Apr 08, 2014
Steve Teale
Apr 08, 2014
Nick Sabalausky
Apr 08, 2014
Nick Sabalausky
February 17, 2014
Hi all!

After 14 years using Perl for programming at job I'm now learning D. (And enjoying it)

We've been using Perl (at job) for years for loading input data (UTF files) into a database and using these data for different purposes.

The volume of input data files has been constantly increasing along the years and, eventually, we need a faster solution, that's the reason to switch back to compiled languages, and D seemed interesting enough to give it a try. :-)

As a newbie I've a few questions. I'm already using D and it's working fine, although I'm writing baby-D the performance improvement is impressive, I'm now trying to use mysql native access. It seems there are two possibilities:

- https://github.com/simendsjo/mysqln
- https://github.com/rejectedsoftware/mysql-native

So far we've tried the second one, mysql-native, with success while using rdmd, but I've failed to compile using dmd, (the rather cryptic message from the compiler it's attached at the end of this entry).

I'm using Ubuntu 13.10 64 bits. dmd v2.064, dub v0.9.20

I've cloned from github and then:
$ cd mysql-native
$ dub
$ cd ../myProyect
$ cp -r ../mysql-native/source/mysql .
$ dmd mpe_procTmpTables.d (fails)
$ ./mpe_procTmpTables.d   (works fine via rdmd)


I know I must be doing something really stupid and wrong but I'm stuck, any help would be really appreciated.

Thanks in advance.


Compiler error:
dmd mpe_procTmpTables.d
mpe_procTmpTables.o:(.data+0x550): undefined reference to `_D5mysql10connection12__ModuleInfoZ'
mpe_procTmpTables.o: In function `_D17mpe_procTmpTables10procTablesFAyaZv':
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x1e): undefined reference to `_D5mysql10connection10Connection7__ClassZ'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x4a): undefined reference to `_D5mysql10connection10Connection6__ctorMFAyaE5mysql10connection11SvrCapFlagsZC5mysql10connection10Connection'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x69): undefined reference to `_D5mysql10connection8MetaData6__ctorMFNcC5mysql10connection10ConnectionZS5mysql10connection8MetaData'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x99): undefined reference to `_D5mysql10connection7Command6__ctorMFNcC5mysql10connection10ConnectionZS5mysql10connection7Command'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x415): undefined reference to `_D5mysql10connection7Command6__ctorMFNcC5mysql10connection10ConnectionZS5mysql10connection7Command'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x5b9): undefined reference to `_D5mysql10connection7Command6__ctorMFNcC5mysql10connection10ConnectionZS5mysql10connection7Command'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x5d3): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x5e6): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x650): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x663): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x67d): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x690): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x710): undefined reference to `_D5mysql10connection7Command6__ctorMFNcC5mysql10connection10ConnectionZS5mysql10connection7Command'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x72a): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x73d): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x81c): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x82f): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x849): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x85c): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x93b): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x94e): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x968): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x97b): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0x9fb): undefined reference to `_D5mysql10connection7Command6__ctorMFNcC5mysql10connection10ConnectionZS5mysql10connection7Command'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xa65): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xa78): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xae2): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xaf5): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xb0f): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xb22): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xc01): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xc14): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xc2e): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xc41): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xcc1): undefined reference to `_D5mysql10connection7Command6__ctorMFNcC5mysql10connection10ConnectionZS5mysql10connection7Command'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xcdb): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xcee): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xd6e): undefined reference to `_D5mysql10connection7Command6__ctorMFNcC5mysql10connection10ConnectionZS5mysql10connection7Command'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xe4d): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xe60): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xe7a): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv+0xe8d): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.o: In function `_D17mpe_procTmpTables10procTablesFAyaZv8colNamesMFAyaZAAya':
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv8colNamesMFAyaZAAya+0x52): undefined reference to `_D5mysql10connection8MetaData7columnsMFAyaZAS5mysql10connection10ColumnInfo'
mpe_procTmpTables.o: In function `_D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi':
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x12f): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x209): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x22e): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x2de): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x2f1): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x32b): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x33e): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x42f): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x442): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x49b): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody3MFKAyaKAyaZi+0x4ae): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.o: In function `_D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi':
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0xef): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0x10d): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0x1ab): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0x1be): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0x2bf): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0x2d2): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0x33b): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0x34e): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0x3a6): undefined reference to `_D5mysql10connection7Command3sqlMFNdAyaZAya'
mpe_procTmpTables.d:(.text._D17mpe_procTmpTables10procTablesFAyaZv14__foreachbody4MFKAyaKAyaZi+0x3b9): undefined reference to `_D5mysql10connection7Command7execSQLMFJmZb'
collect2: error: ld returned 1 exit status
--- errorlevel 1

February 18, 2014
On Monday, 17 February 2014 at 22:54:58 UTC, salvari wrote:
> Hi all!
>
> After 14 years using Perl for programming at job I'm now learning D. (And enjoying it)

Hi, and welcome.

(...)
> As a newbie I've a few questions. I'm already using D and it's working fine, although I'm writing baby-D the performance improvement is impressive, I'm now trying to use mysql native access. It seems there are two possibilities:
>
> - https://github.com/simendsjo/mysqln
> - https://github.com/rejectedsoftware/mysql-native
>
> So far we've tried the second one, mysql-native, with success while using rdmd, but I've failed to compile using dmd, (the rather cryptic message from the compiler it's attached at the end of this entry).

You're right in picking the rejectedsoftware repo. The first one is in a state of flux while experimenting with a near complete rewrite and a new API.

The rejectedsoftware repo is based on an earlier version of mine which in turn is based on the original by Steve Teale (britseye).

(... lots of compiler errors ...)

What you are seeing are missing dependencies. DMD won't figure out dependencies you are using without you specifying it in detail.

You should be using dub directly rather than dmd. Specify your dependencies in the package.json file, and use "dub run" to run the application.

I created a video tutorial a couple of days ago that might help you get started using dub: http://youtu.be/8TV9ZZteYEU
February 18, 2014
On 2/17/2014 5:54 PM, salvari wrote:
>
> I'm using Ubuntu 13.10 64 bits. dmd v2.064, dub v0.9.20
>
> I've cloned from github and then:
> $ cd mysql-native
> $ dub
> $ cd ../myProyect
> $ cp -r ../mysql-native/source/mysql .
> $ dmd mpe_procTmpTables.d (fails)
> $ ./mpe_procTmpTables.d   (works fine via rdmd)
>
>
> I know I must be doing something really stupid and wrong but I'm stuck,
> any help would be really appreciated.
>

D's build model is similar to C: The compiler only compiles the files you give it. You didn't give it the mysql-native source files, so it didn't compile them. Hence, linker errors for all the missing symbols.

The main point of RDMD is to find all the files used by your program and automatically pass them all to the compiler. Usually you'll just want to use RDMD instead of calling DMD directly. If you don't want RDMD to automatically run your program after compiling it, use --build-only.

Or use DUB to build it and run it like simendsjo said. It grabs up all your files and passes them all to DMD much like RDMD does.

February 18, 2014
On Tuesday, 18 February 2014 at 06:45:53 UTC, Nick Sabalausky wrote:
(...)
> Or use DUB to build it and run it like simendsjo said. It grabs up all your files and passes them all to DMD much like RDMD does.

I would say use DUB for anything other than very small projects - and perhaps even then. Sönke Ludwig has done a great job on creating a pragmatic build/package manager. I'm a big fan of ddox too.
February 18, 2014
On Tuesday, 18 February 2014 at 01:04:10 UTC, simendsjo wrote:
> >
> The rejectedsoftware repo is based on an earlier version of mine which in turn is based on the original by Steve Teale (britseye).
>
Thanks for the nod. It's good to see that all those hours were not wasted.
February 18, 2014
On Tuesday, 18 February 201hanks for the nod. It's good to see that all those hours were
not wast4 at 11:56:23 UTC, Steve Teale wrote:
> On Tuesday, 18 February 2014 at 01:04:10 UTC, simendsjo wrote:
>> >
>> The rejectedsoftware repo is based on an earlier version of mine which in turn is based on the original by Steve Teale (britseye).
>>
> Thanks for the nod. It's good to see that all those hours were not wasted.

And this is a reminder that I should finish the rewrite to not let all those hours go to waste :) The code everyone uses is pretty much exactly your original code with many small refactorings like remove magic constants. So big thanks for doing all that work!
February 18, 2014
On Tuesday, 18 February 2014 at 11:56:23 UTC, Steve Teale wrote:
> On Tuesday, 18 February 2014 at 01:04:10 UTC, simendsjo wrote:
>> >
>> The rejectedsoftware repo is based on an earlier version of mine which in turn is based on the original by Steve Teale (britseye).
>>
> Thanks for the nod. It's good to see that all those hours were not wasted.

Not wasted at all! For me, MySQL access from D was almost a must.
February 18, 2014
Hey! Thanks everybody for such a quick response. Problem solved! As Nick and you pointed I didn't understand the build process.

Now, thanks to your video simendsjo, I have new duties. Dub and Vibed seems worth a detailed look. :-)

I look forward to see the evolution of the mysql native libraries ;-)



February 18, 2014
On 02/17/2014 08:04 PM, simendsjo wrote:
> I created a video tutorial a couple of days ago that might help you get
> started using dub: http://youtu.be/8TV9ZZteYEU

That's helpful, thanks!
Please post it in the D.Announce group too.
February 18, 2014
On Tuesday, 18 February 2014 at 17:39:58 UTC, John J wrote:
> On 02/17/2014 08:04 PM, simendsjo wrote:
>> I created a video tutorial a couple of days ago that might help you get
>> started using dub: http://youtu.be/8TV9ZZteYEU
>
> That's helpful, thanks!
> Please post it in the D.Announce group too.

I posted it to D.learn. It was aimed at beginners, so I thought it might be a bit spammy posting it to D.announce.

I've created two more videos, but they are pure live-coding D basics and probably of less interest to most of the users here: https://www.youtube.com/playlist?list=PLqABwcsDQUo59iBOM5DFtqbwrMhL4PWcQ

I expect there will be made an announcement about that YouTube channel as soon as we upload a couple of more videos.
« First   ‹ Prev
1 2 3