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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:57:47+00:00 2026-06-02T09:57:47+00:00

I am trying to compile matlab generated code for 565 powerPC under cygwin. When

  • 0

I am trying to compile matlab generated code for 565 powerPC under cygwin.
When I execute the following compile command:

@powerpc-eabi-gcc -gdwarf-2 -c -mno-sdata -DMODEL=testMacs -DRT -DNUMST=2 
-DTID01EQ=1 -DNCSTATES=0 -DRT_STATIC -DMT=0 -I. 
-IC:/Programs/MATLAB/R2007b/simulink/include 
-IC:/Programs/MATLAB/R2007b/extern/include -IC:/cygwin/gnu/powerpc/extern
2/includes 
-IC:/Programs/MATLAB/R2007b/rtw/c/src 
-IC:/Programs/MATLAB/R2007b/rtw/c/libsrc 
-IC:/cygwin/powerpc-eabi/powerpc-eabi/sys-include 
-IC:/macs_565_R14/Driver 
-IC:/cygwin/ecos/include 
-mcpu=505 -O1 -o ./obj/testMacs.o testMacs.c

I Get the following error:

In file included from testMacs.h:16:0,
                 from testMacs.c:11:
C:/cygwin/powerpc-eabi/powerpc-eabi/sys-include/math.h:12:1: error: expected `=', `,', `;', `asm' or `__attribute__' before `union'
C:/cygwin/powerpc-eabi/powerpc-eabi/sys-include/math.h:398:17: error: expected `=', `,', `;', `asm' or `__attribute__' before `const'
In file included from rtwtypes.h:12:0,
                 from testMacs.h:17,
                 from testMacs.c:11:
C:/Programs/MATLAB/R2007b/extern/include/tmwtypes.h:83:1: error: expected `=', `,', `;', `asm' or `__attribute__' before `typedef'

The math.h rtwtypes.h are standard unchanged header files.

Does anyone know what I do wrong or am I missing a compiler option.

Code snippeds:
testMacs.h:

/*
 * testMacs.h
 *
 * Real-Time Workshop code generation for Simulink model "testMacs.mdl".
 *
 * Model Version              : 1.6
 * Real-Time Workshop version : 7.0.1  (R2007b+)  21-Apr-2008
 * C source code generated on : Mon Apr 23 06:48:14 2012
 */
#ifndef RTW_HEADER_testMacs_h_
#define RTW_HEADER_testMacs_h_
#ifndef testMacs_COMMON_INCLUDES_
# define testMacs_COMMON_INCLUDES_
#include <stddef.h>
#include <string.h>
#include <math.h>            /* line 16*/
#include "rtwtypes.h"        /* line 17*/
#include "simstruc.h"
#include "fixedpoint.h"
#include "rt_logging.h"
#include "rt_nonfinite.h"
#endif   

math.h:

/* math.h -- Definitions for the math floating point package.  */

#ifndef  _MATH_H_
#define  _MATH_H_

#include <sys/reent.h>
#include <machine/ieeefp.h>
#include "_ansi.h"

_BEGIN_STD_C

union __dmath             /* line 12*/
{
  __ULong i[2];
  double d;
};

…
…

/* Global control over fdlibm error handling.  */

enum __fdlibm_version
{
  __fdlibm_ieee = -1,
  __fdlibm_svid,
  __fdlibm_xopen,
  __fdlibm_posix
};

    #define _LIB_VERSION_TYPE enum __fdlibm_version
    #define _LIB_VERSION __fdlib_version

    extern __IMPORT _CONST _LIB_VERSION_TYPE _LIB_VERSION;      /*line 398*/

    #define _IEEE_  __fdlibm_ieee
    #define _SVID_  __fdlibm_svid
    #define _XOPEN_ __fdlibm_xopen
    #define _POSIX_ __fdlibm_posix

rtwtypes.h:

/*
 * File: rtwtypes.h
 *
 * Definitions required by Real-Time Workshop generated code.
 *
 * Real-Time Workshop version: 7.0.1
 * Generated on: 2012-04-23 06:48:15
 */

#ifndef __RTWTYPES_H__
#define __RTWTYPES_H__
#include "tmwtypes.h"             /* line 12*/

/* This ID is used to detect inclusion of an incompatible rtwtypes.h */
#define RTWTYPES_ID_C08S16I32L32N32F1
#include "simstruc_types.h"
#ifndef POINTER_T
# define POINTER_T

tmwtypes.h:

/*
 *      The following define is used to emulate when all integer types are
 *      32-bits.  This is the case for TI C30/C40 DSPs which are RTW targets.
 */
#ifdef DSP32
# define INT8_T    int
# define UINT8_T   unsigned int
# define INT16_T   int
# define UINT16_T  unsigned int
#endif
                                      /* line 83*/
/*
 * The uchar_T, ushort_T and ulong_T types are needed for compilers which do 
 * not allow defines to be specified, at the command line, with spaces in them.
 */

typedef unsigned char  uchar_T;
typedef unsigned short ushort_T;
typedef unsigned long  ulong_T;
  • 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-02T09:57:48+00:00Added an answer on June 2, 2026 at 9:57 am

    It seems like _BEGIN_STD_C is not being defined (as well as maybe some other macros) when math.h is being processed. However, that (at least _BEGIN_STD_C) should have been taken care of by _ansi.h.

    Try compiling with the -M option to make sure the right headers are being included and/or compiling with -E so you can look at the preprocessor output. One of these should point to the problem.

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

Sidebar

Related Questions

When trying to compile the following code, I am getting a warning that line
When trying to compile the following code in LINQPad : void Main() { DriveInfo.GetDrives().Select(GetProviderName).Dump();
while trying to compile the following code in OpenCV2 in linux, cv::Mat image1, image2;
While trying to compile the following code, which is enhanced version of read build
When trying to compile the following code #include <thread> #include <iostream> void foo() {
I am trying to compile a c++ application using the following command in command
Trying to compile non-PIC code into a shared library on x64 with gcc results
While trying to compile a 64 bit linux kernel using gcc, I see the
I trying to compile this code: Int64 itag = BitConverter.ToInt64(temp, 0); itag &= 0xFFFFFFFFFFFFFC00;
Iam trying to compile a file of the following format by making a parser

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.