LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-18-2013, 09:25 PM   #1
nalldavid
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Rep: Reputation: Disabled
error: implicit declaration of function | mapping mesa to xserver


Hey everyone,

I've been trying to learn how graphics drivers work in linux browsing the mesa, x, drm and kernel source code. I'm going to hack a graphics driver and before you say this is unnecessary I'm going to modify the hardware as well.

I haven't been able to figure out the functions x uses after calls like glCreateContext, etc. I've finally decided to use xf86DrvMsg in each function to see how things are initialized and called. I've been putting this in each function in the mesa source but when i build it I get the error: implicit declaration of function 'xf86DrvMsg'. I've googled this and have seen very basic tutorials on linking libraries but the makefiles for Mesa and X are very complex. Would anyone know how to link mesa source to this function in the x server in the makefiles?

Thanks in advance!
 
Old 04-20-2013, 11:00 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 15,627

Rep: Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123
try google:
http://bytes.com/topic/c/answers/708...ation-function
https://www.linuxquestions.org/quest...nction-329563/

Actually it is not related to mesa at all.
 
Old 04-20-2013, 12:04 PM   #3
nalldavid
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks pan64,
Yeah I know it's not a mesa problem I was just trying to give some background. I've already read the first one when googling the error.

The function prototype for xf86DrvMsg is declared in /usr/include/xorg/xf86.h which i have #included in all the source files I edited. I probably should have mentioned that. When googling the error I read that not only do you have to include the prototype but you have to tell the compiler to link to the library where the function is really defined.

The function is defined in x/hw/xfree86/common/xf86helper.c. The makefile in the common xfree86 directory makes a libcommon referencing the helper file but I cannot find a libcommon using locate libcommon from a terminal and I can't figure out how libcommon is used in the rest of the xserver compilation. So I don't know how to tell the compiler to link to the function itself. This is where I'm stuck.
 
Old 04-20-2013, 12:12 PM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 15,627

Rep: Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123Reputation: 5123
no, it is not a linking problem, it is a compile time problem. Actually it means you try to use a function without #include-ing its header. You will not be able to link your code at all (or you cannot be sure about the result), first you need to solve this issue. But without additional info we cannot help more. Probably you can send the whole error message, build command and related source files.
 
  


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: implicit declaration of function ‚??find_task_by_pid_type‚?? sindhu4sind Linux - Newbie 1 05-09-2012 01:27 PM
[SOLVED] error: implicit declaration of function 'i2c_smbus_read_byte_data' sajnanazeer Programming 5 08-18-2011 11:14 AM
why do I get implicit declaration of function 'open' error on linux hellgirl Programming 2 09-13-2009 07:21 PM
implicit declaration of function error HarryBoy Programming 3 09-11-2008 08:29 AM
error:implicit declaration of function Ďget_filesystem_listí swift_a2002 Programming 1 05-15-2007 04:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:09 AM.

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
Open Source Consulting | Domain Registration