Back to the month index |
Back to the list index
|
Georg Horn (horn@uni-koblenz.de)
Mon, 12 Apr 1999 10:12:45 +0200 (CEST)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: Fernando Lozano: "Re: mSQL C examples"
- Previous message: Joel Bremson: "C API question"
From: Georg Horn <horn@uni-koblenz.de> Message-Id: <199904120812.KAA14269@flens.uni-koblenz.de> Subject: Re: C API question Date: Mon, 12 Apr 1999 10:12:45 +0200 (CEST)You wrote:
> Hi,
>
> I am a novice C programmer trying to figure out how
> to use the C API. I am running msql 2.08 on Red Hat 4.2 (2.0.30).
>
> I don't understand why msqlStoreResult is outputing an integer.
It isn't, but the compiler thinks so because you didn't include
the msql.h header file, which declares the data types and functions
used in the msql C library.
> [> [joel@localhost c]$ gcc -c -I/usr/local/Hughes/include sql.c
If you add an "-Wall" to this command line, the compiler will warn you
about "implicit declaration of function ..." -Wall is in general a good idea...
> msql.c: In function `main':
> msql.c:39: warning: assignment makes pointer from integer without a cast
>
> The int that was output from msqlStoreResult was something like 139700.
> When I set the output variable to be an int there were no complaints
> from the compiler.
>
> Here is the code:
> ----------------
>
> #include <stdio.h>
Add an "#include <msql.h>" here, and all should be fine.
Bye,
Georg
- Next message: Fernando Lozano: "Re: mSQL C examples"
- Previous message: Joel Bremson: "C API question"