[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppLinkingError

(C++) Linking error

An error found during  ?linking or run-time.

Mostly, this means that in the header files, you've give the declaration of a function, but nowhere given the function body.

The code below has the function definition commented out, resulting in a linking error.

  1. include <iostream>
//Declaration of doSomething(); void doSomething(); int main() { doSomething(); return 0; } //Definition of the function //Removing this part returns in a linking error /* //Commented this function out to generate a linker error. void doSomething() { std::cout << "Hello world" << std::endl; }
  • /


In C++ Builder the error message will be:
[Linker Error] Unresolved external 'doSomething()' 
referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ


Other errors

Topic links



last edited (July 3, 2007) by bilderbikkel, Number of views: 9999, Current Rev: 11 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.