MySql users - can anybody help to compile MySql.c

MySql users - can anybody help to compile MySql.c

Postby RAMESHBABU » Mon Aug 31, 2009 3:01 pm

Hi All,

I want to create MySql.lib. But, I am not able to compile "MYSQL.C" available in CONTRIB folder's MySql Subfolder of xHarbour.

I am missing somany include files.

Can anbody help me either with the latest TMySql.lib or with the required include files to compile MYSQL.C.

Thank you very much

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: MySql users - can anybody help to compile MySql.c

Postby dutch » Mon Aug 31, 2009 4:48 pm

Dear Rameshbabu,

I have MySql.lib and libMySql.lib that work with xHarbour 1.2.1 (Simplex) from FW. If you need, give me your email.

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql users - can anybody help to compile MySql.c

Postby RAMESHBABU » Tue Sep 01, 2009 2:15 am

Mr.Dutch,

Thank you for your response.

I am using Harbour.exe version 1.1.0 (Simplex) of xHarbour. Your libs may not work with my version.

Can we get the related source files to build these two libs ourself ?

Regards,

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: MySql users - can anybody help to compile MySql.c

Postby dutch » Tue Sep 01, 2009 8:14 am

Dear Rameshbabu,

I have no source code, I have got this library from William Marales (Mexico) (My TMySql Master). He use xHarbour also but Wang Shuming has used Harbour. I think you should contact him, he is kindness guy and help me also.

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql users - can anybody help to compile MySql.c

Postby RAMESHBABU » Tue Sep 01, 2009 8:22 am

Hello Mr.Dutch,

How R U ?. I left a msg in your gmail a/c also.
BTW Can you please send the lib along with the available source to my gmail a/c with you.

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: MySql users - can anybody help to compile MySql.c

Postby anserkk » Tue Nov 03, 2009 5:59 am

Can anybody here explain about the use of MySQL Connector/C; MySQL Native C API; libmysql; libmysqld

MySQL website provides MySQL Connector/C contains a C lib named LibMySql.

http://dev.mysql.com/downloads/connector/c/6.0.html

My doubts
1. Can we link this lib with our FWH application
2. What is the advantage of using this lib along with FWH, when compared to the regular method of ADO along with the ODBC Driver
3. On a windows PC , for our FWH application to work/connect with MySQL Databes Server, we need to have ODBC Driver installed on the PC. I wanted to know that by using this lib can we avoid the requirement of ODBC Driver 5.1 installation on each and every PC
4. Anybody here tried this lib

I found the following FAQ on the web, but I could not understand whether it meets the requirement which I have specified above. For ref. I am pasting the FAQ’s here
Q1: What is "MySQL Native C API"? What are typical benefits / use cases?

Connector/C (also known as libmysql) is a C-based API that you can use in C applications to connect with the MySQL database server. It implements the same MySQL client API that has been in use for a decade.

It is also itself used as the foundation for drivers for standard database APIs like ODBC, Perl's DBI, and Python's DB API.

Q2: What is "libmysql"?

libmysql is the name of the library that Connector/C provides.

Q3: What is "libmysqld"?

libmysqld is an embedded database server with the same API as Connector/C (libmysql). It is distributed as part of the MySQL server distribution.

Q4: What is "Connector/C"?

Connector/C is a standalone distribution of the libmysql library, which was previously only available as part of the server distribution. The version of libmysql included in Connector/C and bundled with the server are functionally identical, but the build system for Connector/C uses the cross-platform CMake build system.

Q5: What is the difference between "Native C API" and "libmysql" and "libmysqld" and "Connector/C"?

Connector/C and libmysql are the native C API for MySQL, and all three terms can be used interchangeably. libmysqld is the embedded version of the MySQL server, and is included in the server distribution.

Q6: Does Connector/C replace any of "Native C API" and "libmysql" and "libmysqld"?

Connector/C contains libmysql, and implements a native C API. It does not include libmysqld, which can be found with the MySQL server distribution.

From another Website

What is MySQL Connector/C?

MySQL Connector/C is a C client library for client-server communication. It is a standalone replacement for the MySQL Client Library shipped with the MySQL Server.

