Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

534 views
Skip to first unread message

LMCO

unread,
Aug 1, 2001, 3:06:19 PM8/1/01
to
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

Reg Domaratzki

unread,
Aug 1, 2001, 3:10:52 PM8/1/01
to
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"

"LMCO" <conni...@lmco.com> wrote in message news:3B684DB6...@lmco.com...

LMCO

unread,
Aug 1, 2001, 3:50:26 PM8/1/01
to
I'm running it on UNIX, I have "/opt/sybase/SYBSsa7/include" in my path.

Connie

Ian McHardy

unread,
Aug 1, 2001, 4:45:41 PM8/1/01
to
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.

"LMCO" <conni...@lmco.com> wrote in message

news:3B685D82...@lmco.com...

LMCO

unread,
Aug 2, 2001, 10:56:54 AM8/2/01
to
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

Kris Vorwerk

unread,
Aug 2, 2001, 3:28:06 PM8/2/01
to
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

LMCO

unread,
Aug 3, 2001, 9:41:21 AM8/3/01
to
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

Ian McHardy

unread,
Aug 7, 2001, 11:01:44 AM8/7/01
to
On HP-UX, the libraries correctly have the extension .sl (all other UNIX
platforms have .so). Did the cc line I specified Aug 1:
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.

"LMCO" <conni...@lmco.com> wrote in message

news:3B6AA216...@lmco.com...

0 new messages