I programmed a compiler using lex & yacc tools in qnx 4.
I installed qnx6 and the first trouble was that lex & yacc weren’t
implemented yet. So I’m using flex & bison now.
Using the same input files, I can’t compile the c generated files.
By accident I realized that in general I can’t compile any file with the
“c” extension when I was using the math.h library.
So I rename my files using the “cpp” estension.
But I’m getting probles still… The error messages are:
cc y.tab.cpp lex.yy.cpp -o test
/usr/share/bison.simple: In function int yyparse()': /usr/share/bison.simple:358: implicit declaration of function int
yyerror(…)’
cc: /usr/lib/gcc-lib/ntox86/2.95.2/cc1plus error 33
what is the problem in order to compile “c” files?
Do I must modify any enviroment variable ( PATH, for example) ?
You should be able to compile c files. What is the problem you are seeing with them?
I programmed a compiler using lex & yacc tools in qnx 4.
I installed qnx6 and the first trouble was that lex & yacc weren’t
implemented yet. So I’m using flex & bison now.
Using the same input files, I can’t compile the c generated files.
By accident I realized that in general I can’t compile any file with the
“c” extension when I was using the math.h library.
So I rename my files using the “cpp” estension.
But I’m getting probles still… The error messages are:
cc y.tab.cpp lex.yy.cpp -o test
/usr/share/bison.simple: In function int yyparse()': /usr/share/bison.simple:358: implicit declaration of function int
yyerror(…)’
cc: /usr/lib/gcc-lib/ntox86/2.95.2/cc1plus error 33
what is the problem in order to compile “c” files?
Do I must modify any enviroment variable ( PATH, for example) ?
/tmp/AAA331236_cc.o: In function main': /tmp/AAA331236_cc.o(.text+0x31): undefined reference to pow’
/tmp/AAA331236_cc.o(.text+0x51): undefined reference to pow' /tmp/AAA331236_cc.o(.text+0x67): undefined reference to sqrt’
cc: /usr/ntox86/bin/ld error 1
As I told before, by accident I realized that the same code, but with
the extension cpp, works fine.
cc p.cpp -o p
./p
The distance d=5
Do I must to change my PATH?
\
Colin Burgess wrote:
You should be able to compile c files. What is the problem you are seeing with them?
/# cc p.c -o p//
///tmp/AAA331236_cc.o: In function main':// ///tmp/AAA331236_cc.o(.text+0x31): undefined reference to pow’//
///tmp/AAA331236_cc.o(.text+0x51): undefined reference to pow'// ///tmp/AAA331236_cc.o(.text+0x67): undefined reference to sqrt’//
//cc: /usr/ntox86/bin/ld error 1/
As I told before, by accident I realized that the same code, but with
the extension cpp, works fine.
/# cc p.cpp -o p//
//# ./p//
//The distance d=5/
Do I must to change my PATH?
\
Colin Burgess wrote:
You should be able to compile c files. What is the problem you are seeing with them?
If you use these functions you have to include the math lib. The C++ library
uses the math functions, so it will pull in the lib, but if you are compiling
a c program, add -lm to your link line.
ok, suppose that i have a file p.c with the following code:
/tmp/AAA331236_cc.o: In function main': /tmp/AAA331236_cc.o(.text+0x31): undefined reference to pow’
/tmp/AAA331236_cc.o(.text+0x51): undefined reference to pow' /tmp/AAA331236_cc.o(.text+0x67): undefined reference to sqrt’
cc: /usr/ntox86/bin/ld error 1
As I told before, by accident I realized that the same code, but with
the extension cpp, works fine.
cc p.cpp -o p
./p
The distance d=5
Do I must to change my PATH?
Colin Burgess wrote:
You should be able to compile c files. What is the problem you are seeing with them?