libmysql.dll : fatal error LNK1136: invalid or corrupt file

libmysql.dll : fatal error LNK1136: invalid or corrupt file

am 24.04.2005 17:40:02 von yeo augustine

Hi all,

This is my simple source code:

#include
#include

#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=gcdmw-win32@m.gmane.org

Re: libmysql.dll : fatal error LNK1136: invalid or corrupt file

am 24.04.2005 18:13:19 von Jeremiah Gowdy

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"
To:
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
> #include
>
> #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=jgowdy@cox.net
>
>


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: libmysql.dll : fatal error LNK1136: invalid or corrupt file

am 26.04.2005 01:13:28 von jbonnett

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:jgowdy@cox.net]=20
Sent: Monday, 25 April 2005 1:43 AM
To: yeo augustine; win32@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=20
libmysql.dll comes with a very small libmysql.lib (which contains=20
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=20
there is no DLL, and link against that. I prefer not to use the DLL due
to=20
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=20
is the wrong one, you can get freezes, abnormal crashes, etc, which
happen=20
before your first breakpoint in a debugger (when the DLL load is
triggered=20
during initialization). Dynamic library function calls also have a
minor=20
performance penalty (something addressed by AMD in their x86-64=20
architecture), and I have no need to save the disk space of having my
EXEs=20
be a meg smaller by sharing an DLL with other programs. It's just not
worth=20
it.

Good luck with your project.

----- Original Message -----=20
From: "yeo augustine"
To:
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
> #include
>
> #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
>
> --=20
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe: http://lists.mysql.com/win32?unsub=3Djgowdy@cox.net
>
>=20


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

Re: libmysql.dll : fatal error LNK1136: invalid or corrupt file

am 26.04.2005 04:26:23 von Jeremiah Gowdy

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:
To: ; ;
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:jgowdy@cox.net]
Sent: Monday, 25 April 2005 1:43 AM
To: yeo augustine; win32@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"
To:
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
> #include
>
> #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=jgowdy@cox.net
>
>


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: libmysql.dll : fatal error LNK1136: invalid or corrupt file

am 29.04.2005 03:08:33 von yeo augustine

Hi Jeremiah Gowdy,

Thanks for your help. I linked against the
libmysql.lib and have manage to compile a simple code
to connect to and do a "show tables from test".

Thanks again.
Regards
--- Jeremiah Gowdy wrote:

> 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:
> To: ; ;
>
> 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:jgowdy@cox.net]
> Sent: Monday, 25 April 2005 1:43 AM
> To: yeo augustine; win32@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"
> To:
> 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
> > #include
> >
> > #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=jgowdy@cox.net
> >
> >
>
>


__________________________________________________
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=gcdmw-win32@m.gmane.org