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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:13:12+00:00 2026-05-17T06:13:12+00:00

I have a strange build problem. I have a simple test program that sends

  • 0

I have a strange build problem.

I have a simple test program that sends a sigqueue to another process.

This little code example builds and runs when I build it as a c++ program (compiled with g++)
but when I compile it as a c program (with gcc) I get a error that he can’t find the sigval struct.

The short example:

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>

int main(int argc, char *argv[])
{
        sigval value;
        value.sival_int = 123;
        sigqueue(0,SIGUSR1, value);
}

Please note that I replaced the pid with 0 to simplify this question.

And if I compile with gcc I get this:

$> gcc sigusr1_mini.c 
sigusr1_mini.c: In function ‘main’:
sigusr1_mini.c:9: error: ‘sigval’ undeclared (first use in this function)
sigusr1_mini.c:9: error: (Each undeclared identifier is reported only once
sigusr1_mini.c:9: error: for each function it appears in.)
sigusr1_mini.c:9: error: expected ‘;’ before ‘value’
sigusr1_mini.c:10: error: ‘value’ undeclared (first use in this function)

What am I missing here, why can’t he find the sigval struct?
And why can g++ find it?

Thanks
Johan

  • 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-17T06:13:13+00:00Added an answer on May 17, 2026 at 6:13 am

    In C, struct and union tags do not introduce names that can be used on their own like they do in C++. You must spell it out:

    union sigval value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem on ipv6 connection. I write down a simple client
I have some problem when a try to build my code upon the 4.7.4
I have run into a strange problem with git and zip files. My build
Have a strange problem in that I have a Rake task that seems to
I'm having a strange problem when trying to run a maven build that uses
Yet another strange WPF error: I have a custom control in a simple XAML
I have a strange problem with Jquery Ajax with the following code. Situation 1:
I have a strange problem with my code. i'm trying to create a form
This is a strange problem. I have two html pop-up windows, just hidden divs
i have strange problem doing reporting: i have numerous clients with different issued invoices.

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.