[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
Edit » VisualCSharpHelloWorldWindowsWpf » Assembler » Calculating and Validating NMEA Checksums » TurboCpp » WhatLinksHere » QbasicFAQ_WhenToUseSubs » CppWchar_t » Martin Richards » Curl Content Language » CppLinkingError
Displaying differences between revision 10 and the latest revision
= (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.
[code]
#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;
}
*/
[/code]
In C++ Builder the error message will be:
[code]
[Linker Error] Unresolved external 'doSomething()'
referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
[/code]
== Other errors ==
* C++ compile errors
* C++ linking errors
* C++ runtime errors
* [[CppBuilderC compileE errors | C++ Builder compile errors ]] s
* C++ Builder linking errors
* C++ Builder run-time errors
* C++ Builder misc errors
== Topic links ==
* [blue]::[/blue], scope operator
* [blue]<<[/blue], stream out operator
* #include
* const
* cout
* endl
* #include
* iostream
* main
* return
* scope operator, [blue]::[/blue]
* std
* stream out operator, [blue]<<[/blue]
* vector¶
¶
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
Edit » VisualCSharpHelloWorldWindowsWpf » Assembler » Calculating and Validating NMEA Checksums » TurboCpp » WhatLinksHere » QbasicFAQ_WhenToUseSubs » CppWchar_t » Martin Richards » Curl Content Language » CppLinkingError
Displaying differences between revision 10 and the latest revision
= (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.
[code]
#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;
}
*/
[/code]
In C++ Builder the error message will be:
[code]
[Linker Error] Unresolved external 'doSomething()'
referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
[/code]
== Other errors ==
* C++ compile errors
* C++ linking errors
* C++ runtime errors
* [[CppBuilder
* C++ Builder linking errors
* C++ Builder run-time errors
* C++ Builder misc errors
== Topic links ==
* [blue]::[/blue], scope operator
* [blue]<<[/blue], stream out operator
* #include
* const
* cout
* endl
* #include
* iostream
* main
* return
* scope operator, [blue]::[/blue]
* std
* stream out operator, [blue]<<[/blue]
* vector¶
¶
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
