Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arch Linux: error: invalid use of incomplete type ‘struct __exception’ #146

Open
dvs23 opened this issue May 27, 2018 · 5 comments
Open

Comments

@dvs23
Copy link

dvs23 commented May 27, 2018

On arch linux, I'm unable to compile - neither the 4.0 release from the website nor a fresh clone from github. Relevant part of the "make all" output:

In file included from ../glib-core/base.cpp:79,
                 from Snap.cpp:6:
../glib-core/bd.cpp: In function ‘int _matherr(__exception*)’:
../glib-core/bd.cpp:14:4: error: invalid use of incomplete type ‘struct __exception’
   e->retval=0;
    ^~
../glib-core/bd.cpp:13:21: note: forward declaration of ‘struct __exception’
 int _matherr(struct __exception* e){
                     ^~~~~~~~~~~

If you add the following in bp.cpp:12

struct __exception {
    int    type;      /* Exception type */
    char*  name;      /* Name of function causing exception */
    double arg1;      /* 1st argument to function */
    double arg2;      /* 2nd argument to function */
    double retval;    /* Function return value */
};

(copied from http://man7.org/linux/man-pages/man3/matherr.3.html)
it seems to compile. Quick and dirty hack, so I'm not sure if it breaks anything else...

Compiler: gcc (GCC) 8.1.0
glibc: ldd (GNU libc) 2.27
Arch Linux: 4.16.10-1-ARCH

@YasCoMa
Copy link

YasCoMa commented Jul 13, 2018

I am having the same problem on ubuntu 18.04. Did you solve it? If yes, Could you share the solution?

@dvs23
Copy link
Author

dvs23 commented Jul 13, 2018

No, I didn't find a better solution that just adding the stuct above to bs.cpp in line 12 - but it seems to work with that :)

@YasCoMa
Copy link

YasCoMa commented Jul 13, 2018

It worked here. It was compiled with many warnings. Thanks.

@dibstern
Copy link

dibstern commented Sep 5, 2018

Amazing, you saved me, thank you so much!

@Sleris
Copy link

Sleris commented Jan 29, 2019

Encountered a similar error today on 3 flavor of linux (Arch/ubuntu/gentoo) all with more or less latest GCC, only difference is that the incriminated file was glib-core/bd.cpp .
The same dirty trick on glib-core/bd.h allowed to compile.
This is happening on both 4.0 and 4.1 (haven't tested others)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants