5 messages in com.mysql.lists.win32Re: libmysql.dll : fatal error LNK113...| From | Sent On | Attachments |
|---|---|---|
| yeo augustine | 24 Apr 2005 08:39 | |
| Jeremiah Gowdy | 24 Apr 2005 09:12 | |
| jbon...@sola.com.au | 25 Apr 2005 16:13 | |
| Jeremiah Gowdy | 25 Apr 2005 19:26 | |
| yeo augustine | 28 Apr 2005 18:08 |
| Subject: | Re: libmysql.dll : fatal error LNK1136: invalid or corrupt file![]() |
|---|---|
| From: | Jeremiah Gowdy (jgo...@cox.net) |
| Date: | 04/25/2005 07:26:01 PM |
| List: | com.mysql.lists.win32 |
True, but hopefully people aren't paging on modern machines over an extra 1MB of memory usage for each MySQL client application. :)
----- Original Message ----- From: <jbon...@sola.com.au> To: <jgo...@cox.net>; <augu...@yahoo.com>; <win...@lists.mysql.com> Sent: Monday, April 25, 2005 4:13 PM Subject: RE: libmysql.dll : fatal error LNK1136: invalid or corrupt file
It's not just on disc that DLLs save space. If you are running lots of EXEs with the same code statically linked, then there will be multiple copies of that code in memory. If you use a DLL, there will be only one copy. Depending on your situation this might prevent paging and increase the throughput of your machine. If you are only running a few copies, it probably does not matter.
John Bonnett
-----Original Message----- From: Jeremiah Gowdy [mailto:jgo...@cox.net] Sent: Monday, 25 April 2005 1:43 AM To: yeo augustine; win...@lists.mysql.com Subject: Re: libmysql.dll : fatal error LNK1136: invalid or corrupt file
You don't link against DLLs, you link against import LIBs for DLLs. So libmysql.dll comes with a very small libmysql.lib (which contains information on which functions exist in the DLL). Link against that.
Or you can do what I prefer to do, which is staticly compile libmysql.lib so there is no DLL, and link against that. I prefer not to use the DLL due to performance reasons and difficult to debug DLL mismatches. If you run a
program linked to a particular version of the DLL, but the DLL in your path is the wrong one, you can get freezes, abnormal crashes, etc, which happen before your first breakpoint in a debugger (when the DLL load is triggered during initialization). Dynamic library function calls also have a minor performance penalty (something addressed by AMD in their x86-64 architecture), and I have no need to save the disk space of having my EXEs be a meg smaller by sharing an DLL with other programs. It's just not worth it.
Good luck with your project.
----- Original Message ----- From: "yeo augustine" <augu...@yahoo.com> To: <win...@lists.mysql.com> Sent: Sunday, April 24, 2005 8:40 AM Subject: libmysql.dll : fatal error LNK1136: invalid or corrupt file
Hi all,
This is my simple source code:
#include <stdio.h> #include <mysql.h>
#define def_host_name "localhost" #define def_user_name "root" #define def_password "passwork" #define def_db_name "test"
MYSQL *conn;
int main(int argc, char *argv[]) { printf("Hello, world and Goodbye\n"); }
//END
I have compiled it using:
C:\project\code>cl -c -I "C:\Program Files\MySQL\MySQL Server 4.1\include" clien t1.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86 Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
client1.c
I got the following error while linking the .obj file, below is the error:
C:\project\code>cl client1.obj -link "C:\Program Files\MySQL\MySQL Server 4.1\li b\opt\libmysql.dll" Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86 Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
Microsoft (R) Incremental Linker Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved.
/out:client1.exe "C:\Program Files\MySQL\MySQL Server 4.1\lib\opt\libmysql.dll" client1.obj C:\Program Files\MySQL\MySQL Server 4.1\lib\opt\libmysql.dll : fatal error LNK11 36: invalid or corrupt file
Thanks in advance.
By the way anyone can advice on how I can reply to your replies. I dunno how to reply to this thread.
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
-- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/win32?unsub=jgo...@cox.net




