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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:46:11+00:00 2026-05-17T21:46:11+00:00

I have a small project that I need to compile. I have one header

  • 0

I have a small project that I need to compile. I have one header and one source that I have created and a nearly empty driver.c that includes my header.
Observe:

// iol.h
#ifndef __IOL_HEADER
#define __IOL_HEADER
/*  program: iol.h
    date:    5 October 2010
*/

#define UNIX 1
#define WINDOWS 2
#define OS UNIX  
#if OS == UNIX
    #include <ncurses.h>
#elif OS == WINDOWS
    #include <conio.h> 
    #include <windows.h>
 // Function declarations!
#endif
void iol_init(void);
#endif

Now my implementation file:

// iol.c
#include <string.h>  
#include <stdlib.h>
#include "iol.h"
void iol_init(void) {
    #if OS == WINDOWS
        /* no startup required for windows */
    #elif OS == UNIX  
        initscr();  
        noecho();  
        cbreak();
        keypad(stdscr, 1);
 // Implmntn continues....  

Now the driver that includes my header and provides the main ():

//main.c
#include "iol.h"

My bash command:

gcc iol.c driver.c -l"ncurses"

I get back:

/tmp/ccmmW6hQ.o:iol.c:(.text+0x83f): first defined here
/tmp/ccwIKUaT.o: In function 'isEscaping':
driver.c:(.text+0xbab): multiple definition of 'isEscaping'
/tmp/ccmmW6hQ.o:iol.c:(.text+0xbab): first defined here
/tmp/ccwIKUaT.o: In function 'initSeq':
..
driver.c:(.text+0x149): undefined reference to 'iol_prnstr'
driver.c:(.text+0x178): undefined reference to 'iol_putch'
..
driver.c:(.text+0x726): undefined reference to 'iol_display'
collect2: ld returned 1 exit status

I just want to get to point where I can compile this, and start ripping my hair out ‘cuz of all my seg-faults. What’s the problem in my setup? I RTFM on the Gnu C Compiler apparently I’m doing what I’m supposed to, which is declare stuff in iol.h, define in iol.c, and use it in driver.c this is pretty trivial stuff maybe I just need a second set of eyes :S
I’m actually getting a long list of errors, if anyone thinks that’s relevant, I’m happy to post the whole source.

  • 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-05-17T21:46:11+00:00Added an answer on May 17, 2026 at 9:46 pm

    this is the linker complaining. This is what you would get if you had a function defined in the header file that was not declared ‘inline’

    the missing ones are because you have not added the correct libraries

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

Sidebar

Related Questions

I have created a small flash CS4 project that has a few custom components
I have a small project that basically a Python wrapper to a websites API.
I have a small project that require a storage (I choose SQLite) and I
I have a small to medium project that is in C++/CLI. I really hate
I have a small command line utility project that I'm using Maven to manage.
I have several small open-source projects that I wrote. All my attempts to find
I have a small project that builds a number of targets from the same
I have a small project where I need just part of boost library, boost::regex
I have a small project I want to try porting to Python 3 -
I have a small project I am doing in Python using web.py. It's a

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.