Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #26692 > unrolled thread
| Started by | sim <simisa@tiscalinet.it> |
|---|---|
| First post | 2012-09-25 16:21 +0200 |
| Last post | 2012-09-26 12:45 +0200 |
| Articles | 10 — 7 participants |
Back to article view | Back to comp.lang.c
Ansi C and MySql sim <simisa@tiscalinet.it> - 2012-09-25 16:21 +0200
Re: Ansi C and MySql Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-09-25 11:41 -0400
Re: Ansi C and MySql - II topic…variables sim <simisa@tiscalinet.it> - 2012-09-25 18:21 +0200
Re: Ansi C and MySql - II topic…variables Lew Pitcher <lpitcher@teksavvy.com> - 2012-09-25 13:08 -0400
Re: Ansi C and MySql - II topic…variables sim <simisa@tiscalinet.it> - 2012-09-26 18:45 +0000
Re: Ansi C and MySql - II topic…variables Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-09-25 12:51 -0700
Re: Ansi C and MySql - II topic…variables Greg Martin <greg@softsprocket.com> - 2012-09-25 13:35 -0700
Re: Ansi C and MySql - II topic…variables Gareth Owen <gwowen@gmail.com> - 2012-09-26 06:28 +0100
Re: Ansi C and MySql 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-25 16:00 -0700
Re: Ansi C and MySql sim <simisa@tiscalinet.it> - 2012-09-26 12:45 +0200
| From | sim <simisa@tiscalinet.it> |
|---|---|
| Date | 2012-09-25 16:21 +0200 |
| Subject | Ansi C and MySql |
| Message-ID | <k3seks$n0q$1@nnrp-beta.newsland.it> |
Hello NG I need a big help. I have an OS Windows XP, installed on it di MinGW suite in order to compile C files. I installed the MySql odbc connector I have problems on all my C files where i declare: #include <mysql/mysql.h> The answer is everytime the same: no file…or directory So, somebody can send me how to register in environment and off course….a piece of script running on a mysql ? PLEASE, thank you in advance and sorry for my poor english. SiM
[toc] | [next] | [standalone]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Date | 2012-09-25 11:41 -0400 |
| Message-ID | <k3sjam$90p$1@dont-email.me> |
| In reply to | #26692 |
On 9/25/2012 10:21 AM, sim wrote:
> Hello NG
> I need a big help.
>
> I have an OS Windows XP, installed on it di MinGW suite in order to
> compile C files.
> I installed the MySql odbc connector
>
> I have problems on all my C files where i declare:
>
> #include <mysql/mysql.h>
>
>
> The answer is everytime the same:
>
> no file…or directory
It appears the compiler doesn't know where to find the
#include'd files. There is probably a compiler option to
tell it where to look, something like
gcc -I c:/mysql7.2/include ... yourfile.c ...
The details will vary depending on exactly where the include
files are located.
--
Eric Sosman
esosman@ieee-dot-org.invalid
[toc] | [prev] | [next] | [standalone]
| From | sim <simisa@tiscalinet.it> |
|---|---|
| Date | 2012-09-25 18:21 +0200 |
| Subject | Re: Ansi C and MySql - II topic…variables |
| Message-ID | <k3slml$rep$1@nnrp-beta.newsland.it> |
| In reply to | #26693 |
On 2012-09-25 15:41:09 +0000, Eric Sosman said: > On 9/25/2012 10:21 AM, sim wrote: >> >> >> I have problems on all my C files where i declare: >> >> #include <mysql/mysql.h> >> >> >> The answer is everytime the same: >> >> no file…or directory > > It appears the compiler doesn't know where to find the > #include'd files. There is probably a compiler option to > tell it where to look, something like > > gcc -I c:/mysql7.2/include ... yourfile.c ... > > The details will vary depending on exactly where the include > files are located. Hallo, I resolved by typing: #include "path/path/..." Now I have another problem, I am creating a Query to update datas into MySql…I don't know how to put into Query the variables………. Thanks in advance to all...
[toc] | [prev] | [next] | [standalone]
| From | Lew Pitcher <lpitcher@teksavvy.com> |
|---|---|
| Date | 2012-09-25 13:08 -0400 |
| Subject | Re: Ansi C and MySql - II topic…variables |
| Message-ID | <Eyl8s.3494$522.351@newsfe13.iad> |
| In reply to | #26694 |
On Tuesday 25 September 2012 12:21, in comp.lang.c, simisa@tiscalinet.it wrote: > On 2012-09-25 15:41:09 +0000, Eric Sosman said: > >> On 9/25/2012 10:21 AM, sim wrote: >>> >>> >>> I have problems on all my C files where i declare: >>> >>> #include <mysql/mysql.h> >>> >>> >>> The answer is everytime the same: >>> >>> no file…or directory >> >> It appears the compiler doesn't know where to find the >> #include'd files. There is probably a compiler option to >> tell it where to look, something like >> >> gcc -I c:/mysql7.2/include ... yourfile.c ... >> >> The details will vary depending on exactly where the include >> files are located. > > Hallo, > I resolved by typing: #include "path/path/..." > > Now I have another problem, I am creating a Query to update datas into > MySql…I don't know how to put into Query the variables………. That's more a question for the comp.databases.mysql newsgroup. Have you read and reviewed the MySQL API documentation? Take a look at http://dev.mysql.com/doc/refman/5.0/en/c.html and especially at the example code in http://dev.mysql.com/doc/refman/5.0/en/mysql-stmt-execute.html HTH -- Lew Pitcher "In Skills, We Trust"
[toc] | [prev] | [next] | [standalone]
| From | sim <simisa@tiscalinet.it> |
|---|---|
| Date | 2012-09-26 18:45 +0000 |
| Subject | Re: Ansi C and MySql - II topic…variables |
| Message-ID | <247702360370290461.051982simisa-tiscalinet.it@nnrp-beta.newsland.it> |
| In reply to | #26695 |
Lew Pitcher <lpitcher@teksavvy.com> wrote: > On Tuesday 25 September 2012 12:21, in comp.lang.c, simisa@tiscalinet.it > wrote: > >> On 2012-09-25 15:41:09 +0000, Eric Sosman said: >> >>> On 9/25/2012 10:21 AM, sim wrote: >>>> >>>> >>>> I have problems on all my C files where i declare: >>>> >>>> #include <mysql/mysql.h> >>>> >>>> >>>> The answer is everytime the same: >>>> >>>> no file&or directory >>> >>> It appears the compiler doesn't know where to find the >>> #include'd files. There is probably a compiler option to >>> tell it where to look, something like >>> >>> gcc -I c:/mysql7.2/include ... yourfile.c ... >>> >>> The details will vary depending on exactly where the include >>> files are located. >> >> Hallo, >> I resolved by typing: #include "path/path/..." >> >> Now I have another problem, I am creating a Query to update datas into >> MySql&I don't know how to put into Query the variables&&&. > > That's more a question for the comp.databases.mysql newsgroup. > > Have you read and reviewed the MySQL API documentation? Take a look at > http://dev.mysql.com/doc/refman/5.0/en/c.html > and especially at the example code in > http://dev.mysql.com/doc/refman/5.0/en/mysql-stmt-execute.html > > HTH Thank you very much, sorry for the OT...I will study the API ref, it's necessary. Ciao SiM
[toc] | [prev] | [next] | [standalone]
| From | Malcolm McLean <malcolm.mclean5@btinternet.com> |
|---|---|
| Date | 2012-09-25 12:51 -0700 |
| Subject | Re: Ansi C and MySql - II topic…variables |
| Message-ID | <552cd87c-671e-45ab-a8f3-c26795f006f2@googlegroups.com> |
| In reply to | #26694 |
בתאריך יום שלישי, 25 בספטמבר 2012 17:21:42 UTC+1, מאת sim: > On 2012-09-25 15:41:09 +0000, Eric Sosman said: > > > I resolved by typing: #include "path/path/..." > That's a good way of getting things working temporarily. But it's not a long term solution. The reason is that the code won't compile when moved to a machine with a different directory structure. Eric Sosman's answer, which was to fiddle about with include paths in the compiler's settings, is the right approach. If you're using a commandline com puiler, the option is usually -I. If you're compiling from an IDE, search the menus for "settings", "configuration", "compiler options" or tools like that. An option to set include paths will be in there somewhere.
[toc] | [prev] | [next] | [standalone]
| From | Greg Martin <greg@softsprocket.com> |
|---|---|
| Date | 2012-09-25 13:35 -0700 |
| Subject | Re: Ansi C and MySql - II topic…variables |
| Message-ID | <PAo8s.3325$%03.145@newsfe14.iad> |
| In reply to | #26701 |
On 12-09-25 12:51 PM, Malcolm McLean wrote: > בתאריך יום שלישי, 25 בספטמבר 2012 17:21:42 UTC+1, מאת sim: >> On 2012-09-25 15:41:09 +0000, Eric Sosman said: >> >> >> I resolved by typing: #include "path/path/..." >> > That's a good way of getting things working temporarily. But it's not a > long term solution. The reason is that the code won't compile when moved to > a machine with a different directory structure. > Eric Sosman's answer, which was to fiddle about with include paths in the > compiler's settings, is the right approach. If you're using a commandline > com puiler, the option is usually -I. If you're compiling from an IDE, > search the menus for "settings", "configuration", "compiler options" or > tools like that. An option to set include paths will be in there somewhere. > If it's on the OP's system mysql_config is a useful tool to help with this. "mysql_config --include" or "mysql_config --cflags" will add the correct path to his compiler command line. I don't know if mysql with MingW would include it but ... Run from a bash term : gcc -W $(mysql_config --cflags) code.c -o code $(mysql_config --libs)
[toc] | [prev] | [next] | [standalone]
| From | Gareth Owen <gwowen@gmail.com> |
|---|---|
| Date | 2012-09-26 06:28 +0100 |
| Subject | Re: Ansi C and MySql - II topic…variables |
| Message-ID | <87ipb1nyi4.fsf@gmail.com> |
| In reply to | #26694 |
sim <simisa@tiscalinet.it> writes: > Now I have another problem, I am creating a Query to update datas into > MySql…I don't know how to put into Query the variables………. Basically, that depends on whether the data can be updated as ASCII or binary blobs. Basically, you need to build up a string (char *) containing your query -- then maybe call mysql_escape_string() -- then pass that to mysql_query() or mysql_escape_query() In either case, C is a pretty grim choice of language to do this in, as dynamic string building (without a third party library) is horribly error prone for new programmers, and merely horribly unpleasant for everyone else. Even the flawed C++ std::string would make this an order of magnitude easier.
[toc] | [prev] | [next] | [standalone]
| From | 88888 Dihedral <dihedral88888@googlemail.com> |
|---|---|
| Date | 2012-09-25 16:00 -0700 |
| Message-ID | <c4c7afc9-7d63-44f5-bbe0-27e697729022@googlegroups.com> |
| In reply to | #26692 |
sim於 2012年9月25日星期二UTC+8下午10時21分16秒寫道: > Hello NG > > I need a big help. > > > > I have an OS Windows XP, installed on it di MinGW suite in order to > > compile C files. > > I installed the MySql odbc connector > > > > I have problems on all my C files where i declare: > > > > #include <mysql/mysql.h> > > > > > > The answer is everytime the same: > > > > no file…or directory > > > > > > So, somebody can send me how to register in environment and off > > course….a piece of script running on a mysql ? > > > > PLEASE, thank you in advance and sorry for my poor english. > > > > SiM I suggest you can use the co-linux or the VM ware on your machine under Windows XP to run a full linux system and samba or FTP to exchange files of the two different operating systems. Of course you can use an old PC to run the linux system and link the two machines with a lan and samba. But this will increase the amounts of the electrical bills every month.
[toc] | [prev] | [next] | [standalone]
| From | sim <simisa@tiscalinet.it> |
|---|---|
| Date | 2012-09-26 12:45 +0200 |
| Message-ID | <k3umbp$3nj$1@nnrp-beta.newsland.it> |
| In reply to | #26703 |
On 2012-09-25 23:00:01 +0000, 88888 Dihedral said: >> >> >> #include <mysql/mysql.h> >> >> >> >> >> >> The answer is everytime the same: >> >> >> >> no file…or directory >> >> >> >> >> SiM > > I suggest you can use the co-linux or the VM ware on your machine under > Windows XP to run a full linux system and samba or FTP to exchange files > of the two different operating systems. > Of course you can use an old PC to run the linux system and linkthe two > machines with a lan and samba. But this will increase the amounts of > the electrical bills every month. Yes can be a solution… :-) but I resolve by using the path…the machine that must work can be only one…so…I think that I can be happy now. I hope…the work is not finish yet, I have to introduce myself on a DLL for reading COM1 datas….and putting the thing on a MySql Server. Uhhhh Thnks
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c
csiph-web