haverlan@tramp.colorado.edu (HAVERLAND MARC BRADLEY) (03/01/91)
Hello net, I am trying to use Sybase's DB-Library with g++. I have been able to compile and run all the example programs with gcc, and have successfully written another, but I'm having trouble using g++. All programs compile and run fine with gcc. I have rewritten the parts of the sybase header files that I need now (added ANSI prototypes), but when I try to compile with g++, all the db___ calls are "undefined symbols referenced in text segment." That is, dbbind.o, dbinit.o, etc. I am using libsybdb.a, and it seems to be finding the library ok, just not the functions in it. Any input, sample source, etc. would be most welome. Thanks, Marc Haverland haverlan@tramp.colorado.edu 303-760-5647
sundvall@bio.embnet.se (Mats Sundvall) (03/04/91)
In article <1991Mar1.063315.20306@csn.org>, haverlan@tramp.colorado.edu (HAVERLAND MARC BRADLEY) writes: > > Hello net, > > I am trying to use Sybase's DB-Library with g++. I have been able to > compile and run all the example programs with gcc, and have successfully > written another, but I'm having trouble using g++. > > All programs compile and run fine with gcc. I have rewritten the parts > of the sybase header files that I need now (added ANSI prototypes), but > when I try to compile with g++, all the db___ calls are "undefined symbols > referenced in text segment." That is, dbbind.o, dbinit.o, etc. I am > using libsybdb.a, and it seems to be finding the library ok, just not the > functions in it. > > Any input, sample source, etc. would be most welome. > > Thanks, > > Marc Haverland haverlan@tramp.colorado.edu 303-760-5647 I do not know anything about g++ but I am using sybase dblibrary with Sun C++. I you mention it is necessary to add ANSI prototypes. You also have to add an extern "C" { } around your header file to get C linkage. This works with Sun C++. By the way, I think the support I got from Sybase when I had this problem was very bad. I asked them if anyone had done these conversions and if I could get the header files with ANSI prototypes. Well, I do not know was the answer! Well, I did it myself, in the real world you cannot wait for a support guy to decide if he is going to support... So, when we are at it, have anyone made an object interface for Sybase. I am not sure if it is possible, but I think it should be possible to have a class of persitent objects, that can be saved and retrieved from the database. Mats Sundvall, Uppsala University, Sweden