LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compiling Errors!! - Slackware 11.0 - Kdevelop (https://www.linuxquestions.org/questions/linux-newbie-8/compiling-errors-slackware-11-0-kdevelop-550551/)

leokalf 05-01-2007 11:56 PM

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.

GrapefruiTgirl 05-02-2007 12:26 AM

Do you have the kernel source installed, and the kernel headers that go with the glibc on the system?

fotoguy 05-02-2007 04:55 AM

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.

leokalf 05-05-2007 03:28 PM

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.

H J 05-12-2007 02:44 PM

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.

leokalf 05-13-2007 10:02 PM

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.

H J 05-15-2007 03:44 PM

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?

leokalf 05-17-2007 09:38 AM

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


All times are GMT -5. The time now is 12:24 AM.