Bug 14533 – Error 43: Not a Valid Library File

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-04-30T10:01:00Z
Last change time
2015-05-05T07:28:14Z
Assigned to
nobody
Creator
dongl

Comments

Comment #0 by dongl — 2015-04-30T10:01:33Z
link a c lib to my D code pragma(lib, "libmysql.lib"); when dmd d file it shows error as follows: libmysql.lib Error 43: Not a Valid Library File how can I do this?
Comment #1 by alphaglosined — 2015-04-30T10:22:33Z
Just to confirm this is for 64bit builds on Windows? And not the default of 32bit?
Comment #2 by dongl — 2015-05-04T06:26:52Z
(In reply to Richard Cattermole from comment #1) > Just to confirm this is for 64bit builds on Windows? And not the default of > 32bit? Windows system is 64bit, but dmd is 32bit! It maybe cased by COFF format, I want to convert it to OMF format, but not found coffimplib in DMC website. Could you konw where i can find coffimplib. or where can I download libmysql.lib for dlang Thanks!
Comment #3 by alphaglosined — 2015-05-04T06:33:51Z
(In reply to donglei from comment #2) > (In reply to Richard Cattermole from comment #1) > > Just to confirm this is for 64bit builds on Windows? And not the default of > > 32bit? > > Windows system is 64bit, but dmd is 32bit! > > > It maybe cased by COFF format, I want to convert it to OMF format, but not > found coffimplib in DMC website. > > Could you konw where i can find coffimplib. or where can I download > libmysql.lib for dlang > > Thanks! Assuming you are building for 32bit on Windows then you will be using OMF. coffimplib is available at http://ftp.digitalmars.com/coffimplib.zip
Comment #4 by dongl — 2015-05-05T06:37:39Z
(In reply to Richard Cattermole from comment #3) > (In reply to donglei from comment #2) > > (In reply to Richard Cattermole from comment #1) > > > Just to confirm this is for 64bit builds on Windows? And not the default of > > > 32bit? > > > > Windows system is 64bit, but dmd is 32bit! > > > > > > It maybe cased by COFF format, I want to convert it to OMF format, but not > > found coffimplib in DMC website. > > > > Could you konw where i can find coffimplib. or where can I download > > libmysql.lib for dlang > > > > Thanks! > > Assuming you are building for 32bit on Windows then you will be using OMF. > coffimplib is available at http://ftp.digitalmars.com/coffimplib.zip It solved in windows, but in debian pragma (lib, "mysqlclient"); extern(System) { struct MYSQL; struct MYSQL_RES; /* typedef */ alias const(ubyte)* cstring; struct MYSQL_FIELD { cstring name; /* Name of column */ cstring org_name; /* Original column name, if an alias */ cstring table; /* Table of column if column was a field */ cstring org_table; /* Org table name, if table was an alias */ cstring db; /* Database for table */ cstring catalog; /* Catalog for table */ cstring def; /* Default value (set by mysql_list_fields) */ uint length; /* Width of column (create length) */ uint max_length; /* Max width for selected set */ uint name_length; uint org_name_length; uint table_length; uint org_table_length; uint db_length; uint catalog_length; uint def_length; uint flags; /* Div flags */ uint decimals; /* Number of decimals in field */ uint charsetnr; /* Character set */ uint type; /* Type of field. See mysql_com.h for types */ // type is actually an enum btw version(MySQL_51) { void* extension; } } /* typedef */ alias cstring* MYSQL_ROW; cstring mysql_get_client_info(); MYSQL* mysql_init(MYSQL*); uint mysql_errno(MYSQL*); cstring mysql_error(MYSQL*); MYSQL* mysql_real_connect(MYSQL*, cstring, cstring, cstring, cstring, uint, cstring, c_ulong); int mysql_query(MYSQL*, cstring); void mysql_close(MYSQL*); ulong mysql_num_rows(MYSQL_RES*); uint mysql_num_fields(MYSQL_RES*); bool mysql_eof(MYSQL_RES*); ulong mysql_affected_rows(MYSQL*); ulong mysql_insert_id(MYSQL*); MYSQL_RES* mysql_store_result(MYSQL*); MYSQL_RES* mysql_use_result(MYSQL*); MYSQL_ROW mysql_fetch_row(MYSQL_RES *); uint* mysql_fetch_lengths(MYSQL_RES*); MYSQL_FIELD* mysql_fetch_field(MYSQL_RES*); MYSQL_FIELD* mysql_fetch_fields(MYSQL_RES*); uint mysql_real_escape_string(MYSQL*, ubyte* to, cstring from, uint length); void mysql_free_result(MYSQL_RES*); } It does work Thanks
Comment #5 by dongl — 2015-05-05T07:18:17Z
It works ok! thanks