Find the answer to your Linux question:
Results 1 to 8 of 8
(do you think this is the appropriate forum for such message? I am newbie!) Hi... I am new to linux and kdevelop...I come from the planet of microsoft and Visual ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2004
    Location
    Finland
    Posts
    17

    Kdevelop, C++ and ccRTP newbie


    (do you think this is the appropriate forum for such message? I am newbie!)


    Hi...
    I am new to linux and kdevelop...I come from the planet of microsoft and Visual Basic
    I can write C++, but still couldn't figure out the "make" and "configure" stuff...It was all hidden in MS VC++ (i don't remember having to deal with them)
    Does any one know a good tutorial about writing a C++ "hello world" program and explain everything i need: make, configure, how to add/create libraries..etc but not advanced stuff, like UI and DB... etc. Nearly all the tutorials i found either very very simple or very very advanced, nothing in between!!!

    I am currently doing a project as part of my studies, I need to integrate ccRTP (http://www.gnu.org/software/ccrtp/) library with my application. I successfully compiled/installed ccRTP and the required commonC++ needed by it. It also include a demo code, with a make file, i was able to compile the demo and the output worked fine. I tried building a new projet in KDevelop and I had all sort of error messages one can imagine (of which non i understood!) Here is what i did, tell me where did i go wrong:

    1- In KDevelop, created a new project, named test (C++ "hello world" project type)
    2- run automake & friends
    3- Run configure
    4- Build project, here is the output:
    ================================================== =======================
    cd "/root/test/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
    *shell-init: could not get current directory: getcwd: cannot access parent directories: No such file or directory
    *chdir: could not get current directory: getcwd: cannot access parent directories: No such file or directory
    *gmake all-recursive
    *Making all in src
    *if g++ -DHAVE_CONFIG_H -I. -I/root/test/src -I.. -O0 -g3 -MT test.o -MD -MP -MF ".deps/test.Tpo" -c -o test.o /root/test/src/test.cpp; then mv -f ".deps/test.Tpo" ".deps/test.Po"; else rm -f ".deps/test.Tpo"; exit 1; fi
    */bin/sh ../libtool --mode=link g++ -O0 -g3 -o test test.o
    *mkdir .libs
    *g++ -O0 -g3 -o test test.o
    ================================================== =======================
    and I can run the test program.
    5- Now, i added this line:
    #include <ccrtp/rtp.h>
    6- Run automake & friends
    7- Run configure
    8- build the project, here is the output:
    ================================================== =======================
    *cd "/root/test/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
    *shell-init: could not get current directory: getcwd: cannot access parent directories: No such file or directory
    *chdir: could not get current directory: getcwd: cannot access parent directories: No such file or directory
    *gmake all-recursive
    *Making all in src
    *if g++ -DHAVE_CONFIG_H -I. -I/root/test/src -I.. -O0 -g3 -MT test.o -MD -MP -MF ".deps/test.Tpo" -c -o test.o /root/test/src/test.cpp; then mv -f ".deps/test.Tpo" ".deps/test.Po"; else rm -f ".deps/test.Tpo"; exit 1; fi
    *In file included from /usr/local/include/ccrtp/iqueue.h:50,
    *from /usr/local/include/ccrtp/ioqueue.h:50,
    *from /usr/local/include/ccrtp/cqueue.h:50,
    *from /usr/local/include/ccrtp/rtp.h:56,
    *from /root/test/src/test.cpp:27:
    */usr/local/include/ccrtp/queuebase.h:50:26: cc++/pointer.h: No such file or directory
    *In file included from /usr/local/include/ccrtp/rtppkt.h:44,
    *from /usr/local/include/ccrtp/queuebase.h:51,
    *from /usr/local/include/ccrtp/iqueue.h:50,
    *from /usr/local/include/ccrtp/ioqueue.h:50,
    *from /usr/local/include/ccrtp/cqueue.h:50,
    *from /usr/local/include/ccrtp/rtp.h:56,
    *from /root/test/src/test.cpp:27:
    */usr/local/include/ccrtp/base.h:44:25: cc++/config.h: No such file or directory
    */usr/local/include/ccrtp/base.h:45:25: cc++/socket.h: No such file or directory
    *In file included from /usr/local/include/ccrtp/rtppkt.h:44,
    *from /usr/local/include/ccrtp/queuebase.h:51,
    *from /usr/local/include/ccrtp/iqueue.h:50,
    *from /usr/local/include/ccrtp/ioqueue.h:50,
    *from /usr/local/include/ccrtp/cqueue.h:50,
    *from /usr/local/include/ccrtp/rtp.h:56,
    *from /root/test/src/test.cpp:27:
    */usr/local/include/ccrtp/base.h:59: error: syntax error before `=' token
    */usr/local/include/ccrtp/base.h:62: error: syntax error before `;' token
    */usr/local/include/ccrtp/base.h:65: error: syntax error before `;' token
    */usr/local/include/ccrtp/base.h: In function `int CCXX_EXPORT(timeval)':
    */usr/local/include/ccrtp/base.h:75: error: syntax error before `(' token
    */usr/local/include/ccrtp/base.h:75: error: `microtimeout_t' undeclared (first use this function)
    */usr/local/include/ccrtp/base.h:75: error: (Each undeclared identifier is reported only once for each function it appears in.)
    */usr/local/include/ccrtp/base.h:75: error: syntax error before `)' token
    */usr/local/include/ccrtp/base.h:85: error: syntax error before `(' token
    */usr/local/include/ccrtp/base.h:97: error: syntax error before `(' token
    */usr/local/include/ccrtp/base.h:104: error: syntax error before `=' token
    */usr/local/include/ccrtp/base.h:107: error: syntax error before `=' token
    *In file included from /usr/local/include/ccrtp/rtppkt.h:45,
    *from /usr/local/include/ccrtp/queuebase.h:51,
    *from /usr/local/include/ccrtp/iqueue.h:50,
    *from /usr/local/include/ccrtp/ioqueue.h:50,
    *from /usr/local/include/ccrtp/cqueue.h:50,
    *from /usr/local/include/ccrtp/rtp.h:56,
    *from /root/test/src/test.cpp:27:
    */usr/local/include/ccrtp/formats.h:68: error: syntax error before `;' token
    */usr/local/include/ccrtp/formats.h:71: error: syntax error before `=' token
    */usr/local/include/ccrtp/formats.h:136: error: syntax error before `{' token
    */usr/local/include/ccrtp/formats.h:151: error: syntax error before `(' token
    */usr/local/include/ccrtp/formats.h:165: error: destructors must be member functions
    */usr/local/include/ccrtp/formats.h:165: error: virtual outside class declaration
    */usr/local/include/ccrtp/formats.h: In function `void PayloadFormat()':
    */usr/local/include/ccrtp/formats.h:172: error: `PayloadType' undeclared (first use this function)
    */usr/local/include/ccrtp/formats.h:172: error: syntax error before `)' token
    */usr/local/include/ccrtp/formats.h: In function `void setPayloadType(...)':
    */usr/local/include/ccrtp/formats.h:173: error: `payloadType' undeclared (first use this function)
    */usr/local/include/ccrtp/formats.h:173: error: `pt' undeclared (first use this function)
    */usr/local/include/ccrtp/formats.h:180: error: `uint32' undeclared (first use this function)
    */usr/local/include/ccrtp/formats.h:180: error: syntax error before `)' token
    */usr/local/include/ccrtp/formats.h: In function `void setRTPClockRate(...)':
    */usr/local/include/ccrtp/formats.h:181: error: `RTPClockRate' undeclared (first use this function)
    */usr/local/include/ccrtp/formats.h:181: error: `rate' undeclared (first use this function)
    */usr/local/include/ccrtp/formats.h:184: error: syntax error before `;' token
    */usr/local/include/ccrtp/formats.h:188: error: 'uint32' is used as a type, but is not defined as a type.
    */usr/local/include/ccrtp/formats.h:189: error: syntax error before `}' token
    */usr/local/include/ccrtp/formats.h:203: error: syntax error before `:' token
    */usr/local/include/ccrtp/formats.h:237: error: syntax error before `:' token
    *In file included from /usr/local/include/ccrtp/queuebase.h:51,
    *from /usr/local/include/ccrtp/iqueue.h:50,
    *from /usr/local/include/ccrtp/ioqueue.h:50,
    *from /usr/local/include/ccrtp/cqueue.h:50,
    *from /usr/local/include/ccrtp/rtp.h:56,
    *from /root/test/src/test.cpp:27:
    */usr/local/include/ccrtp/rtppkt.h:75: error: syntax error before `{' token
    */usr/local/include/ccrtp/rtppkt.h:80: error: syntax error before `public'
    */usr/local/include/ccrtp/rtppkt.h:115: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:121: error: syntax error before `*' token
    */usr/local/include/ccrtp/rtppkt.h:129: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:136: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:143: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:150: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:157: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:166: error: non-member function `bool isPadded()' cannot have `const' method qualifier
    */usr/local/include/ccrtp/rtppkt.h: In function `bool isPadded()':
    */usr/local/include/ccrtp/rtppkt.h:166: error: `getHeader' undeclared (first use this function)
    */usr/local/include/ccrtp/rtppkt.h:175: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:186: error: non-member function `bool isMarked()' cannot have `const' method qualifier
    */usr/local/include/ccrtp/rtppkt.h: In function `bool isMarked()':
    */usr/local/include/ccrtp/rtppkt.h:195: error: non-member function `bool isExtended()' cannot have `const' method qualifier
    */usr/local/include/ccrtp/rtppkt.h: In function `bool isExtended()':
    */usr/local/include/ccrtp/rtppkt.h:202: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:212: error: syntax error before `*' token
    */usr/local/include/ccrtp/rtppkt.h:229: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:244: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:257: error: non-member function `const unsigned char* getHdrExtContent()' cannot have `const' method qualifier
    */usr/local/include/ccrtp/rtppkt.h: In function `const unsigned char*
    *getHdrExtContent()':
    */usr/local/include/ccrtp/rtppkt.h:258: error: `getHeaderExt' undeclared (first use this function)
    */usr/local/include/ccrtp/rtppkt.h:259: error: invalid application of `sizeof' to an incomplete type
    */usr/local/include/ccrtp/rtppkt.h:270: error: non-member function `const unsigned char* const getRawPacket()' cannot have `const' method qualifier
    */usr/local/include/ccrtp/rtppkt.h: In function `const unsigned char* const
    *getRawPacket()':
    */usr/local/include/ccrtp/rtppkt.h:270: error: `buffer' undeclared (first use this function)
    */usr/local/include/ccrtp/rtppkt.h:279: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h:284: error: non-member function `size_t getSizeOfFixedHeader()' cannot have `const' method qualifier
    */usr/local/include/ccrtp/rtppkt.h: In function `size_t getSizeOfFixedHeader()':
    */usr/local/include/ccrtp/rtppkt.h:284: error: `RTPFixedHeader' undeclared (first use this function)
    */usr/local/include/ccrtp/rtppkt.h:286: error: syntax error before `protected'
    */usr/local/include/ccrtp/rtppkt.h:304: error: syntax error before `*' token
    */usr/local/include/ccrtp/rtppkt.h: In function `void setExtension(bool)':
    */usr/local/include/ccrtp/rtppkt.h:321: error: non-local function `const setRTPClockRate(...)::RTPHeaderExt* getHeaderExt()' uses local type `const setRTPClockRate(...)::RTPHeaderExt'
    */usr/local/include/ccrtp/rtppkt.h:321: error: non-member function `const setRTPClockRate(...)::RTPHeaderExt* getHeaderExt()' cannot have `const' method qualifier
    */usr/local/include/ccrtp/rtppkt.h: In function `const
    *setRTPClockRate(...)::RTPHeaderExt* getHeaderExt()':
    */usr/local/include/ccrtp/rtppkt.h:321: error: `const setRTPClockRate(...)::RTPHeaderExt* getHeaderExt()' used prior to declaration
    */usr/local/include/ccrtp/rtppkt.h:322: error: `uint32' undeclared (first use this function)
    */usr/local/include/ccrtp/rtppkt.h:322: error: syntax error before `=' token
    */usr/local/include/ccrtp/rtppkt.h:323: error: `fixsize' undeclared (first use this function)
    */usr/local/include/ccrtp/rtppkt.h:332: error: syntax error before `(' token
    */usr/local/include/ccrtp/rtppkt.h: In function `void setbuffer(const void*,
    *unsigned int, unsigned int)':
    */usr/local/include/ccrtp/rtppkt.h:340: error: 'uint16' is used as a type, but is not defined as a type.
    */usr/local/include/ccrtp/rtppkt.h:342: error: 'uint32' is used as a type, but is not defined as a type.
    */usr/local/include/ccrtp/rtppkt.h:344: error: syntax error before `private'
    */usr/local/include/ccrtp/rtppkt.h:348: error: 'uint32' is used as a type, but is not defined as a type.
    */usr/local/include/ccrtp/rtppkt.h:350: error: 'uint32' is used as a type, but is not defined as a type.
    */usr/local/include/ccrtp/rtppkt.h:352: error: 'uint32' is used as a type, but is not defined as a type.
    */usr/local/include/ccrtp/rtppkt.h:354: confused by earlier errors, bailing out
    *gmake[2]: *** [test.o] Error 1
    *gmake[2]: Target `all' not remade because of errors.
    *gmake[1]:
    **** [all-recursive] Error 1
    *gmake: *** [all] Error 2
    ================================================== =======================

    What on earh is going on?!! Please help me

  2. #2
    Linux User
    Join Date
    Jul 2004
    Posts
    256
    You really don't need a make file unless you are going to distribute, or have a big project. (Make files will only compile changed objects, saving time)

    To compile helloWorld for c or c++:

    C++
    Code:
    g++ -o helloWorld helloWorld.cpp
    C
    Code:
    gcc -o helloWorld helloWorld.c
    --monkey

  3. #3
    Just Joined!
    Join Date
    Jul 2004
    Location
    Finland
    Posts
    17
    I wrote this very simple cpp file:

    #include <iostream>
    #include <ccrtp/rtp.h>
    using namespace std;

    int main(int argc, char *argv[])
    {
    cout << "Hello, world!" << endl;

    return EXIT_SUCCESS;
    }


    then, i compiled with:

    g++ -o test test.cpp

    I got this error:

    In file included from /usr/local/include/ccrtp/iqueue.h:50,
    from /usr/local/include/ccrtp/ioqueue.h:50,
    from /usr/local/include/ccrtp/cqueue.h:50,
    from /usr/local/include/ccrtp/rtp.h:56,
    from test.cpp:28:
    /usr/local/include/ccrtp/queuebase.h:50:26: cc++/pointer.h: No such file or directory

    .
    .
    almost like that in my first post


    Do you think there is something wrong in the way commonC++ (cc++) was installed? which makes me wonder really, how do you make sure it is correctly installed? for example, in windows, you know that by looking in regsitry or system32 folder. Another question, where can i find the include folder? how can i control that, like change or add another path? From the above error, it seems there is something wrong in finding the correct path to cc++. How was the make file that came with ccRTP able to find the corret path? (do you want me to post the make file that came with demo ccRTP?)

  4. #4
    Just Joined!
    Join Date
    Jul 2004
    Location
    Finland
    Posts
    17
    if it'd be any help, the path to cc++ is
    /usr/local/include/cc++2/cc++

  5. #5
    Linux User
    Join Date
    Jul 2004
    Posts
    256
    Where is pointer.h?
    Code:
    $ find / -name pointer.h 2>/dev/null
    --monkey

  6. #6
    Just Joined!
    Join Date
    Jul 2004
    Location
    Finland
    Posts
    17
    I found it here:
    /usr/local/include/cc++2/cc++

    I made the following in KDevelop:
    in Audomake Manager>Options>Include>Add...
    -I/usr/include/cc++/

    and that simple cpp application compiled, run and debugged just fine in KDevelop

    But that is like a blind shot that scored

    Was what i did correct? I want to understand what is going on...

  7. #7
    Just Joined!
    Join Date
    Jul 2004
    Location
    Seattle, WA or Lewisburg, PA. Depending on time of year.
    Posts
    37
    -I/usr/include/cc++/
    by that, if its anything like using gcc or g++ is you added an explicit link to the folder /usr/include/cc++/ . This way, pointer.h is included because it is in the folder you specified explicitly. (I am assuming, of course, that the -l at the beginning is an "L" (lowercase), sometimes hard to tell

    Hope that helps.

  8. #8
    Just Joined!
    Join Date
    Jul 2004
    Location
    Finland
    Posts
    17
    I can understand that adding explicit path will make things work, but shouldn't that path be added somewhere when i installed commonc++? should KDevelop be aware of this?

    I think if anyone can direct me to a tutorial that at least give an idea of what is going on (kdevelop manual does not say what is going on behind the scene)...any one in his path of learning came across such a tutorial? it would very much great...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •