C++/ESQL/STL
Posted in 2000
Sean asked for help using C++ with Informix ESQL/C and the STL: his build failed because EXEC SQL statements were still present when the compiler/linker ran, breaking template instantiation. Respondents explained that ESQL/C is a preprocessor: you must compile .ec sources with the esql command (not cc/CC directly), which converts EXEC SQL into plain C/C++ and then calls the compiler — set INFORMIXC to point at your C++ compiler, and use "esql -c" to only preprocess so template instantiation works. No confirmation from the original poster is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I am trying to use C++/ESQL/STL in combination to no avail. When the linker goes to compile the template instantiations it barfs on the preprocessor directives i.e. EXEC SQL etc.. Any help in getting around this would be appreciated. ...Sean Sent via Deja.com http://www.deja.com/ Before you buy.
On Wed, 23 Feb 2000 04:12:16 GMT, sean_hanly@bigfoot.com wrote: > I am trying to use C++/ESQL/STL in combination > to no avail. When the linker goes to compile > the template instantiations it barfs on the > preprocessor directives i.e. EXEC SQL etc.. > > Any help in getting around this would be > appreciated. To tell you the truth, after studying C++ for at least a few years, I can't say I've heard a preprocessor directive "EXEC SQL". And I can't find anything like that in the Standard. It must be an extension of some sort. You will probably have better luck asking in your compiler newsgroup, or an SQL-related newsgroup. Victor -- Please remove capital A's from my address when replying by mail
<sean_hanly@bigfoot.com> wrote: >I am trying to use C++/ESQL/STL in combination >to no avail. When the linker goes to compile >the template instantiations it barfs on the >preprocessor directives i.e. EXEC SQL etc.. > >Any help in getting around this would be >appreciated. Any help you can give us (by indicating which compiler you're using, what the error messages are, etc.) would be appreciated. -- Jon Bell <jtbell@presby.edu> Presbyterian College Dept. of Physics and Computer Science Clinton, South Carolina USA [ Information about newsgroups for beginners: ] [ http://www.geocities.com/ResearchTriangle/Lab/6882/ ]
X-No-Archive: Yes sean_hanly@bigfoot.com wrote: > > I am trying to use C++/ESQL/STL in combination > to no avail. When the linker goes to compile > the template instantiations it barfs on the > preprocessor directives i.e. EXEC SQL etc.. "Exec SQL" should be all gone from your code by the time the linker comes into play. Are you sure you're using your tools properly? > > Any help in getting around this would be > appreciated. > > ...Sean > > Sent via Deja.com http://www.deja.com/ > Before you buy.
Victor Bazarov wrote: > > On Wed, 23 Feb 2000 04:12:16 GMT, sean_hanly@bigfoot.com wrote: > > > I am trying to use C++/ESQL/STL in combination > > to no avail. When the linker goes to compile > > the template instantiations it barfs on the > > preprocessor directives i.e. EXEC SQL etc.. > > > > Any help in getting around this would be > > appreciated. > > To tell you the truth, after studying C++ for at least a few years, I > can't say I've heard a preprocessor directive "EXEC SQL". A ESQL/C compiler is typically just a preproccessors. They take stuff like EXEC SQL, BEGIN DECLARE SECTION & convert it into stuff a C/C++ compiler can understand. So, the OP is doing something wrong here. If his ESQL/C pre-proc is working right, the linker wouldn't see the EXEC SQL at all. Anyway this is not really on-topic here, so clc++ is removed from the follow-up. Maybe the OP can check if the intermediate C/C++ files are being generated by the ESQL/C Compiler. > And I can't > find anything like that in the Standard. It must be an extension of > some sort. You will probably have better luck asking in your compiler > newsgroup, or an SQL-related newsgroup. > > Victor > -- > Please remove capital A's from my address when replying by mail -- regards, Shiva http://www.slack.net/~shiva/
Don't know about STL, but to compile C++/ESQL code (C++ code with embedded SQL statements), one uses the esql command, not the CC (or equivalent). The esql command preprocesses the ".ec" file (making a .c file), converting ESQL statements into something that the C/C++ compiler can understand. It then passes the .c file created on to the C/C++ compiler. By default, esql invokes the cc compiler. You can tell it to use another (e.g your C++ compiler) by setting the environment variable INFORMIXC. Full details of the use of esql command are available in, you guessed it, the manual. Download the pdf version from http://www.informix.com/answers/english/product.htm Cheers Rudy sean_hanly@bigfoot.com wrote: > I am trying to use C++/ESQL/STL in combination > to no avail. When the linker goes to compile > the template instantiations it barfs on the > preprocessor directives i.e. EXEC SQL etc.. > > Any help in getting around this would be > appreciated. > > ...Sean > > Sent via Deja.com http://www.deja.com/ > Before you buy.
sean_hanly@bigfoot.com wrote: > I am trying to use C++/ESQL/STL in combination > to no avail. When the linker goes to compile > the template instantiations it barfs on the > preprocessor directives i.e. EXEC SQL etc.. > > Any help in getting around this would be > appreciated. > > ...Sean > > Sent via Deja.com http://www.deja.com/ > Before you buy. The ESQL/C compiler would create intermediate .C files which would then be used by your C compiler. It seems that you are not using the ESQL/C compiler and are probably trying to compile your programs using just the C compiler. -- Compliments of QueriX -------------------------------------------------------------------------------------------------- QueriX 4GL Compilers are Informix 4GL Compatible, and Connection to other RDBMS such as Oracle. Hydra 4GL Compiler (Compatible with I4GL) Compile once, run everywhere Phoenix Windows GUI. (Front End to 4GL) Chimera Java GUI The only GUI you will ever need... (Front End to 4GL) Arachne Web Technology (Front End to 4GL on the Web) For more details visit: http://www.querix.com/ ---------------------------------------------------------------------------------------------------
In comp.databases.informix sean_hanly@bigfoot.com wrote: > I am trying to use C++/ESQL/STL in combination > to no avail. When the linker goes to compile > the template instantiations it barfs on the > preprocessor directives i.e. EXEC SQL etc.. > Any help in getting around this would be > appreciated. > ...Sean Did you try "esql -c" in order to preprocess only and generate a plain C++ file ? If you are compiling and linking a plain already preprocessed C++ file there should be no template instantiation problems, I guess. --Chris