Conflicts in headers from mingw/include

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Conflicts in headers from mingw/include

Maxim Blumental
Hello everyone!

I have a problem with my mingw which I faced when tried to build
libiconv. I got following errors:

c:\mingw\include\unistd.h:109:5: error: conflicting types for 'nanosleep'
 int nanosleep( const struct timespec *period, struct timespec *residual )
     ^
c:\mingw\include\unistd.h:105:5: note: previous declaration of
'nanosleep' was here
 int nanosleep( const struct timespec *, struct timespec * );

In the unistd.h header there is a line including time.h (105) and a
line which again declares it (109) which causes the conflict.
I installed only basic setup proposed by GUI mingw-get (specifically,
mingw32-base, g++, fortran) and msys 1.0.11 (not via gui).

So, what would you propose me to do? How can I cure the conflict in headers?
--


---------------------
Sincerely yours,
Maxim Blumental

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Conflicts in headers from mingw/include

Kai Tietz-2

Hello Maxim,

Thanks forreporzing.  I will take a look to it.

What version of our headers you are using? You can find the version-number in the _mingw_mac.h file.

Regards,
Kai

Am 12.07.2015 02:52 schrieb "Maxim Blumental" <[hidden email]>:
Hello everyone!

I have a problem with my mingw which I faced when tried to build
libiconv. I got following errors:

c:\mingw\include\unistd.h:109:5: error: conflicting types for 'nanosleep'
 int nanosleep( const struct timespec *period, struct timespec *residual )
     ^
c:\mingw\include\unistd.h:105:5: note: previous declaration of
'nanosleep' was here
 int nanosleep( const struct timespec *, struct timespec * );

In the unistd.h header there is a line including time.h (105) and a
line which again declares it (109) which causes the conflict.
I installed only basic setup proposed by GUI mingw-get (specifically,
mingw32-base, g++, fortran) and msys 1.0.11 (not via gui).

So, what would you propose me to do? How can I cure the conflict in headers?
--


---------------------
Sincerely yours,
Maxim Blumental

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Conflicts in headers from mingw/include

Keith Marshall-3
In reply to this post by Maxim Blumental
On 12/07/15 01:50, Maxim Blumental wrote:
> I have a problem with my mingw which I faced when tried to build
> libiconv. I got following errors:
>
> c:\mingw\include\unistd.h:109:5: error: conflicting types for 'nanosleep'
>  int nanosleep( const struct timespec *period, struct timespec *residual )
>      ^
> c:\mingw\include\unistd.h:105:5: note: previous declaration of
> 'nanosleep' was here
>  int nanosleep( const struct timespec *, struct timespec * );

With a simple test case, I cannot reproduce this.

> In the unistd.h header there is a line including time.h (105)

I don't see that. Around line 96, I see:

   94 #define _FAKE_TIME_H_SOURCED 1
   95 #define __need_struct_timespec
   96 #include <parts/time.h>

and then, at line 105:

  105 __cdecl __MINGW_NOTHROW
  106 int nanosleep( const struct timespec *, struct timespec * );

> and a line which again declares it (109)

Here, I see:

  108 #ifndef __NO_INLINE__
  109 __CRT_INLINE __LIBIMPL__(( FUNCTION = nanosleep ))
  110 int nanosleep(
          const struct timespec *period, struct timespec *residual )
  111 {
  112  if( residual != (void *)(0) )
  113    residual->__tv64_sec = (__time64_t)(residual->tv_nsec = 0);
  114  return __mingw_sleep((unsigned)(period->__tv64_sec),
            (period->__tv64_sec < 0LL)
  115    ? (unsigned)(-1) : (unsigned)(period->tv_nsec));
  116 }
  117 #endif

> which causes the conflict.

You'll have to provide a SSCCE, to demonstrate that. To me, the in-line
definition running from lines 109..116 looks entirely consistent with
the prototype declared on lines 105..106, and there is certainly no
conflict when I compile and run my own SSCCE:

  $ cat foo.cpp
  #include <iostream>
  #include <unistd.h>

  int main()
  {
    struct timespec delay = { 2.0, 0.0 };
    std::cout << "Waiting ... "; nanosleep( &delay, NULL );
    std::cout << "done." << std::endl;
    return 0;
  }

  $ mingw32-g++ -o foo.exe foo.cpp

  $ ./foo.exe; less -fF /dev/null
  Waiting ... done.

