LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-02-2012, 03:06 PM   #1
smilebhuff
LQ Newbie
 
Registered: May 2012
Posts: 11

Rep: Reputation: Disabled
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?
 
Old 05-03-2012, 02:48 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,644

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error:: Makefile:65 *** Linux source not found. Stop. bilal_mld Linux - Newbie 2 06-28-2010 07:01 AM
Makefile - Problem with linking kerenLinuxForum Linux - Software 5 08-27-2008 01:00 PM
basic linking and makefile question blackzone Programming 3 07-20-2006 12:11 PM
error linking oracle developer suite under linux arokh Linux - Software 1 11-14-2003 06:48 AM


All times are GMT -5. The time now is 12:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration