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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:59:50+00:00 2026-05-15T22:59:50+00:00

I’m trying to build a module table for my application. /*** MODULE TABLE DEFINTION

  • 0

I’m trying to build a module table for my application.

/*** MODULE TABLE DEFINTION ***/ 
struct ModuleInfo
{
 char use_module;     // 0 = don't use, 1 = use, -1 for end of list
 char module_name[64];    // english name of module
 int(*module_init)(void);   // module initialization callback
 void(*module_tick)(void);   // module tick callback
 void(*module_end)(void);   // module end callback
 void *config_table;     // config table
};

/*** MODULE TABLE ***/
const struct ModuleTable module_table[] = {
 {
  1, "GPS/NMEA over RS232",
  gps_nmea_rs232_init,
  gps_nmea_rs232_tick, 
  gps_nmea_rs232_end,
  NULL
 },
 // end table
 {
  -1, NULL, NULL, NULL, NULL
 } 
};

The table stores a list of modules, with pointers to initialization, tick and termination functions to be called at appropriate intervals.

I am building this using MPLAB C30, which is a version of GCC 3.23 (I think?) for specific PIC microcontrollers.

However when I try to compile this, I get:

In file included from main.c:3:

modules.h:67: error: array type has incomplete element type

The table should be const if possible because I have lots of (edit: ROM) spare and not much (edit: RAM) spare. I cannot figure out why this is not working.

  • 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-15T22:59:50+00:00Added an answer on May 15, 2026 at 10:59 pm

    Actually that is the problem…

    declaring

    const struct ModuleTable module_table[] = ...
    

    is a valid C construct without defining struct ModuleTable explicitly; which is why your code is failing, change that line to say

    const struct ModuleInfo module_table[] = ... 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 463k
  • Answers 463k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer AsyncTask has a publishProgress method that should make it really… May 16, 2026 at 12:39 am
  • Editorial Team
    Editorial Team added an answer If using document.getElementById(), Your input elements have to have an… May 16, 2026 at 12:39 am
  • Editorial Team
    Editorial Team added an answer It would be a bad practice to always assume that… May 16, 2026 at 12:39 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.