Note: this is cross-compiled on a GNU/Linux host, and run under wine;
the "less -fF /dev/null", after execution, is to repair the damage wine
inflicts on my terminal configuration.  During execution of foo.exe, I
see the expected 2s delay between output of "Waiting ... " and "done."

--
Regards,
Keith.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Conflicts in headers from mingw/include

Maxim Blumental
I apologise, but after some efforts my problem slightly modified
(though it is still related to headers) . Now I'll try be as clear and
precise as possible.

So, this time I installed everything via GUI mingw-get: mingw32-base,
mingw32-fortran, mingw32-gcc-g++, mingw-developer-toolkit, msys-base.

As a post-install action, to connect mingw and msys, I created fstab
file in C:\MinGW\msys\1.0\etc\ and wrote "c:/mingw/ /mingw" like in
fstab.sample file. That's how I installed MinGW and msys.

Then I tried to install libiconv: I put the uncompressed directory to
"C:\msys\1.0\home". After that I ran the following inside the
directory in msys shell:

$ ./configure --prefix=/mingw
$ make 2> log

Here's the contents of the log:

  In file included from ./sys/stat.h:44:0,
                   from ./fcntl.h:54,
                   from careadlinkat.h:23,
                   from areadlink.c:27:
  c:\mingw\include\parts\time.h:65:8: error: redefinition of 'struct
rpl_timespec'
   struct timespec
          ^
  ./time.h:387:8: note: originally defined here
   struct timespec
          ^
  make[2]: *** [areadlink.o] Error 1
  make[1]: *** [all] Error 2
  make: *** [all] Error 2

As you can see, there is a conflict between the time.h taken from
c:\mingw\include and the one provided by installation directory
(c:\msys\1.0\home\libiconv-1.14/srclib/time.h).

What should I do to fix that?




2015-07-12 11:25 GMT+03:00 Keith Marshall <[hidden email]>:

> On 12/07/15 01:50, Maxim Blumental wrote:
>> I have a problem with my mingw which I faced when tried to build
>> libiconv. I got following errors:
>>
>> c:\mingw\include\unistd.h:109:5: error: conflicting types for 'nanosleep'
>>  int nanosleep( const struct timespec *period, struct timespec *residual )
>>      ^
>> c:\mingw\include\unistd.h:105:5: note: previous declaration of
>> 'nanosleep' was here
>>  int nanosleep( const struct timespec *, struct timespec * );
>
> With a simple test case, I cannot reproduce this.
>
>> In the unistd.h header there is a line including time.h (105)
>
> I don't see that. Around line 96, I see:
>
>    94   #define _FAKE_TIME_H_SOURCED 1
>    95   #define __need_struct_timespec
>    96   #include <parts/time.h>
>
> and then, at line 105:
>
>   105   __cdecl __MINGW_NOTHROW
>   106   int nanosleep( const struct timespec *, struct timespec * );
>
>> and a line which again declares it (109)
>
> Here, I see:
>
>   108   #ifndef __NO_INLINE__
>   109   __CRT_INLINE __LIBIMPL__(( FUNCTION = nanosleep ))
>   110   int nanosleep(
>           const struct timespec *period, struct timespec *residual )
>   111   {
>   112     if( residual != (void *)(0) )
>   113       residual->__tv64_sec = (__time64_t)(residual->tv_nsec = 0);
>   114     return __mingw_sleep((unsigned)(period->__tv64_sec),
>             (period->__tv64_sec < 0LL)
>   115       ? (unsigned)(-1) : (unsigned)(period->tv_nsec));
>   116   }
>   117   #endif
>
>> which causes the conflict.
>
> You'll have to provide a SSCCE, to demonstrate that. To me, the in-line
> definition running from lines 109..116 looks entirely consistent with
> the prototype declared on lines 105..106, and there is certainly no
> conflict when I compile and run my own SSCCE:
>
>   $ cat foo.cpp
>   #include <iostream>
>   #include <unistd.h>
>
>   int main()
>   {
>     struct timespec delay = { 2.0, 0.0 };
>     std::cout << "Waiting ... "; nanosleep( &delay, NULL );
>     std::cout << "done." << std::endl;
>     return 0;
>   }
>
>   $ mingw32-g++ -o foo.exe foo.cpp
>
>   $ ./foo.exe; less -fF /dev/null
>   Waiting ... done.
>
> Note: this is cross-compiled on a GNU/Linux host, and run under wine;
> the "less -fF /dev/null", after execution, is to repair the damage wine
> inflicts on my terminal configuration.  During execution of foo.exe, I
> see the expected 2s delay between output of "Waiting ... " and "done."
>
> --
> Regards,
> Keith.
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
> Also: mailto:[hidden email]?subject=unsubscribe



