LinuxQuestions.org
Review your favorite Linux distribution.
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-01-2007, 11:56 PM   #1
leokalf
LQ Newbie
 
Registered: May 2007
Location: Buenos Aires
Distribution: Slackware 11.0
Posts: 4

Rep: Reputation: 0
Compiling Errors!! - Slackware 11.0 - Kdevelop


Hi. I'am very new in Linux so please be patient with me...

I'm trying to write an app in C with Kdevelop. When I include the header linux/interrupt.h, then the compilation fails with a large number of errors such us constants not declareted an so.

My question is. How can the includes that comes with the source CD of Linux make the project don't compile??? Could be a problem with the version of the kernel an kdevelop or gcc??

Info:

- Distro: Slackware 11.0
- Kernel version: 2.6.13.17
- Kdevelop: 3.4.0

I though that it was a problem of Kdevelop, so I upgraded it from version 3.3.0 to 3.4.0, with no changes. Then I installed EasyEclipse for C/C++ and had the same problem. So the issue must be in the includes that come in CD I supose.

I'm tired of trying solutions for this problems. Please Help me!!

Thanks for your time.
 
Old 05-02-2007, 12:26 AM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Do you have the kernel source installed, and the kernel headers that go with the glibc on the system?
 
Old 05-02-2007, 04:55 AM   #3
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: KirraMail Live Email Server
Posts: 1,279

Rep: Reputation: 61
If you did a full install of slackware 11 then you most likely installed the 2.4.33.3 kernel to start with before you added the 2.6.13.17, then you have the 2.4.33.3 kernel headers files installed by default.

These files are installed to /usr/include/asm-generic /usr/include/asm
/usr/include/linux, if you don't remove or rename and point them to the 2.6 kernel header files, it will keep compiling your software using the 2.4 headers instead of the 2.6.

I will assume you have the 2.6 kernel source in the /usr/src directory, rename these directories so you can always change back if this is not what is causing the problem.

Code:
mv /usr/include/asm /usr/include/asm-2.4
mv /usr/include/asm-generic /usr/include/asm-generic-2.4
mv /usr/include/linux /usr/include/linux-2.4
Now change into the /usr/src directory and remove the symlink to the old 2.4 kernel.

Code:
cd /usr/src
rm -rf linux
ln -s 2.6.13.17 linux
Now symlink the 2.6.13.17 kernels headers to the /usr/include directory

Code:
ln -s /usr/src/linux/include/asm-generic /usr/src/linux/include/asm

ln -s /usr/src/linux/include/linux /usr/include/linux
ln -s /usr/src/linux/include/asm /usr/include/asm
ln -s /usr/src/linux/include/asm-generic /usr/include/asm-generic

Now compile your programs and see if that fixes the compiling errors. Not to say this is the cause, but I had similar issues the other week and found I still had 2.4 headers files installed from the original install, and some software compiled while others would not. Once I removes the files and created symlinks to the 2.6 headers files, I have had no problems compiling since.

Last edited by fotoguy; 05-02-2007 at 04:56 AM.
 
Old 05-05-2007, 03:28 PM   #4
leokalf
LQ Newbie
 
Registered: May 2007
Location: Buenos Aires
Distribution: Slackware 11.0
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks fotoguy for your answer. I tried to do that but I still have problems when compiling with interrupt.h and sched.h headers.

Today I gave up, and installed a new copy of Slackware 11, but still got some errors when including those headers. So my question is WHY THE HEADERS DONT COMPILE IN A NEW COPY SLACKWARE 11????. The first thing i did is to compile this code in Kdevelop:

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <linux/interrupt.h>
#include <linux/sched.h>

main()
{
printf("Hello, world!\n");

}

with no success.

I'm really going insane with this. I cant follow with my project!!!

Anybody knows how to handle interrupts without using these includes or how to make this code to compile ??

Thanks.

Last edited by leokalf; 05-05-2007 at 03:30 PM.
 
Old 05-12-2007, 02:44 PM   #5
H J
LQ Newbie
 
Registered: Apr 2007
Location: Wall Street
Posts: 2

Rep: Reputation: 0
Hi, I am new in Slackware. I trying compile a simple "Hello World!" app in Kdevelop 3.3.0. But I get this error:
Code:
*** YOU'RE USING autoconf (GNU Autoconf) 2.60.
*** KDE requires autoconf 2.53 or newer
What must I do? Thanks for your time.
 
Old 05-13-2007, 10:02 PM   #6
leokalf
LQ Newbie
 
Registered: May 2007
Location: Buenos Aires
Distribution: Slackware 11.0
Posts: 4

Original Poster
Rep: Reputation: 0
You can compile your program in command line doing:

gcc -o yourprogram yourprogram.c

where yourprogram is the name of the source you wrote. This command will create an executable (if compilation success). for mor information ----> man gcc.

Kdevelop do a lot of things that you probably dont need.
 
1 members found this post helpful.
Old 05-15-2007, 03:44 PM   #7
H J
LQ Newbie
 
Registered: Apr 2007
Location: Wall Street
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by leokalf
You can compile your program in command line doing:

gcc -o yourprogram yourprogram.c

where yourprogram is the name of the source you wrote. This command will create an executable (if compilation success). for mor information ----> man gcc.

Kdevelop do a lot of things that you probably dont need.
Thank you for help. This is useful info. But will I do for all *.c files or mymain.c file?
 
Old 05-17-2007, 09:38 AM   #8
leokalf
LQ Newbie
 
Registered: May 2007
Location: Buenos Aires
Distribution: Slackware 11.0
Posts: 4

Original Poster
Rep: Reputation: 0
I think that is gcc -o prog main.c 1.c 2.c an so, but check with man gcc I'm not shure.
 
  


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
Compiling with Kdevelop 52cent Programming 7 04-23-2007 11:43 PM
Errors Compiling Kernel 2.6 on Slackware 10.2 - Old kernel headers required? Dave S. Slackware 8 03-04-2006 12:15 AM
xawtv on Slackware: compiling errors jaakkop Linux - Software 3 11-24-2005 04:35 AM
Kdevelop Makefile Errors Chryzmo Linux - Software 3 02-11-2004 04:17 PM
errors compiling c++ in kdevelop adriaanbw Programming 2 09-13-2003 07:26 AM


All times are GMT -5. The time now is 10:57 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration