Re: [Dev-C++] linking error 'undefined reference'
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Gregor P. <pe...@in...> - 2002-01-14 19:35:26
|
Hi Luigi, thanks for your elaborated answer. > For example I use: #include "my_class.hpp" and #include <iostream>; so > that if > I have to take some program to another system, I'll copy the file > "my_class.hpp" too, instead I won't copy "iostream", because I know that > the target system has its own copy of that file. Normally I do it the same way. Command is a class which is needed in different projects und itself it is work in progress. So instead of changing, copying and asking myself if I put it everywhere where it is needed I decided to put it in a private lib-dir and add this to the automaticly by dev-c++ searched paths. > In light of the above, the function "yy_flex_alloc(unsigned int)" is > somehow missing. Since the file lex.yy.c is already in the project, > probably you forgot to write the definition of the function > "yy_flex_alloc", so there is only a declaration of the function, > probably in the header file "lex.yy.h" (that is: the linker only has a > prototype). flex does generate the declerations but not in a seperate file which should be no problem as far as I understood your example. By the way thanks for that. That's it what's missing in all the tutorials, they all end up with '... and then compile it to a running executable'. But as I am learning right now it is a long way from source-code over finding/including the right header files over getting compiled object-code to a well linked program. > Let me know if what I said did help. It did :-) For now it looks like I trapped into a bug of mingw and flex, see: http://www.cygwin.com/ml/cygwin/1999-12/msg00382.html I (still) try to switch from mingw to cygwin gcc which unfortunately isn't done by clicking an dev-c++ option. :-( So if someone is experienced in this case I would appreciate for some tips. Gregor (pe...@in...) |