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 8632467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:21:27+00:00 2026-06-12T09:21:27+00:00

I am getting this error: fatal error LNK1169: one or more multiply defined symbols

  • 0

I am getting this error:

fatal error LNK1169: one or more multiply defined symbols found

Below are two files containing the code. In file 1, I have the main() function and I am calling the functions which are written in the second file named linklist.cpp.
Thanks for helping in advance.

File 1 – main.cpp

#include "stdafx.h"
# include "linklist.cpp"


int main(int argc, _TCHAR* argv[])
{
    node *link_list2;
    link_list2 = createList(31);
    addFront(link_list2,33);
    printList(link_list2);
    printf("Hello There Omer Obaid khan\n");
    return 0;
}

File 2 – linklist.cpp

# include "stdafx.h"
# include <stdlib.h>
struct node{
    node * next;
    int nodeValue;

};

node* initNode(int number);
node* createList (int value);
void addFront (node *head, int num );
void deleteFront(node*num);
void destroyList(node *list);
int getValue(node *list);

node*createList (int value)  /*Creates a Linked-List*/
{
    node *dummy_node = (node*) malloc(sizeof (node));
    dummy_node->next=NULL;
    dummy_node->nodeValue = value;
    return dummy_node;
}


void addFront (node *head, int num ) /*Adds node to the front of Linked-List*/
{
    node*newNode = initNode(num);   
    newNode->next = NULL;
    head->next=newNode;
    newNode->nodeValue=num;
}

void deleteFront(node*num)   /*Deletes the value of the node from the front*/
{
    node*temp1=num->next;

    if (temp1== NULL) 
    {
        printf("List is EMPTY!!!!");
    }
    else
    {
        num->next=temp1->next;
        free(temp1);
    }

}

void destroyList(node *list)    /*Frees the linked list*/
{
    node*temp;
    while (list->next!= NULL) 
    {
        temp=list;
        list=temp->next;
        free(temp);
    }
    free(list);
}

int getValue(node *list)    /*Returns the value of the list*/
{
    return((list->next)->nodeValue);
}


void printList(node *list)   /*Prints the Linked-List*/
{

    node*currentPosition;
    for (currentPosition=list->next; currentPosition->next!=NULL; currentPosition=currentPosition->next)  
    {
        printf("%d \n",currentPosition->nodeValue);
    }   
    printf("%d \n",currentPosition->nodeValue);

}

node*initNode(int number) /*Creates a node*/
{
    node*newNode=(node*) malloc(sizeof (node));
    newNode->nodeValue=number;
    newNode->next=NULL;
    return(newNode);
}
  • 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-12T09:21:27+00:00Added an answer on June 12, 2026 at 9:21 am

    I stopped reading after # include "linklist.cpp". Don’t include implementation files in other implementation files. (unless you’re doing bulk-builds, which I doubt). Separate declarations in headers and include those, and keep the definitions in the implementation files.

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

Sidebar

Related Questions

I have question. I have some app on facebook and getting this error Fatal
I'm getting this exception from facebook SDK: Fatal error: Uncaught OAuthException: (#506) Duplicate status
Am getting this error for my code: Undefined symbols for architecture x86_64: _spendDollars, referenced
When I use this statement if(count($this->input->post('p_id') =0)) , I keep getting this error: Fatal
Why am I getting this error: Catchable fatal error: Object of class Card could
I am getting this error: Fatal error: Can't use function return value in write
When submitting the following form I am getting this error : Fatal error: Call
I have an abstract class. I'm extending that class. I'm getting this error: Fatal
When I load my page I'm getting this error: Fatal error: Can't use function
I don't totally understand how all this works, but I'm getting this error: Fatal

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.