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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:33:48+00:00 2026-06-17T23:33:48+00:00

I downloaded a library from here . I added the header file in my

  • 0

I downloaded a library from here. I added the header file in my program but when I try to access the functions of this header file, I get error:

undefined reference to the function for u_open() and u_accept(). I tried to compile the .c files of this header file but I get this error:

undefined reference to main.

I tried everything in my knowledge to solve this issue, but couldn’t solve it. Here is the program.

#include "uici.h"
int main()
{
char client[50];
char buf[1024];

u_port_t portnumber;
portnumber=48625;

int fd = u_open(portnumber);

int communFd = u_accept(fd,client,50);

perror("Opened");

fprintf(stderr,"\nComun fd is %d\n\n\n",communFd);

read(communFd,buf,1024);

write(STDOUT_FILENO,buf,1024);

fprintf(stderr,"\n\nReading complete\n");
return 0;
}

What can I do to solve this problem?

Regards

  • 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-17T23:33:49+00:00Added an answer on June 17, 2026 at 11:33 pm

    Your header file uici.h declares the functions you’re calling in main() (u_open() and u_accept()), but not their implementations, which are in the source files. When the linker tries to create the entire program, it then complains that the implementations can’t be found.

    The solution is to link all the files together when creating the actual program binary. When using the g++ frontend, you can do this by specifying all the source files together on the command line. For example:

    g++ -o main main.c uici.c
    

    will create the main program called “main”, assuming that the implementations you need are in uici.c.

    edit: In the case you’re linking against a prebuilt library for uici, you’ll need to specify to the frontend that the library is needed for linking, e.g. with:

    g++ -o main main.c -luici
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded the boost library for android from here , but an error occurs
I downloaded the Eclipse IDE for Java Developers Linux 32 Bit file from here
I had downloaded the Google's closure library from the downloads list here the closure-library-20110323-r790.zip
I'm learning to access a MySQL database using the MySQL Connector/Python library downloaded from
com/jniwrapper/win32/ie/WebBrowser class not found. From where can I download jniWrapper library. I have downloaded
I've downloaded a module library for Yii in which every PHP file starts with
I downloaded the Feeds API Section Client Library for php but there is no
I'm trying to modify a python library that I downloaded and am using. But
I've installed the Django-voting app found here , but I am unable to get
I have downloaded the Layar401.apk file from web and trying to install it into

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.