Why have a replacement for MySQL Client Library?

There is no need to compile or install the MySQL Server package if you only need the client library.

MySQL Connector/C does not rely on the MySQL Server release cycle, so bug fixes and new features are released more often.



My intention is to know whether by using this Lib, can I avoid the ODBC driver installation on each and every PC.


May be I am asking a very stupid question :)

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: MySql users - can anybody help to compile MySql.c

Postby anserkk » Tue Nov 03, 2009 7:56 am

Hi all,

It seems that you don't have to install ODBC driver if we use this lib, but we will be calling API's and it will be different from the regular ADO commands.

Has anybody here tried this lib in FWH application ? Any feedback ?

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: MySql users - can anybody help to compile MySql.c

Postby dutch » Tue Nov 03, 2009 9:19 am

Hi Anser,

I've used libmysql.lib and MySql.lib to communicate with MySql on the web without ODBC install in computer. I have some database on the web.
By the way, you just link 2 libs before Fivewin library. That's all. You can get an sample from the forum but I still need the sample for xbrowse MySql Database too.

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql users - can anybody help to compile MySql.c

Postby Adolfo » Tue Nov 03, 2009 7:10 pm

Dutch

Could you provide the link for the example... Maybe we could build a set of functions to emulate navigation for xBrowse.. with skip... eof(), bof(), pgup, pgdown...

Thanks in advance

From Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: MySql users - can anybody help to compile MySql.c

Postby Antonio Linares » Tue Nov 03, 2009 7:41 pm

Anser,

Using that LIB you directly talk to MySQL, so there is no need for ADO or ODBC, etc

The advantages are that your application requires less requisites to work, and should perform faster, but on the other hand your code will not be portable to other database engines as you are not using ADO that basically is a compatibility layer for different databases engines.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: MySql users - can anybody help to compile MySql.c

Postby dutch » Tue Nov 03, 2009 9:40 pm

Dear Adolfo,

This is UEStudio Project configuration.
Code: Select all  Expand view
# --------- xHarbour y FWH configuration --------
# --- general --------------------------------------
# $P  - project name
# $Pp - path to project directory
# $Pn - project name
# --- compile --------------------------------------
# $I  - input full name
# $Ip - input path
# $In - input name
# $Ie - input extension
# $O  - output file
# $Op - path to output file
# $On - output filename (without path)
# $Oe - output extension
# $R  - release/debug setting for compiler
# --- build ----------------------------------------
# $T  - target full name
# $Tp - target path
# $Tn - target name
# $O  - output file
# $Op - path to output file
# $On - output filename (without path)
# $Oe - output extension
# $R  - release/debug setting for linker

[Settings]
Target =
Category&01 = DEFAULT RUN CONFIGURATION
Working Directory =.
Command Line Arguments =

Category&02 = Harbour Options
Automatic Memvar Declaration = no|yes
Variables Are Assumed = no|yes
Generate Preprocessed Output = no|yes
Warning Level = 1|2|3|4|0
User Include Path =
User Defines =

Compiler Options =
Linker Options =

Excluded Files = Excludes

[SettingsInfo]
Target = Provides a space for you to specify an output file and location of the program that the linker creates.
Working Directory = Provides a space for you to specify the directory in which executing occurs. If you do not specify a directory, executing occurs in the directory where the executable is located.
Command Line Arguments = Provides a space for you to specify command-line arguments you want to pass to the program at startup.
Compiler Options = Provides a space for you to specify an additional compiler options.
User Defines = Shows the switches the tool will use to build. Use ';' as delimiter.
Linker Options = Provides a space for you to specify an additional linker options.
Excluded Files = This will exclude the file(s) included in this UE project group from the build.

[SettingsReps]
User Defines = @[;|-D%s]
Automatic Memvar Declaration = no=|yes=/a
Variables Are Assumed = no=|yes=/v
Generate Preprocessed Output = no=|yes=/p
User Include Path = ^^@[;|;%s]
User Include Path&1 = ^^@[;| /i%s]
Use Multi Thread Library = no|yes
Warning Level = @/w%s

[Variables]
FWH = D:\FWH
HPATH = D:\xHarbour
CPATH = D:\bcc55

