Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Linker error(Unable to resolve error given by linker)
Linker error [message #1775331] Fri, 27 October 2017 17:30 Go to next message
Derek Boucher is currently offline Derek BoucherFriend
Messages: 1
Registered: October 2017
Junior Member
Hello,

Hopefully I am in the right place to ask for help about this. I am currently writing a simple program in C++ that takes in an integer value given by the user and then has the user decide what operations to perform on that number (i.e. double the number, find the square root of the number, etc...)

However I've come across an issue where eclipse compiler says the following:

Undefined symbols for architecture x86_64:
"numDouble(int)", referenced from:
menu2(int) in q2.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [A3q2] Error 1

I am aware that this has to do with my function called numDouble(int), however, i have declared the function globally, as well as given a full definition of it at the very bottom of my code...

here is how i declared the function:

void numDouble(int); (globally)

here is how i defined my function:

void numDouble(int &x)
{
x *= 2;
menu2(x);
}

and here is how i called it, from my menu2(int x) function:

switch(choice)
{
case 1:
numDouble(x);
break;

... more switch cases.

I have already written more complex codes than this and had no issues... I have updated eclipse this morning and was wondering if perhaps it was a bug in the newer version, or am i really not seeing something obvious that is wrong with my code?

Thank you in advance!


Re: Linker error [message #1775354 is a reply to message #1775331] Sat, 28 October 2017 08:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29032
Registered: July 2009
Senior Member
It's better to use the CDT forum to ask questions related to C/C++ https://www.eclipse.org/forums/eclipse.tools.cdt
Previous Topic:Import Python Lambda function into Eclipse AWS Toolkit
Next Topic:Java EE / Solaris 10 / Invalid argument
Goto Forum:
  


Current Time: Mon Dec 11 13:04:40 GMT 2017

Powered by FUDForum. Page generated in 0.02388 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software