LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 10-20-2014, 07:12 AM   #1
dzaku
LQ Newbie
 
Registered: Jun 2011
Location: POLAND BOAT CITY
Distribution: ARCH-LINUX, DEBIAN, FEDORA, UBUNTU
Posts: 9

Rep: Reputation: Disabled
Unhappy LKM trouble with compile stdint.h


Hi all :")

i have trouble
Code:
usr/lib/gcc/arm-linux-gnueabihf/4.7/include/stdint.h:3:26: error: no include path in which to search for stdint.h


I try write LKM with <bcm2835.h> (http://www.airspayce.com/mikem/bcm28...8h_source.html)

my make file is

Code:
obj-m :=  gpio.o
LIBS = -lbcm2835 -lrt
DEPS=bcm2835.h
all:
        make -C /lib/modules/3.12-1-rpi/build  M=/home/pi/module modules

my example code

Code:
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <bcm2835.h>



MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void) {
  printk("<1> Hello world!\n");
  return 0;
}

static void hello_exit(void) {
  printk("<1> Bye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);
i read somwhere kernel modules, and thus have no access to glibc (or its headers).

Code:
make -C /lib/modules/3.12-1-rpi/build  M=/home/pi/module modules
make[1]: WejÅcie do katalogu '/usr/src/linux-headers-3.12-1-rpi'
Makefile:10: *** mixed implicit and normal rules: deprecated syntax
  CC [M]  /home/pi/module/gpio.o
/home/pi/module/gpio.c:4:21: fatal error: bcm2835.h: Nie ma takiego pliku ani katalogu
compilation terminated.
/usr/src/linux-headers-3.12-1-common/scripts/Makefile.build:314: polecenia dla obiektu '/home/pi/module/gpio.o' nie powiodÅy siÄ
make[4]: *** [/home/pi/module/gpio.o] BÅÄd 1
/usr/src/linux-headers-3.12-1-common/Makefile:1245: polecenia dla obiektu '_module_/home/pi/module' nie powiodÅy siÄ
make[3]: *** [_module_/home/pi/module] BÅÄd 2
Makefile:130: polecenia dla obiektu 'sub-make' nie powiodÅy siÄ
make[2]: *** [sub-make] BÅÄd 2
Makefile:8: polecenia dla obiektu 'all' nie powiodÅy siÄ
make[1]: *** [all] BÅÄd 2
make[1]: Opuszczenie katalogu '/usr/src/linux-headers-3.12-1-rpi'
Makefile:5: polecenia dla obiektu 'all' nie powiodÅy siÄ
make: *** [all] BÅÄd 2

Help?
 
Old 10-20-2014, 07:38 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
A line with "extra INCLUDES" is actually allowed in the Makefile.
Example :
EXTRA_CFLAGS += -I/usr/lib/gcc/arm-linux-gnueabihf/4.7/include/
Code:
obj-m :=  gpio.o
LIBS = -lbcm2835 -lrt
DEPS=bcm2835.h

EXTRA_CFLAGS += -I/usr/lib/gcc/arm-linux-gnueabihf/4.7/include/
all:
        make -C /lib/modules/3.12-1-rpi/build  M=/home/pi/module modules
 
Old 10-20-2014, 10:53 AM   #3
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602

Rep: Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

--jeremy
 
  


Closed Thread



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
lkm COMPILE WITH <bcm2835.h> dzaku Programming 1 10-20-2014 11:47 AM
LKM talking to another LKM? Ljunge Programming 4 11-13-2007 01:29 PM
2.6.10 compile trouble sh4d0w331 Slackware 6 02-20-2005 05:10 PM
Kernel compile trouble tek1024 Linux - General 5 09-26-2004 05:12 PM
Some prob's getting LKM's to compile right hadding Programming 1 11-06-2003 06:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:37 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