HPATHL = $(HPATH)\LIB
CPATHL = $(CPATH)\LIB

HOPT = /n /gc0 /q $(Compiler Options) /i$(HPATH)\INCLUDE $(User Include Path&1) $(User Defines) $(Automatic Memvar Declaration) $(Variables Are Assumed) $(Generate Preprocessed Output) $(Warning Level)
COPT = -O2 -M -c -v -I$(HPATH)\INCLUDE -D__HARBOUR__ -D__FLAT__

LOPT = -Gn -aa -Tpe -s -v
LIBS0 = $(HPATHL)\MySql.lib $(HPATHL)\LibMySql.lib
LIBS1 = $(FWH)\LIB\FiveHX.lib $(FWH)\LIB\FiveHC.lib $(FWH)\LIB\noway.lib
LIBS2 = $(HPATHL)\rtl.lib $(HPATHL)\vm.lib $(HPATHL)\gtgui.lib $(HPATHL)\lang.lib $(HPATHL)\macro.lib $(HPATHL)\rdd.lib $(HPATHL)\dbfcdx.lib $(HPATHL)\dbfntx.lib $(HPATHL)\dbffpt.lib $(HPATHL)\hbsix.lib $(HPATHL)\debug.lib $(HPATHL)\common.lib $(HPATHL)\pp.lib $(HPATHL)\codepage.lib $(HPATHL)\pcrepos.lib $(HPATHL)\ct.lib
LIBS3 = $(CPATHL)\cw32.lib $(CPATHL)\import32.lib $(CPATHL)\psdk\odbc32.lib $(CPATHL)\psdk\msimg32.lib $(CPATHL)\psdk\nddeapi.lib $(CPATHL)\psdk\iphlpapi.lib  $(CPATHL)\psdk\rasapi32.lib
LIBS4 = $(FWH)\LIB\twbrw32x.lib $(FWH)\LIB\SBUTTONX.LIB $(HPATHL)\hbzip.lib $(HPATHL)\zlib.lib $(FWH)\LIB\ACE32.LIB $(HPATHL)\rddads.lib $(FWH)\LIB\PICKDATX.LIB $(FWH)\LIB\TSBRWX.LIB $(FWH)\LIB\Twain.LIB
LIBS   = $(LIBS0) $(LIBS4) $(LIBS1) $(LIBS2) $(LIBS3)

[Environment]
PATH = $(HPATH)\BIN;$(CPATH)\BIN;%PATH%
INCLUDE = $(HPATH)\INCLUDE;$(CPATH)\INCLUDE;$(FWH)\INCLUDE
LIB = $(HPATH)\LIB;$(CPATH)\LIB;$(FWH)\LIB
BuildMode = %UESMode%

[General]
TargetExt = .EXE
ReleaseOut = Release
DebugOut = Debug
UseFullPaths = 1
UseDosNames = 1
Excludes = $(Excluded Files)
GenerateEDGroup=$(External Dependencies)
.CPP = .C

[MakeCommands]
run = Execute Application
makef = Show Makefile

[Execute Application]
Title = Execute $T
Cmd0 = $(Command Line Arguments)
Depends = $T
ShowWindow = 1
DisplayConsole = $(DCon)

[Show Makefile]
Title=Show makefile
Cmd0=uestudio makefile
ShowWindow=1
DisplayConsole=0

[InsertFiles]

[FileGroups]
FGO = .obj;
FGR = .res;
FGL = .lib;
FGD = .def;

[GroupFormats]
FGO = %s
FGR = %s
FGL = %s

[Build]
Out = $T
Depends = $FGO $FGR
DebugFlag =
ReleaseFlag =
Cmd0 = ilink32 $(LOPT) c0w32.obj $FGO, $T,, $(LIBS),, $FGR

[.PRG]
Out = $In.c
DebugFlag = /b
ReleaseFlag =
Cmd0 = harbour $I $(HOPT) $R /o$O

IncFiles = 1
CaseSensitive = 0
IncDirs = .;$(INCLUDE);
IncKeyWords = #include;
Comments = /*.*/.//.eol.

