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

build error:libc.h:300:error: redefinition of 'sruct timespec' #4036

Closed
gopherbot opened this issue Sep 3, 2012 · 8 comments
Closed

build error:libc.h:300:error: redefinition of 'sruct timespec' #4036

gopherbot opened this issue Sep 3, 2012 · 8 comments

Comments

@gopherbot
Copy link
Contributor

by dakstr:

What steps will reproduce the problem?
all.bat

What is the expected output?
all tests passed

What do you see instead?
lib9
In file included from ..\go\src\lib9\_p9dir.c:28
..\go\inclued/libc.h:300:error: redefinition of 'sruct timespec'
etc.

Which compiler are you using (5g, 6g, 8g, gccgo)?
8g


Which operating system are you using?
Win 7 32

Which version are you using?  (run 'go version')
devel

Please provide any additional information below.
was able to build by commenting out the following from go\include\libc.h
#ifndef _WIN64
struct timespec {
    int tv_sec;
    long tv_nsec;
};

apologies if I missed something here - first time installing go, first time reporting
bugs.
@gopherbot
Copy link
Contributor Author

Comment 1 by dakstr:

correction -  code commented out:
#ifndef _WIN64
struct timespec {
    int tv_sec;
    long tv_nsec;
};
#define execv(prog, argv) execv(prog, (const char* const*)(argv))
#define execvp(prog, argv) execvp(prog, (const char**)(argv))
#endif

@alexbrainman
Copy link
Member

Comment 2:

What C compiler do you use to compile? How did you install it?
Thank you.
Alex

Status changed to WaitingForReply.

@gopherbot
Copy link
Contributor Author

Comment 3 by dakstr:

Hi Alex,
MinGW compiler.
I used the instructions from:
http://golang.org/doc/install/source
is that the info you need?
Deb

@alexbrainman
Copy link
Member

Comment 4:

It works fine here with my old compiler:
C:\>gcc --version
gcc (tdm-1) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
It also works with the one I just installed:
C:\>gcc --version
gcc (GCC) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
What version do you use? Also, please, show us what "gcc -dumpmachine" prints?
Thank you.
Alex

@gopherbot
Copy link
Contributor Author

Comment 5 by dakstr:

I'll try it with my PC at work later this week.  I must have messed
something up at some point.
gcc ver: gcc (GCC) 4.4.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc dumpmachine: i686-w64-mingw32
deb

@alexbrainman
Copy link
Member

Comment 6:

> gcc dumpmachine: i686-w64-mingw32
I think, you are trying to use 64 bit gcc compiler with your 32 bit os. It will not work
as is. You have to fiddle with GO... environment variables to make it work.
Alternatively, just use 32 bit gcc.
Alex

@gopherbot
Copy link
Contributor Author

Comment 7 by dakstr:

oh gosh - when will i learn to make sure my own "ducks are in a row"
first!!  thank you - feeling a bit stupid that i didn't see that - even
when i sent it and worse, didn't even think to check it....thanks again!

@davecheney
Copy link
Contributor

Comment 8:

Status changed to Retracted.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants