Thread: XBase but examples not running.

  1. #1
    Registered User Stoneart's Avatar
    Join Date
    Aug 2011
    Location
    South Africa
    Posts
    6

    Question XBase but examples not running.

    Hi everybody.. I just registered on this forum and on the inevitable path of learning C++ coming from the Pascal/Delphi background. I'm trying to adapt to what I'm comfortable with, one being XBase. My Op. system is Linux/Ubuntu and using both Anjuta and Netbeans. The example is sample1.cpp but it gives error messages such as below..
    I would appreciate some help.

    /home/deon/foobar-cpp4/src/main.cc:71: undefined reference to `xbXBase::xbXBase()'
    /home/deon/foobar-cpp4/src/main.cc:72: undefined reference to `xbDbf::xbDbf(xbXBase*)'
    etc...

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Install the required development packages from synaptic; this is a linker error.

  3. #3
    Registered User Stoneart's Avatar
    Join Date
    Aug 2011
    Location
    South Africa
    Posts
    6
    Thanks for the reply.. but I think have have installed everything possible.. what is it that I must still install? Netbeans works and so does Anjuta.. with varies tutor examples.

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    If you've installed the packages, and you believe that xbXBase is defined in those packages, then you need to link the libraries with your program. There's undoubtedly a way to do that in your IDE, but I don't use it so I can't tell you where it is; look for compiler options and libraries.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    You basically need to tell the compiler/linker where to look for those functions/objects, because it isn't psychic. You haven't, and that's why it complains it can't find them.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User Stoneart's Avatar
    Join Date
    Aug 2011
    Location
    South Africa
    Posts
    6
    Thanks tabstop and Elysia for replies. Now do I edit it from the terminal or from the development programs.. because Anjuta doesn't seem to have a place where I can edit the compiler , most probably a config, and Netbeans has .. but doesn't mention a linker other than setting a path e.g /usr/lib .. /usr/include etc.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    It depends on your IDE. Note that an Editor is not an IDE. The IDE will pass on these settings to the compiler, most likely.
    As for how, you're going to have to look in the documentation for the IDE/editor/compiler you use. Look for "lib paths" or the like.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Registered User Stoneart's Avatar
    Join Date
    Aug 2011
    Location
    South Africa
    Posts
    6
    Thanks.. I will do so. In the netbeans.. I have set a path to /usr/lib where I thought all libs should be.. in this case "libxbase.a" which is there.. put the problem does still exist.

  9. #9
    Registered User Stoneart's Avatar
    Join Date
    Aug 2011
    Location
    South Africa
    Posts
    6
    Quote Originally Posted by Elysia View Post
    It depends on your IDE. Note that an Editor is not an IDE. The IDE will pass on these settings to the compiler, most likely.
    As for how, you're going to have to look in the documentation for the IDE/editor/compiler you use. Look for "lib paths" or the like.
    Ok.. I've had a good at both IDE's.. and both have paths set to where "libxbase.a" is..(/usr/lib) I've got a feeling something else is missing. Is there a way of testing if the Xbase library is functional.

  10. #10
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Have a read through this thread.

  11. #11
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by Stoneart View Post
    Ok.. I've had a good at both IDE's.. and both have paths set to where "libxbase.a" is..(/usr/lib) I've got a feeling something else is missing. Is there a way of testing if the Xbase library is functional.
    That just tells where it is, not which of the six million libraries in /usr/lib you intend to use.

  12. #12
    Registered User Stoneart's Avatar
    Join Date
    Aug 2011
    Location
    South Africa
    Posts
    6
    Brilliant... thanks a million.. everybody. for all the help.. It works on Netbeans but still got to see how to duplicate on Anjuta. I went to project properties, linker , library, add library but not library file, and it compiled beautifully.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 13
    Last Post: 12-09-2008, 11:09 AM
  2. gif-lib examples
    By Welder in forum Windows Programming
    Replies: 4
    Last Post: 11-14-2007, 10:38 PM
  3. Looking for a few examples..
    By Brain Cell in forum C++ Programming
    Replies: 5
    Last Post: 12-28-2005, 07:57 AM
  4. SDL-Net: examples?
    By WHurricane16 in forum Game Programming
    Replies: 0
    Last Post: 07-06-2003, 11:57 AM
  5. Any MFC examples on the web , please?
    By L.O.K. in forum Windows Programming
    Replies: 2
    Last Post: 12-10-2002, 08:57 AM