[.C]
Out = $In.obj
Cmd0 = bcc32 $(COPT) -o$O $I

[.RC]
Out = $In.res
Cmd0 = brc32 -r -fo$O $I

IncFiles = 1
CaseSensitive = 0
IncDirs = .;$(INCLUDE);
IncKeyWords = #include;
Comments = /*.*/.//.eol.
 


This is buildx.bat
Code: Select all  Expand view
@ECHO OFF
CLS
ECHO ฺฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฟ
ECHO ณ FiveWin for xHarbour 9.04 - Apr. 2009           xHarbour development power ณ
ECHO ณ (c) FiveTech, 1993-2009     for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7 ณ
ECHO ภฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤู
ECHO  ฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

ECHO Compiling...

if "%FWDIR%" == "" set FWDIR=d:\fwh
if "%XHDIR%" == "" set XHDIR=d:\xharbour
if "%2" == "/b" set GT=gtwin
if not "%2" == "/b" set GT=gtgui

set hdir=%XHDIR%
set hdirl=%hdir%\lib
set bcdir=d:\bcc55
set fwh=%FWDIR%

%hdir%\bin\harbour %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log
IF ERRORLEVEL 1 GOTO COMPILEERRORS
@type comp.log

echo -O2 -e%1.exe -I%hdir%\include -I%bcdir%\include %1.c > b32.bc
%bcdir%\bin\bcc32 -M -c -v @b32.bc
:ENDCOMPILE

IF EXIST %1.rc %bcdir%\bin\brc32 -r %1

echo %bcdir%\lib\c0w32.obj + > b32.bc
echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.map, + >> b32.bc
echo %hdirl%\mysql.lib + >> b32.bc
echo %hdirl%\libmysql.lib + >> b32.bc
echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib + >> b32.bc
echo %fwh%\lib\sbuttonx.lib + >> b32.bc
echo %hdirl%\rtl.lib + >> b32.bc
echo %hdirl%\vm.lib + >> b32.bc
echo %hdirl%\%GT%.lib + >> b32.bc
echo %hdirl%\lang.lib + >> b32.bc
echo %hdirl%\macro.lib + >> b32.bc
echo %hdirl%\rdd.lib + >> b32.bc
echo %hdirl%\dbfntx.lib + >> b32.bc
echo %hdirl%\dbfcdx.lib + >> b32.bc
echo %hdirl%\dbffpt.lib + >> b32.bc
echo %hdirl%\hbsix.lib + >> b32.bc
echo %hdirl%\debug.lib + >> b32.bc
echo %hdirl%\common.lib + >> b32.bc
echo %hdirl%\pp.lib + >> b32.bc
echo %hdirl%\pcrepos.lib + >> b32.bc
echo %hdirl%\ct.lib + >> b32.bc

rem Uncomment these two lines to use Advantage RDD
rem echo %hdir%\lib\rddads.lib + >> b32.bc
rem echo %hdir%\lib\Ace32.lib + >> b32.bc

rem echo %fwh%\lib\adordd.lib + >> b32.bc
rem echo %hdir%\lib\usrrdd.lib + >> b32.bc

echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\uuid.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib, >> b32.bc

IF EXIST %1.res echo %1.res >> b32.bc

rem uncomment this line to use the debugger and comment the following one
if %GT% == gtwin %bcdir%\bin\ilink32 -Gn -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
if %GT% == gtgui %bcdir%\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c

:COMPILEERRORS
@type comp.log
ECHO * Compile errors *
GOTO EXIT

:LINKERROR
ECHO * Linking errors *
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Build [Program]     {-- No especifiques la extensiขn PRG
ECHO                                {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT
Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql users - can anybody help to compile MySql.c

Postby nageswaragunupudi » Wed Nov 04, 2009 4:36 am

>>
xbrowse MySql Database too
>>
SetMySql(..) method is provided in xbrowse 9.10. This works with tmysql class
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MySql users - can anybody help to compile MySql.c

Postby anserkk » Thu Nov 05, 2009 3:10 pm

Dear Mr.Dutch and Mr.Antonio,

Thank you for the information.

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Willi Quintana and 95 guests