Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
why is include not working? - beginner question
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="James Kanze, post: 3960467"] Have you read the documentation of your compiler? How to invoke the compiler depends on the implemenation: using -I or /I seems to be an almost universal choice for specifying include paths (i.e. telling the compiler where to look for included files). Some compilers allow the option and the path to be separated by a space, others not. (In practice, almost all of the compilers which use /I also understand -I, and all those which allow the space accept the option without it, so it's common here to simply say -Ipath, which works with pretty much all compilers, even if it isn't the "preferred" form for some.) I will warn you, however, that most compiler documentation isn't for beginners. And that it's a point that most beginners' books do seem to ignore. (On the other hand, what beginners' book could have given you the idea that -Iwhatever was legal in the source code?) How is $SQLAPI defined in your shell? For starters, what you have to do (with g++, but this also works with most other compilers) is -Ipath, where path is the specification of where the compiler should look for the files, in this case, the path where your SQLAPI product installed the header files. (Probably something like /opt/SQL/include or /usr/local/include, depending on the system.) But it's a pain to have to type this in every time, and to keep in mind where all of the different products are installed on different systems, so it's usual to set up an environment variable for each product in your login file, pointing to its root, and use this. Read the documentation of your shell for this. The problem is that you're dealing with several different layers: the shell which interprets your command line, your compiler, and the language. You need to know all three. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
why is include not working? - beginner question
Top