2

when I archive my iOS app I get the following errors:

ld: warning: alignment lost in merging tentative definition _isDragging
ld: warning: alignment lost in merging tentative definition _isLoading

Could someone please tell me what's wrong and where should I look for...

Thanks!

Borut Tomazin
  • 8,041
  • 11
  • 78
  • 91

1 Answers1

1

I just ran into this same issue. I'm assuming that _isDragging and _isLoading are global variables that you declared somewhere. If that is so, make sure you declare both as extern in your .h file thusly:

MyFile.h

extern bool _isDragging;
extern bool _isLoading;

MyFile.m

bool _isDragging = false;
bool _isLoading = false;`

Hope this helps!

pfg2009
  • 110
  • 1
  • 9
  • I have this variables defined int two different .m files. I have added extern declaration in .h file with no luck. So I tried to initialize those two variables in .m files like that: extern BOOL isDragging = NO; and extern BOOL isLoading = NO; Now the warning is gone. How can I make a global variable for just one class not the whole project? Thanks! – Borut Tomazin Jan 18 '12 at 06:38
  • You seem to be doing the right thing. If you declare a global variable in the .m file (and not include it in the corresponding .h file) only the code in the .m file (ie. the code for a single class) will see the variable. – pfg2009 Jan 21 '12 at 22:35