Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8713237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:17:51+00:00 2026-06-13T05:17:51+00:00

I am getting a build failure on link after adding a new .h and

  • 0

I am getting a build failure on link after adding a new .h and .m file dataparsing and i don’t quite understand why. I’m newer to objective-c though. if i remove the include ( then i have to remove the reference to the object from the file that needs dataparsing class) then it wont fail. just removing the object wont cut it and it still fails when i try to include the files. in the error section under linking it says one duplicate symbol for architecture i386

dataparsing.h is:

//
//  dataParsing.h
//  TelnetToICC
//
//  Created by **** on 10/8/12.
//
//

#import <UIKit/UIKit.h>



@interface dataParsing : UIView
{


}
- (void)getData:NSString:id;
-(void) parseLine:id;
-(void) parseDatagram:id;
-(void) reset;

@end

char icc_data[10000];
int data_top=-1;

the idea is just to write some simple functions for processing strings so i am not trying to do anything real special here but i’m newer to objective-c. The include for dataparsing in ViewController.m is:

#import "dataParsing.h"
#import "ViewController.h"
#import <CoreFoundation/CFSocket.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

@implementation ViewController

It seems like i got something going on twice for the linker but my experiments havent found it. I noticed both my .h files have

#import <UIKit/UIKit.h>

but i remove one and it doesn’t work.

Mike

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:17:52+00:00Added an answer on June 13, 2026 at 5:17 am

    The duplicate symbol is _data_top. And I’m guessing also _icc_data. The problem is that you are declaring a global variable in the dataparsing.h file. So for every file that includes this .h file, a new global variable with the same name is created resulting in the duplicate symbol linker error.

    What you need to do is change the lines:

    char icc_data[10000];
    int data_top=-1;
    

    to:

    extern char icc_data[10000];
    extern int data_top;
    

    Then in the dataparser.m file you do:

    char icc_data[10000];
    int data_top = -1;
    

    The extern in the .h file lets the compiler and linker know that there will be one copy of the variable defined somewhere. The lines in the .m file are that one definition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the following failure message when i build on the below two
I'm totally new to flex. I'm getting a build error when using flex. That
My problem is this: I am getting a TFS build failure that I have
I'm running ant and added the below to build.xml but I'm getting:\ build.xml:51: Element
I am getting a build error when I attempt to build my asp.net application.
I'm getting the build error 'error VCBLD0007: Could not find project configuration RELEASE|X64 to
I am getting some code to build and debug in VS2008. Basically the project
I am getting the error: android.os.Build.VERSION cannot be resolved to a variable as an
I'm getting undefined reference when I build an application in Windows witn mingw32 (it
I'm getting started with Titanium Studio to build mobile apps. I'm using Beanstalkapp (or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.