--


---------------------
Sincerely yours,
Maxim Blumental

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Conflicts in headers from mingw/include

Sergio NNX
> As you can see, there is a conflict between the time.h taken from
> c:\mingw\include and the one provided by installation directory
> (c:\msys\1.0\home\libiconv-1.14/srclib/time.h).
>
> What should I do to fix that?

We haven't experienced this issue at all. iconv builds just fine on MSYS/MinGW. We are a bit confused about this apparent 'conflict'.

Have fun.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe

libiconv-MinGW.png (103K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Conflicts in headers from mingw/include

Eli Zaretskii
In reply to this post by Maxim Blumental
> Date: Sun, 12 Jul 2015 15:41:54 +0300
> From: Maxim Blumental <[hidden email]>
>
> $ ./configure --prefix=/mingw
> $ make 2> log
>
> Here's the contents of the log:
>
>   In file included from ./sys/stat.h:44:0,
>                    from ./fcntl.h:54,
>                    from careadlinkat.h:23,
>                    from areadlink.c:27:
>   c:\mingw\include\parts\time.h:65:8: error: redefinition of 'struct
> rpl_timespec'
>    struct timespec
>           ^
>   ./time.h:387:8: note: originally defined here
>    struct timespec
>           ^
>   make[2]: *** [areadlink.o] Error 1
>   make[1]: *** [all] Error 2
>   make: *** [all] Error 2
>
> As you can see, there is a conflict between the time.h taken from
> c:\mingw\include and the one provided by installation directory
> (c:\msys\1.0\home\libiconv-1.14/srclib/time.h).

This is a known problem with MinGW runtime 3.21 -- are you using that?

> What should I do to fix that?

Install MinGW runtime v3.21.1, it solves this issue.  You will find it
here:

 https://sourceforge.net/projects/mingw/files/MinGW/Base/mingwrt/mingwrt-3.21.1/


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Conflicts in headers from mingw/include

Maxim Blumental
That worked! Thanks!

2015-07-12 17:30 GMT+03:00 Eli Zaretskii <[hidden email]>:

>> Date: Sun, 12 Jul 2015 15:41:54 +0300
>> From: Maxim Blumental <[hidden email]>
>>
>> $ ./configure --prefix=/mingw
>> $ make 2> log
>>
>> Here's the contents of the log:
>>
>>   In file included from ./sys/stat.h:44:0,
>>                    from ./fcntl.h:54,
>>                    from careadlinkat.h:23,
>>                    from areadlink.c:27:
>>   c:\mingw\include\parts\time.h:65:8: error: redefinition of 'struct
>> rpl_timespec'
>>    struct timespec
>>           ^
>>   ./time.h:387:8: note: originally defined here
>>    struct timespec
>>           ^
>>   make[2]: *** [areadlink.o] Error 1
>>   make[1]: *** [all] Error 2
>>   make: *** [all] Error 2
>>
>> As you can see, there is a conflict between the time.h taken from
>> c:\mingw\include and the one provided by installation directory
>> (c:\msys\1.0\home\libiconv-1.14/srclib/time.h).
>
> This is a known problem with MinGW runtime 3.21 -- are you using that?
>
>> What should I do to fix that?
>
> Install MinGW runtime v3.21.1, it solves this issue.  You will find it
> here:
>
>  https://sourceforge.net/projects/mingw/files/MinGW/Base/mingwrt/mingwrt-3.21.1/
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
> Also: mailto:[hidden email]?subject=unsubscribe



--


---------------------
Sincerely yours,
Maxim Blumental

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe