Can't open include file 'sqlca.h'.

News group sybase.public.sqlanywhere.general

Can't open include file 'sqlca.h'. 2001-08-01 20:43
Hello,

I tried to run the embedded SQL in C  simple example from the ASA
programming Interfaces Guide and
I encounter with some problem.


The following code is from the document.
Menu
Re: Can't open include file 'sqlca.h'. 2001-08-01 21:10
Do you have the %ASANY7%\h directory in you include path?
Re: Can't open include file 'sqlca.h'. 2001-08-01 21:50
I'm running it on UNIX, I have "/opt/sybase/SYBSsa7/include" in my path.

Connie


>Do you have the %ASANY7%\h directory in you include path?
>
>--
>Reg Domaratzki, Sybase iAnywhere Solutions
>Certified SQL Anywhere Associate
>Please reply only to the newsgroup
>
>ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
>   -> Choose SQL Anywhere Studio
>   -> Set "Platform Preview" and "Time Frame" to ALL and click "GO"
>
>>Hello,
>>
>>I tried to run the embedded SQL in C  simple example from the ASA
>>programming Interfaces Guide and
>>I encounter with some problem.
>>
>>
>>The following code is from the document.
>>------------------------------------------------------------------------
>>
>>#include <stdio.h>
>>EXEC SQL INCLUDE SQLCA;
>>
>>main()
>>{
>>
>> db_init(&sqlca);
>> EXEC SQL WHENEVER SQLERROR GOTO ERROR;
>> EXEC SQL CONNECT "dba" IDENTIFIED BY "sql";
>> EXEC SQL UPDATE employee
>>          set emp_lname = 'Plankton'
>>          where emp_id = 195;
>> EXEC SQL COMMIT WORK;
>> EXEC SQL DISCONNECT;
>> db_fini(&sqlca);
>> return (0);
>>
>> error:
>> printf("update successful -- sqlcode = %ld.n", sqlca.sqlcode );
>> db_fini(&sqlca);
>> return (-1);
>>}
>>-------------------------------------------------------------------------------
>>
>>I named the above program as example.sqc
>>
>>When I run,
>>              sqlpp -oUNIX example.sqc
>>It generates the C source.
>>But when I compile it (cc example.c ), it responds with the following
>>error messages.
>>
>>cpp: "example.c", line 13: error 4036: Can't open include file
>>'sqlca.h'.
>>cpp: "example.c", line 24: error 4036: Can't open include file
>>'sqlda.h'.
>>
>>Can someone help me with this.
>>Thanks,
>>Connie
>>
>>
>>
Re: Can't open include file 'sqlca.h'. 2001-08-01 22:45
cc example.c -I/opt/sybase/SYBSsa7/include -ldblib7

Include directories are not picked up from environment variables as far as I
know so you need the -I parameter, and you will need to link against the
dblib7 library.  This assumes libdblib7.so is in your library path
(LD_LIBRARY_PATH for Solaris and Linux).  See
/opt/sybase/SYBSsa7/cxmp/makeall for how to build the examples.
Re: Can't open include file 'sqlca.h'. 2001-08-02 16:30
I don't have libdblib7.so in /opt/sybase/SYBSsa7/lib directory.
Where can I get the libdblib7.so or how can I build one?
Is there any ASA documentation on this issue?

Is there a command just compile the Embedded SQL in C/C++
and generate the object code without compile the C code  (generates from the
sqlpp)?

Thanks,
Connie


