Re: GCC 3.3 and signal 5 (SIGTRAP).
Re: GCC 3.3 and signal 5 (SIGTRAP).
- Subject: Re: GCC 3.3 and signal 5 (SIGTRAP).
- From: Chris Espinosa <email@hidden>
- Date: Sat, 5 Jun 2004 08:38:12 -0700
On Jun 5, 2004, at 6:40 AM, Isaac Rivera wrote:
Today I am trying to follow the C Language tutorial posted at
http://www.cocoadevcentral.com/ and I get a similar error when trying
to call members defined in a simple header file as follows in a file
named "math_functions.h":
int sum (int value1, int value2);
float average (float value1, float value2, float value3);
Now trying to use them in a C file like this:
#include <stdio.h>
#include "math_functions.h"
int main ()
{
int theSum = sum (8, 12);
float theAverage = average (16.9, 7.86, 3.4);
printf ("the sum is: %i ", theSum);
printf ("and the average is: %f \n", theAverage);
printf ("average casted to an int is: %i \n", (int)theAverage);
return 0;
}
I get an error:
ld: Undefined symbols:
_average
_sum
Where do you actually implement average (float x, y, z) and sum(int i,
j)? Including a header file that defines them is insufficient; you need
to build and link with a .c file that actually implements them.
Counter to Bill's assertion, Zero Link does not enter into this. You
are getting link errors so you are not using Zero Link, ipso facto.
And Zero Link can be used to execute applications as well as to debug
them; the principal issue with Zero Link is that you can't run an app
built with Zero Link on a system that doesn't have Developer Tools
installed.
Chris Espinosa
Apple
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.