[fpc-pascal] MySQL
Paul Davidson
pdavidson at coraxnetworks.com
Thu Oct 15 18:02:40 CEST 2009
Here is the head of the unit:
{
cMySQL.pas
cape61
Created by Paul Davidson on 2005/01/18.
Copyright (c) 2005 Corax Networks.Inc.. All rights reserved.
}
unit cMySQL;
{$I Directives.inc}
interface
{$linklib libmysqlclient.a}
uses
cBase,
cKey,
cStack,
mysql4;
Using MySQL 41
Some linker output:
ld: warning: in /Users/pauldavidson/dev/cape96/libmysqlclient.a, file
is not of required architecture
Undefined symbols:
"_mysql_get_host_info", referenced from:
_CMYSQL_TCCMYSQLMGR_$__GETHOSTINFO$$ANSISTRING in cMySQL.o
"_mysql_free_result", referenced from:
_CMYSQL_TCCMYSQLMGR_$__QUERYLOCAL$ANSISTRING$$ANSISTRING in
cMySQL.o
"_mysql_close", referenced from:
_CMYSQL_TCCMYSQLMGR_$__DESTROY in cMySQL.o
"_mysql_error", referenced from:
_CMYSQL_TCCMYSQLMGR_$__REALCONNECT$$BOOLEAN in cMySQL.o
_CMYSQL_TCCMYSQLMGR_$__QUERYBATCH$ANSISTRING$$ANSISTRING in
cMySQL.o
_CMYSQL_TCCMYSQLMGR_$__QUERYLOCAL$ANSISTRING$$ANSISTRING in
cMySQL.o
"_mysql_store_result", referenced from:
_CMYSQL_TCCMYSQLMGR_$__QUERYLOCAL$ANSISTRING$$ANSISTRING in
cMySQL.o
It goes on...
Do note the 'file is not of required architecture'. Ummm????
Thank you
On 2009-10-15, at 10:27 AM, Jonas Maebe wrote:
>
> On 15 Oct 2009, at 16:03, Paul Davidson wrote:
>
>> On 2009-10-15, at 7:13 AM, Jonas Maebe wrote:
>>
>>> On 14 Oct 2009, at 18:14, Paul Davidson wrote:
>>>
>>>> FPC 2.2.4
>>>> OS X 10.6.1
>>>> Xcode 3.2
>>>>
>>>> All references to MySQL function are unresolved by linker.
>>>> libMySQLclient.a is copied to .pas directory. Using FPC test
>>>> code for MySQL as template.
>>>
>>> When you use Xcode, you have to use the Xcode way to link with
>>> libraries: add the library to your project, then add the library
>>> to the "Link binary with Libraries" phase of your application
>>> target.
>>>
>> Added libmysqlclient.a to the project and it gets automatically
>> included in Tagets/cape96/Link Binary With Libraries. Again same
>> linker errors: Symbols not found. Also tried libmysqlclient.la.
>> Same result.
>>
>> When looking at examples and tests in FPC for MySQL they do not
>> contain any references to this library.
>
> When you compile outside Xcode, any {$linklib xxx} statements in the
> (mysql or other) units you use will automatically cause the compiler
> to tell the linker to link with the specified libraries. So if those
> units already include {$linklib mysqlclient}, it's not required to
> explicitly also tell the program to link against it. This changes if
> you move to Xcode, because Xcode itself does all the linking and
> there is no way (that I know of) for the compiler to tell it "please
> also link against these libraries in addition to those specified in
> the project".
>
> But you are leaving out important information, such as which mysql
> unit you are using exactly and which version the libmysqlclient.a
> comes from. Most examples use the dynamic versions of the mysql
> units, which means that the mysqlclient library is dynamically
> loaded at run time rather than statically linked (in which case no
> linklib statement or other linker instructions are required). Please
> also mention some example symbols that are reported as being
> missing, and post the linker step of the Xcode build transcript
> (select the error on the build transcript and right-click on to see
> the full tool invocation/output).
>
>
> Jonas
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20091015/3b4c273e/attachment.html>
More information about the fpc-pascal
mailing list