>I believe you need:
>cc example.c -I/opt/sybase/SYBSsa7/include -ldblib7
>
>Include directories are not picked up from environment variables as far as I
>know so you need the -I parameter, and you will need to link against the
>dblib7 library.  This assumes libdblib7.so is in your library path
>(LD_LIBRARY_PATH for Solaris and Linux).  See
>/opt/sybase/SYBSsa7/cxmp/makeall for how to build the examples.
>
>--
>Ian McHardy
>iAnywhere Solutions (A Sybase Company)
>
>Please reply to the newsgroup, not by e-mail.
>
>>I'm running it on UNIX, I have "/opt/sybase/SYBSsa7/include" in my path.
>>
>>Connie
>>
>>
>>>Do you have the %ASANY7%\h directory in you include path?
>>>
>>>--
>>>Reg Domaratzki, Sybase iAnywhere Solutions
>>>Certified SQL Anywhere Associate
>>>Please reply only to the newsgroup
>>>
>>>ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
>>>   -> Choose SQL Anywhere Studio
>>>   -> Set "Platform Preview" and "Time Frame" to ALL and click "GO"
>>>
>>>>Hello,
>>>>
>>>>I tried to run the embedded SQL in C  simple example from the ASA
>>>>programming Interfaces Guide and
>>>>I encounter with some problem.
>>>>
>>>>
>>>>The following code is from the document.
>>>
>>------------------------------------------------------------------------
>>>>
>>>>#include <stdio.h>
>>>>EXEC SQL INCLUDE SQLCA;
>>>>
>>>>main()
>>>>{
>>>>
>>>> db_init(&sqlca);
>>>> EXEC SQL WHENEVER SQLERROR GOTO ERROR;
>>>> EXEC SQL CONNECT "dba" IDENTIFIED BY "sql";
>>>> EXEC SQL UPDATE employee
>>>>          set emp_lname = 'Plankton'
>>>>          where emp_id = 195;
>>>> EXEC SQL COMMIT WORK;
>>>> EXEC SQL DISCONNECT;
>>>> db_fini(&sqlca);
>>>> return (0);
>>>>
>>>> error:
>>>> printf("update successful -- sqlcode = %ld.n", sqlca.sqlcode );
>>>> db_fini(&sqlca);
>>>> return (-1);
>>>>}
>>>
>>--------------------------------------------------------------------------
>-----
>>>>
>>>>I named the above program as example.sqc
>>>>
>>>>When I run,
>>>>              sqlpp -oUNIX example.sqc
>>>>It generates the C source.
>>>>But when I compile it (cc example.c ), it responds with the following
>>>>error messages.
>>>>
>>>>cpp: "example.c", line 13: error 4036: Can't open include file
>>>>'sqlca.h'.
>>>>cpp: "example.c", line 24: error 4036: Can't open include file
>>>>'sqlda.h'.
>>>>
>>>>Can someone help me with this.
>>>>Thanks,
>>>>Connie
>>>>
>>>>
>>>>
>>
Re: Can't open include file 'sqlca.h'. 2001-08-02 20:03
If you installed ASA 7, you should definitely have libdblib7.so.  It should
be in your ${ASANY}/lib directory.  If it isn't there, you (or
someone/something else) may have deleted it or moved it after the
installation ....


>I don't have libdblib7.so in /opt/sybase/SYBSsa7/lib directory.
>Where can I get the libdblib7.so or how can I build one?

It's installed in ${ASANY}/lib by the installer.  (You're sourcing the
${ASANY}/bin/asa_config.[c]sh script, right?)


>Is there any ASA documentation on this issue?

It's probably discussed in the "installatino" or "how to install" section of
the manual.


>Is there a command just compile the Embedded SQL in C/C++
>and generate the object code without compile the C code  (generates from
the
>sqlpp)?

Under ASA, the ESQL/C code is not "compiled" -- it is preprocessed by the
SQL preprocessor (sqlpp).  There is no integrated C compiler & SQL
preprocessor available from Sybase.  Instead, just run sqlpp and then run
gcc on the generated C source code.

(There is a lot of documentation on ESQL/C in the Reference Guide, as well
as an explanation of ESQL/C and the preprocessing of source code.)

-k
Re: Can't open include file 'sqlca.h'. 2001-08-03 15:07
The libdblib7.so and other .so objects are in ${ASANY}/lib directory on Solaris
system.
But on HP-UX ${ASANY}/lib directory, it contains libdblib7.sl and other .sl
files.
I'm working on the HP-UX (version 11.0) system.

Connie


