c and kdevelop

This is a discussion on c and kdevelop within the Tech Board forums, part of the Community Boards category; I know this subject doesn't really fit here but I'll try it anyway. I'm trying to start a C project ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    37

    c and kdevelop

    I know this subject doesn't really fit here but I'll try it anyway.
    I'm trying to start a C project with KDevelop using by opening a new project, select a C "hello world program". After selecting the right projectdirectory from where the project will be built I get a nice simple hello program with gnu automake.

    Well, everything looks fine. But I want to add some source, so I started to create a directory "include" and add a xxx.h file in it. Now here comes the drama for me. If I want to build the project, it keeps complaining about a xxx.h doesn't exist. I tried #include "xxx.h" as well as #include <xxx.h> I checked the automake.am and it seems not filled the right way I suppose. In another C project I imported once, it works well and in the automake.am it has noinst_HEADER = blabla.h blabla2.h ....
    The one I have has _SOURCE = xxx.h I assume it should be something like noinst_HEADER = xxx.h Tried that out, and still have the smame issue.

    And though I love opensource and KDevelop is opensource, it really hurts in my heart to not having a simple thing done. The docs isn't complete, I can't post on a kdevelop forum as I can't subscribe, I'm totally lost.

    I hope someone is able to help me out here, thanks!
    Last edited by Andaluz; 08-31-2009 at 10:15 AM.

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    I don't use kdevelop, but I've used autotools a little bit. What works for me in this regard is to put *all* source code in a subdirectory, src/, then in the top level Makefile.am:
    Code:
    SUBDIRS = src
    Then you have to have another Makefile.am in src/ with a line like this:
    Code:
    myproj_SOURCES = myproj.c myproj.h bonus.h
    Of course, all those must actually be in src/, and you still need #include "myproj.h" in myproj.c, etc. What the files are called doesn't matter, but the prefix to _SOURCES should be the executable name.

    You are right, autotools is poorly documented and not so easy to use. IMO, tho, there is no reason to do so unless you want to produce a configurable package, eg for distribution. It is much simpler to just use gcc on the command line while developing, etc, and AFAIK there is not much purpose to a makefile on small personal projects, nor is it necessary.
    Last edited by MK27; 08-31-2009 at 02:00 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    37
    Thnx for your response,

    I agree with you, but as you might know, I don't want to stick to small projects. There will be a time you want to build a bigger project, than there must be a way to realize that, without diving into the details of how build tools work so you can tweak here and there.

    I now realize that opensource is free (which is great), but not easy. Those who claim that their software is much better, easier or whatever is mostly nonsense. Opensource free development tools are a pain in the *** to make good use of it.

    Features that don't work well, or you need some tweaking should be released for experienced users, hackers or whatever. For beginners or coders who don't want all that advanced features need a basic release. This prevents from making less experienced programmers demolish their parents house or go to Dr. Phill because of problems in their marriage.

  4. #4
    Ugly C Lover audinue's Avatar
    Join Date
    Jun 2008
    Location
    Indonesia
    Posts
    489
    Quote Originally Posted by Andaluz View Post
    Thnx for your response,

    I agree with you, but as you might know, I don't want to stick to small projects. There will be a time you want to build a bigger project, than there must be a way to realize that, without diving into the details of how build tools work so you can tweak here and there.

    I now realize that opensource is free (which is great), but not easy. Those who claim that their software is much better, easier or whatever is mostly nonsense. Opensource free development tools are a pain in the *** to make good use of it.

    Features that don't work well, or you need some tweaking should be released for experienced users, hackers or whatever. For beginners or coders who don't want all that advanced features need a basic release. This prevents from making less experienced programmers demolish their parents house or go to Dr. Phill because of problems in their marriage.
    They might just practical developers who don't understand the concept behind software engineering.
    Just GET it OFF out my mind!!

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21