• 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
link error on global variable in static library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

link error on global variable in static library


  • Subject: link error on global variable in static library
  • From: James Walker <email@hidden>
  • Date: Mon, 13 Jun 2011 11:05:03 -0700

When I try to link an app with a certain static library, I get this error from Xcode 3.2.6:

Undefined symbols:
  "_g_bar", referenced from:
      _g_bar$non_lazy_ptr in libLexSaurusSpeller.a(BTOPEN.o)
     (maybe you meant: _g_bar$non_lazy_ptr)

That "maybe you meant" part isn't very enlightening.

The static library is C code compiled with GCC 4.0. I can see that one source file has

  int g_bar;

in global scope, and another (BTOPEN.c) has

  extern int g_bar;

in global scope. I expect I can work around the problem by introducing accessor functions, but what could I be missing?
--
James W. Walker, Innoventive Software LLC
<http://www.frameforge3d.com/>
_______________________________________________
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: link error on global variable in static library
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Changing Schemes
  • Next by Date: Re: link error on global variable in static library
  • Previous by thread: Re: Changing Schemes
  • Next by thread: Re: link error on global variable in static library
  • Index(es):
    • Date
    • Thread