>If you installed ASA 7, you should definitely have libdblib7.so.  It should
>be in your ${ASANY}/lib directory.  If it isn't there, you (or
>someone/something else) may have deleted it or moved it after the
>installation ....
>
>>I don't have libdblib7.so in /opt/sybase/SYBSsa7/lib directory.
>>Where can I get the libdblib7.so or how can I build one?
>
>It's installed in ${ASANY}/lib by the installer.  (You're sourcing the
>${ASANY}/bin/asa_config.[c]sh script, right?)
>
>>Is there any ASA documentation on this issue?
>
>It's probably discussed in the "installatino" or "how to install" section of
>the manual.
>
>>Is there a command just compile the Embedded SQL in C/C++
>>and generate the object code without compile the C code  (generates from
>the
>>sqlpp)?
>
>Under ASA, the ESQL/C code is not "compiled" -- it is preprocessed by the
>SQL preprocessor (sqlpp).  There is no integrated C compiler & SQL
>preprocessor available from Sybase.  Instead, just run sqlpp and then run
>gcc on the generated C source code.
>
>(There is a lot of documentation on ESQL/C in the Reference Guide, as well
>as an explanation of ESQL/C and the preprocessing of source code.)
>
>-k
Re: Can't open include file 'sqlca.h'. 2001-08-07 16:00
cc example.c -I/opt/sybase/SYBSsa7/include -ldblib7
work?

If not, for HP-UX you need to either:
1) source /opt/sybase/SYBSsa7/bin/asa_config.csh (or .sh) to setup PATH and
SH_LIB_PATH
2) add /opt/sybase/SYBSsa7/lib to SH_LIB_PATH
3) add -L/opt/sybase/SYBSsa7/lib to the cc command line.

If that still doesn't work, check out the cc options used by make -f makeall
in the cxmp directory (you probably need to copy the files in cxmp to an
other directory with write permission).

-- Ian McHardy
iAnywhere Solutions (A Sybase Company)

Please reply to the newsgroup, not by e-mail.

>The libdblib7.so and other .so objects are in ${ASANY}/lib directory on
Solaris
>system.
>But on HP-UX ${ASANY}/lib directory, it contains libdblib7.sl and other
.sl
>files.
>I'm working on the HP-UX (version 11.0) system.
>
>Connie
>
>
>>If you installed ASA 7, you should definitely have libdblib7.so.  It
should
>>be in your ${ASANY}/lib directory.  If it isn't there, you (or
>>someone/something else) may have deleted it or moved it after the
>>installation ....
>>
>>>I don't have libdblib7.so in /opt/sybase/SYBSsa7/lib directory.
>>>Where can I get the libdblib7.so or how can I build one?
>>
>>It's installed in ${ASANY}/lib by the installer.  (You're sourcing the
>>${ASANY}/bin/asa_config.[c]sh script, right?)
>>
>>>Is there any ASA documentation on this issue?
>>
>>It's probably discussed in the "installatino" or "how to install"
section of
>>the manual.
>>
>>>Is there a command just compile the Embedded SQL in C/C++
>>>and generate the object code without compile the C code  (generates
from
>>the
>>>sqlpp)?
>>
>>Under ASA, the ESQL/C code is not "compiled" -- it is preprocessed by
the
>>SQL preprocessor (sqlpp).  There is no integrated C compiler & SQL
>>preprocessor available from Sybase.  Instead, just run sqlpp and then
run
>>gcc on the generated C source code.
>>
>>(There is a lot of documentation on ESQL/C in the Reference Guide, as
well
>>as an explanation of ESQL/C and the preprocessing of source code.)
>>
>>-k
>
Can't open include file 'sqlca.h'. 2001-08-01 20:43
Re: Can't open include file 'sqlca.h'. 2001-08-01 21:10
Re: Can't open include file 'sqlca.h'. 2001-08-01 21:50
Re: Can't open include file 'sqlca.h'. 2001-08-01 22:45
Re: Can't open include file 'sqlca.h'. 2001-08-02 16:30
Re: Can't open include file 'sqlca.h'. 2001-08-02 20:03
Re: Can't open include file 'sqlca.h'. 2001-08-03 15:07
Re: Can't open include file 'sqlca.h'. 2001-08-07 16:00