Error "undefined reference to"

This is a discussion on Error "undefined reference to" within the Linux Programming forums, part of the Platform Specific Boards category; Hi ! I am getting the error when I try to compile the project after adding a new .cpp file ...

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    104

    Error "undefined reference to"

    Hi !

    I am getting the error when I try to compile the project after adding a new .cpp file

    and .h header file........

    I have add these files in say ABC folder and made entry in makefile.am.......

    But when I compile project it give error as follow :

    Code:
    ../src/.libs/libProject.so: undefined reference to `ABC::ABC()'
    ../src/.libs/libProject.so: undefined reference to `ABC::GetFileName(QString)'

    The constructor of this class and function are called from file XYZ.cpp in folder

    MAP.......

    I have include ABC.h in XYZ.cpp and when compile gives above error.......

    Help me......

    Bargi
    Last edited by Bargi; 09-13-2007 at 04:38 AM. Reason: Additional information

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Error "undefined reference to"
    Read the forum runes - especially about cross-posting.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. C OpenGL Compiler Error?
    By Matt3000 in forum C Programming
    Replies: 12
    Last Post: 07-07-2006, 04:42 PM
  5. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 09:18 AM

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