• 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: Xcode-users Digest, Vol 4, Issue 712
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode-users Digest, Vol 4, Issue 712


  • Subject: Re: Xcode-users Digest, Vol 4, Issue 712
  • From: Adam <email@hidden>
  • Date: Sun, 16 Dec 2007 14:57:25 -0800
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys

On Dec 15, 2007, at 2:32 PM, James W. Walker wrote:


On Dec 15, 2007, at 1:26 PM, Adam wrote:

When modifying an OpenGL program that I found on nehe.gamedev.net,  
for some reason I get the following error code:

/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status

...and yet I have the main function defined! Sorry if this is a  
stupid question or something, but my head hurts pretty bad right  
now from trying to figure this out... I bet it's something simple,  
but I can't figure it out.

I bet it's because your main function is in a C++ source and isn't  
declared extern "C".

No. You never have to declare main as extern "C".

That's what I thought, but I wasn't sure...

As I recall, SDL #defines main to SDL_main and then supplies their own  
SDLMain.m or something that has the true main function that after some  
setup calls SDL_main (i.e., your main). You are most likely not  
including SDLMain.m in your project. Looking at your .xcodeproj, you  
aren't. Click the box to include the file.

Yes, and it still gives the same errors, and it would define 2 "main()"s, seeing that mine has one also. I seem to remember needing those files for something, but what?


All help is appreciated and thanks in advance.

~ < [ / Adam-o \ ] > ~

Mac OS 10.4.11
Powerbook G4



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Xcode-users Digest, Vol 4, Issue 712
      • From: Jonas Maebe <email@hidden>
  • Prev by Date: Re: Interpreting "undefined symbols"
  • Next by Date: Re: Xcode-users Digest, Vol 4, Issue 712
  • Previous by thread: Re: Xcode v2.5 no longer compiles project without errors
  • Next by thread: Re: Xcode-users Digest, Vol 4, Issue 712
  • Index(es):
    • Date
    • Thread