• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GCC 3.3 and signal 5 (SIGTRAP).
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC 3.3 and signal 5 (SIGTRAP).


  • Subject: Re: GCC 3.3 and signal 5 (SIGTRAP).
  • From: Isaac Rivera <email@hidden>
  • Date: Sat, 5 Jun 2004 11:38:45 -0400

Gotcha.

That solves the Command Line compiler mystery...

Any suggestions about the other one?
(not being able to run a simple ObjC app that inherits from objc/Object.h)
The application builds fine (sometimes, sometimes the same code generates a warning that it "may" not be able to call the methods) but when run exits with the message "The Application has exited with signal 5 (SIGTRAP)."


Thanks again

Isaac

On Jun 5, 2004, at 11:33 AM, Prachi Gauriar wrote:


On Jun 5, 2004, at 10:08 AM, Bill Lowrey 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

I am compiling from the command line.

Make sure you have ZeroLink turned off. If it's turned on, the app will only
run from the debugger, I believe.

You said you're doing this via the command-line? I assume you're using gcc and not xcodebuild. Then ZeroLink isn't an issue (unless you're doing some very strange things in this tutorial).


Supposing that main() is in a file called main.c, average() and sum() are in a file called math_functions.c, and those two functions are defined in math_functions.h, you should type the following to compile:

gcc math_functions.c main.c -o MathFunctions

-Prachi
_______________________________________________
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.


References: 
 >RE: GCC 3.3 and signal 5 (SIGTRAP). (From: "Bill Lowrey" <email@hidden>)
 >Re: GCC 3.3 and signal 5 (SIGTRAP). (From: Prachi Gauriar <email@hidden>)

  • Prev by Date: Re: GCC 3.3 and signal 5 (SIGTRAP).
  • Next by Date: Problem building simple C++ project
  • Previous by thread: Re: GCC 3.3 and signal 5 (SIGTRAP).
  • Next by thread: Re: GCC 3.3 and signal 5 (SIGTRAP).
  • Index(es):
    • Date
    • Thread