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

  • Home
  • SEARCH
  • 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 7783305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:47:56+00:00 2026-06-01T19:47:56+00:00

Having a serious problem with my C code, I just don’t seem to be

  • 0

Having a serious problem with my C code, I just don’t seem to be able to get it to compile and I really can’t figure out why.

I have tried researching online and can’t find a solution to the problem, do you have any idea?

Thanks for your time!

Undefined symbols for architecture x86_64:
  "_Insert", referenced from:
      _InsertNode in part1.o
     (maybe you meant: _InsertNode)
  "_Create", referenced from:
      _findShortestPaths in part1.o
  "_DeleteMin", referenced from:
      _findShortestPaths in part1.o
  "_decreaseKey", referenced from:
      _findShortestPaths in part1.o
  "_GetMin", referenced from:
      _findShortestPaths in part1.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [part1] Error 1

Snippits from part1.c

#include "limits.h"
#include "pegBinaryHeap.h"

void InsertNode(int distance, Node* node, PriorityQueue PQ) {
  ...
  Insert(*item, PQ);
}

...

int* findShortestPaths(Graph *graph, int start) {
  ...

  //Priority queue ordered by distance
  PriorityQueue pq = Create(graph->MaxSize);
  for(int i = 0; i < graph->MaxSize; i++) {
    ...
  }

  //While the queue isn't empty:
  while((currentPqItem=GetMin(pq)) != NULL) { 
    ...
    DeleteMin(pq);

      //for each node accesable from currentNode
    List *currentNeighbour = currentNode.outlist;

    while(currentNeighbour!=NULL) {
      ...
        decreaseKey(currentNode.id, newDistance, pq);
    } // end for
  }// end while
}

int main(int argc,char *argv[])
{
  Graph mygraph;
  return 0;
}

And the .h file that it appears to be complaining about

#include "graph.h"

struct HeapStruct;
typedef struct HeapStruct *PriorityQueue;

typedef struct {
  int distance;
  Node *node;
} QueueType;

PriorityQueue Create( int MaxSize );
void Destroy( PriorityQueue H );
int Insert( QueueType Item, PriorityQueue H );
QueueType DeleteMin( PriorityQueue H );
QueueType* GetMin( PriorityQueue H );
void decreaseKey(int nodeId, int value, PriorityQueue H);
  • 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-01T19:47:57+00:00Added an answer on June 1, 2026 at 7:47 pm

    You can compile, but you cannot link.

    part1.o is using the functions you defined in your last .h file and the implementations cannot be found. When you link your program, you need to make sure you’re linking in the object file(s) (or libraries) that contain the implementations of those functions. You’ve likely done something like:

    gcc part1.c -o myapp

    and so the linker doesn’t have all the pieces to the puzzle.

    If you want to compile in parts, you need to:

    gcc -c part1.c -o part1.o
    gcc -c implementations.c -o implementations.o 
    gcc implementations.o part1.o -o myapp
    

    Here, all the .c files are compiled into object (.o) files separately, and then linked together into an executable. Or you could do everything at once:

    gcc part1.c implementations.c -o myapp
    

    If the implementations are in a library (libimplementations.a):

    gcc part1.c -Lpath/to/libs -limplementations -o myapp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I'm having serious problems here. On my own computer, this code works just
I've some pocket pc app and i'm having a serious problem with it described
I'm writing a web app, and I'm having a serious problem with too much
I am having serious trouble with trying to get all the forms on a
I'm having serious trouble figuring out what is making certain function calls ambiguous and
I'm having some serious issues with the jQuery UI icons and I can't see
I'm having a serious problem with custom post types in Wordpress. I made a
I'm having a serious problem with my ASP.NET AJAX application. There is a javascript
I'm having a very strange problem. When I log stacktraces, they seem to be
I'm having serious problems in how to update the record that has just been

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.