LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   linux makefile linking error __line__ (https://www.linuxquestions.org/questions/linux-newbie-8/linux-makefile-linking-error-__line__-942976/)

smilebhuff 05-02-2012 03:06 PM

linux makefile linking error __line__
 
I am getting the following error in Linux "undefined reference to __line__. I know that C has implicit macro __LINE__. In code __line__ is assigned with __LINE__ as

extern int __line__; ( variable name is in small letters but just same as macro which is in captial letters)
LDF(__line__ = __LINE__);
so __line__ is a variable not macro here which is assigned with value of __LINE__. Here it is extern int, so it should have been declared somewhere as just int __line__. But am not seeing any header or c file where _line_is declared. Also this error am getting not during compilation of .c file but while linking of .o files.

This error is not coming in UNIX. Additionally while linking libgen, libposix4 libraries are linked. These libraries are present only in UNIX not in LINUX I assume that int __line__; is present somewhere in these libraries or how can i resolve this error?

pan64 05-03-2012 02:48 AM

what do you want to build/link?
usually there is a configure executable, you should run it both on unix and on linux also.


All times are GMT -5. The time now is 01:27 AM.