For my previous programming project in Linux, I have a flex input file that uses C code in the definitions and subroutines sections. I run it through flex, and then compile the resulting lex.yy.c file using the command:
g++ lex.yy.c -ll -o output_file
For my current project, I need to make additions to this file using C++ code, not C.
As a test, I included the <iostream> library, added one cout statement, and tried to compile. The compile indicated an error saying that cout was not recognized, but that was overcome by including the <iostream.h> library instead of <iostream>.
Now it compiles, but gives a warning that I am using a "deprecated or antiquated header", and that I can disable this warning by using the g++ option: -Wno-deprecated.
This is my question: If I disable this warning by using the above option as described, could any errors arise when I add a lot of C++ headers and code to my flex input file? Is it a potentially bad thing to continue using "deprecated or antiquated headers" by using the <.h> versions of header files?
If you #include <iostream>, then either you need to use the std namespace or prefix cout with std::. That should fix your original problem and avoid this one.
The bad thing that can happen when using deprecated headers is someday you upgrade your compiler and suddenly your code stops compiling because the deprecated header was deleted.
Ah darn it, I keep forgetting to use "using namespace std;"... stupid. Thanks for answering.
Another question I have is: what does the g++ -ll option do? The man pages say that it's supposed to link a bunch of libraries, but I don't know exactly what. I've tried googling and came up with absolutely nothing.