Compile error with pthread_t

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

Compile error with pthread_t

William Estrada
Hi group,

  I'm getting this error while compiling s Win32 program under linux:

    /usr/local/cross-tools/bin/i386-mingw32-gcc -DWIN32 -g -I.
    -I/usr/local/cross-tools/include
    -I/usr/local/i386-pc-cygwin32/i386-pc-cygwin32/sys-include -L
    /usr/local/cross-tools/lib pseudotty.c -o pseudotty.exe
    pseudotty.c:51: error: syntax error before "Bash_Get"
    pseudotty.c:51: warning: data definition has no type or storage class
    pseudotty.c:52: error: syntax error before "Bash_Put"
    pseudotty.c:52: warning: data definition has no type or storage class

The source is simple:

    pthread_t Bash_Get;
    pthread_t Bash_Put;

The complete program is at:

    http://64.124.13.3/_Examples_/PseudoTTY/

--
William Estrada
[hidden email]
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.
Reply | Threaded
Open this post in threaded view
|

Re: Compile error with pthread_t

Roumen Petrov
William Estrada wrote:
> Hi group,
>
>   I'm getting this error while compiling s Win32 program under linux:
[SNIP]
> The source is simple:
>
>     pthread_t Bash_Get;
>     pthread_t Bash_Put;
[SNIP]
a) port program to the thread model on host os;
b) find and use pthread implementation for host os.

Roumen

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.
Reply | Threaded
Open this post in threaded view
|

Re: Compile error with pthread_t

Tor Lillqvist
In reply to this post by William Estrada
>  I'm getting this error while compiling a Win32 program under linux:

>    /usr/local/cross-tools/bin/i386-mingw32-gcc -DWIN32 -g -I.
>    -I/usr/local/cross-tools/include
>    -I/usr/local/i386-pc-cygwin32/i386-pc-cygwin32/sys-include -L
>    /usr/local/cross-tools/lib pseudotty.c -o pseudotty.exe

> The complete program is at:
>    http://64.124.13.3/_Examples_/PseudoTTY/

Sorry, but that doesn't look like a Win32 program at all (or a program
that would have been ported to Win32 at all). It looks like a POSIX
program that uses only POSIX APIs. fork() even, which has no
equivalent in Win32. (The use of #ifdef WIN32 code in the source looks
to be severely misguided, presumably what they really mean is #ifdef
__CYGWIN__.)

You are probably confusing and mixing Cygwin and MinGW. Cygwin is an
emulated POSIX operating system that happens to run on top of Windows.
MinGW is a toolchain to produce "native" Win32 programs, just like
Microsoft's "Visual C" toolchain. No POSIX emulation involved. You
should not mix MinGW and Cygwin tools unless you are extremely careful
and know exactly what you are doing, it will just cause a confusing
mess.

As its name says, your cross-compiler i386-mingw32-gcc is a MinGW
cross-compiler, i.e. one that produces "native" Win32 code, and then
you pass it an option
-I/usr/local/i386-pc-cygwin32/i386-pc-cygwin32/sys-include apparently
pointing to a directory with Cygwin header files, in a misguided
attempt to get the source to compile.

Note that this list is not about Cygwin, so if what you really want is
to build a Cygwin program, you should ask on a Cygwin-oriented list.

--tml

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.