public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Getting simple STL program to compile
@ 1999-09-17  6:28  Clark Sims 
  1999-09-30 23:42 `  Clark Sims 
  0 siblings, 1 reply; 10+ messages in thread
From:  Clark Sims  @ 1999-09-17  6:28 UTC (permalink / raw)
  To: cygwin AT sourceware.cygnus.com

 OS) NT4 SP5
Cygwin ver) 20.1
GCC ver) 2.91.57
Watcom ver) 11.0b
STL) SGI port, 3.12.3

I wrote the attached program which uses, strings, vectors and the "Unix" 
function, getch. It compiled and ran correctly using the Watcom comiler, so
I am pretty sure that everything in the program is correct. I also copied most
of the syntax from Stroustrup's "The C++ Programming Language", 3rd edition,
chapters 20 & 21, so most (all?) of the functions and syntax for the STL 
should be correct.

I can't get the program to compile with Cygnus-GCC or Cygnus-G++. I have tried
the following command lines: 

gcc -mng-cygwin -o mypg mypg.cpp
g++ -mno-cygwin -o mypg mypg.cpp
g++ -mno-cygwin -o mypg mypg.cpp
gcc -mno-cygwin -o mypg -I//d/STLport-3.12.3/stl mypg.cpp 
g++ -mno-cygwin -o mypg -I//d/STLport-3.12.3/stl mypg.cpp 
gcc -mno-cygwin -o mypg -I//d/cygnus/include/g++-3 mypg.cpp 
g++ -mno-cygwin -o mypg -I//d/cygnus/include/g++-3 mypg.cpp 

None of these work.

Could someone show me how to get this program to compile?

Thanks in Advance,

Clark Sims



--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.
#include <iostream.h>
#include <stdio.h>
#include <string>
#include <vector.h>
#include <conio.h>
 
class UsageError {};

void usage()
{
  cout << "usage: mypg [-p=25]" << endl;
  throw UsageError();
}

int main( int argc, const char* argv[])
{
   int p=25;
 
   if (argc > 1)
   {
      if (argc!=2 || memcmp( argv[1], "-p=", 3) != 0)
      {
         usage();
      }
      p = atol( argv[1]+3);
      if (p<=0)
      {
	 cout << "p = " << p << " must be > 0" << endl;
         usage();
      }
   }
  
   char c;
   string input;
   vector<string> pg(p);
   long i = 0;

   do {
      input = "";
      while( (c=cin.get())!='\n' && cin)
      {
         if (c != '\r')
	   input += c;
      }
  
      if (cin)
      {
         pg[i] = input;
         i++;
      }
    
      if (i == p || !cin)
      {
         long j;
         for (j=0;j<i;j++) {
	   cout << pg[j] << endl;
         }
	 cout.flush();
         i = 0;
         if (!cin) {
            fflush( NULL);
            getch();
         }
      }    
   } while (cin);
      
   return 0;
}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Getting simple STL program to compile
  1999-09-17  6:28 Getting simple STL program to compile  Clark Sims 
@ 1999-09-30 23:42 `  Clark Sims 
  0 siblings, 0 replies; 10+ messages in thread
From:  Clark Sims  @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

 OS) NT4 SP5
Cygwin ver) 20.1
GCC ver) 2.91.57
Watcom ver) 11.0b
STL) SGI port, 3.12.3

I wrote the attached program which uses, strings, vectors and the "Unix" 
function, getch. It compiled and ran correctly using the Watcom comiler, so
I am pretty sure that everything in the program is correct. I also copied most
of the syntax from Stroustrup's "The C++ Programming Language", 3rd edition,
chapters 20 & 21, so most (all?) of the functions and syntax for the STL 
should be correct.

I can't get the program to compile with Cygnus-GCC or Cygnus-G++. I have tried
the following command lines: 

gcc -mng-cygwin -o mypg mypg.cpp
g++ -mno-cygwin -o mypg mypg.cpp
g++ -mno-cygwin -o mypg mypg.cpp
gcc -mno-cygwin -o mypg -I//d/STLport-3.12.3/stl mypg.cpp 
g++ -mno-cygwin -o mypg -I//d/STLport-3.12.3/stl mypg.cpp 
gcc -mno-cygwin -o mypg -I//d/cygnus/include/g++-3 mypg.cpp 
g++ -mno-cygwin -o mypg -I//d/cygnus/include/g++-3 mypg.cpp 

None of these work.

Could someone show me how to get this program to compile?

Thanks in Advance,

Clark Sims



--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.
#include <iostream.h>
#include <stdio.h>
#include <string>
#include <vector.h>
#include <conio.h>
 
class UsageError {};

void usage()
{
  cout << "usage: mypg [-p=25]" << endl;
  throw UsageError();
}

int main( int argc, const char* argv[])
{
   int p=25;
 
   if (argc > 1)
   {
      if (argc!=2 || memcmp( argv[1], "-p=", 3) != 0)
      {
         usage();
      }
      p = atol( argv[1]+3);
      if (p<=0)
      {
	 cout << "p = " << p << " must be > 0" << endl;
         usage();
      }
   }
  
   char c;
   string input;
   vector<string> pg(p);
   long i = 0;

   do {
      input = "";
      while( (c=cin.get())!='\n' && cin)
      {
         if (c != '\r')
	   input += c;
      }
  
      if (cin)
      {
         pg[i] = input;
         i++;
      }
    
      if (i == p || !cin)
      {
         long j;
         for (j=0;j<i;j++) {
	   cout << pg[j] << endl;
         }
	 cout.flush();
         i = 0;
         if (!cin) {
            fflush( NULL);
            getch();
         }
      }    
   } while (cin);
      
   return 0;
}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting simple STL program to compile
  1999-09-17 20:31 Earnie Boyd
@ 1999-09-30 23:42 ` Earnie Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Earnie Boyd @ 1999-09-30 23:42 UTC (permalink / raw)
  To: Clark Sims, cygwin

---  Clark Sims  <clarksimsgnu@my-Deja.com> wrote:
>  OS) NT4 SP5
> Cygwin ver) 20.1
> GCC ver) 2.91.57
> Watcom ver) 11.0b
> STL) SGI port, 3.12.3
> 
> I wrote the attached program which uses, strings, vectors and the "Unix" 
> function, getch. It compiled and ran correctly using the Watcom comiler, so
> I am pretty sure that everything in the program is correct. I also copied
> most
> of the syntax from Stroustrup's "The C++ Programming Language", 3rd edition,
> chapters 20 & 21, so most (all?) of the functions and syntax for the STL 
> should be correct.
> 
> I can't get the program to compile with Cygnus-GCC or Cygnus-G++. I have
> tried
> the following command lines: 
> 
> gcc -mng-cygwin -o mypg mypg.cpp
> g++ -mno-cygwin -o mypg mypg.cpp
> g++ -mno-cygwin -o mypg mypg.cpp
> gcc -mno-cygwin -o mypg -I//d/STLport-3.12.3/stl mypg.cpp 
> g++ -mno-cygwin -o mypg -I//d/STLport-3.12.3/stl mypg.cpp 
> gcc -mno-cygwin -o mypg -I//d/cygnus/include/g++-3 mypg.cpp 
> g++ -mno-cygwin -o mypg -I//d/cygnus/include/g++-3 mypg.cpp 
> 
> None of these work.
> 
> Could someone show me how to get this program to compile?
> 

I tried this even with a month old snapshot and using cygwin I couldn't get a
build.

However,  I've a crossbread mix of cygwin and mingw32-gcc-2.95 that I used to
build it with no problems.  I copied cygwin to another directory tree, removed
the compiler and bin-utilities, removed the lib and include directories, then
added the mingw32 versions of what I removed.  I prefer this structure when
building native programs.  I also have a boot.bat file that does an effective
change root by doing a sh -c 'cd bin && ./umount / && ./mount d:\\root\mingw32
/' before starting bash.  I also create and copy a more normalized directory
tree which allows cygwin to be more friendly to non-cygwin programs.

I've never had the problems people have with using -mno-cygwin.
===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't cc me)
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting simple STL program to compile
  1999-09-22 17:32  Clark Sims 
  1999-09-23  0:37 ` Mumit Khan
@ 1999-09-30 23:42 `  Clark Sims 
  1 sibling, 0 replies; 10+ messages in thread
From:  Clark Sims  @ 1999-09-30 23:42 UTC (permalink / raw)
  To: earnie_boyd, cygwin

 
--

On Fri, 17 Sep 1999 20:31:16   Earnie Boyd wrote:
>---  Clark Sims  <clarksimsgnu@my-Deja.com> wrote:
>>  OS) NT4 SP5
>> Cygwin ver) 20.1
>> GCC ver) 2.91.57
>> Watcom ver) 11.0b
>> STL) SGI port, 3.12.3
>> 
>> I wrote the attached program which uses, strings, vectors and the "Unix" 
>> function, getch. It compiled and ran correctly using the Watcom comiler, so
>> I am pretty sure that everything in the program is correct. I also copied
>> most
>> of the syntax from Stroustrup's "The C++ Programming Language", 3rd edition,
>> chapters 20 & 21, so most (all?) of the functions and syntax for the STL 
>> should be correct.
>> 
>> I can't get the program to compile with Cygnus-GCC or Cygnus-G++. I have
.
>> 
>> Could someone show me how to get this program to compile?
>> 
>

Sorry for the long delay. I have been out of the office for some time.

>I tried this even with a month old snapshot and using cygwin I couldn't get a
>build.

This is rather unsettling. Don't the programmers at Cygnus test for STL functionality?
This is such a big part of where C++ programming is heading.


>
>However,  I've a crossbread mix of cygwin and mingw32-gcc-2.95 that I used to

Where can I download mingw32-gcc-2.95?


>build it with no problems.  I copied cygwin to another directory tree, removed
>the compiler and bin-utilities, removed the lib and include directories, then
>added the mingw32 versions of what I removed.  I prefer this structure when


Isn't this basicly the whole compiler. Wouldn't it have been easier to just change the path? Why download cygwin at all?


>building native programs.  I also have a boot.bat file that does an effective
>change root by doing a sh -c 'cd bin && ./umount / && ./mount d:\\root\mingw32
>/' before starting bash.  I also create and copy a more normalized directory
>tree which allows cygwin to be more friendly to non-cygwin programs.
>

What is the point of this?
Is it so /include appears where so many other Unix program expect it to appear?
I guess you could acheive the samething by
ln -s //d/root/mingw32/h /h


>I've never had the problems people have with using -mno-cygwin.


Glad to hear it. I am glad that you got this program to compile :-)

Thanks again,

Clark


--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting simple STL program to compile
  1999-09-23  6:17 Earnie Boyd
@ 1999-09-30 23:42 ` Earnie Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Earnie Boyd @ 1999-09-30 23:42 UTC (permalink / raw)
  To: Clark Sims, cygwin users

---  Clark Sims  <clarksimsgnu@my-Deja.com> wrote:
-8<-
> Where can I download mingw32-gcc-2.95?
> 

From Mumit's site.  URL pointer on my page.

> 
> >build it with no problems.  I copied cygwin to another directory tree,
> removed
> >the compiler and bin-utilities, removed the lib and include directories,
> then
> >added the mingw32 versions of what I removed.  I prefer this structure when
> 
> 
> Isn't this basicly the whole compiler. Wouldn't it have been easier to just
> change the path? Why download cygwin at all?
> 

Yes it is the "whole" compiler.  I use cygwin for the UNIXy feel.  I have to
use both so being able to do `ls /some/directory' is pleasant.  The way I have
things structured I can test different scenarios of cygwin environments without
having to bother other scenarios.  All I have to do is change where / points
and everything else is configured.  I can do this in a .bat file that I can
shortcut to the desktop and choose at will the environment I want to use (only
one at a time though).

> 
> >building native programs.  I also have a boot.bat file that does an
> effective
> >change root by doing a sh -c 'cd bin && ./umount / && ./mount
> d:\\root\mingw32
> >/' before starting bash.  I also create and copy a more normalized directory
> >tree which allows cygwin to be more friendly to non-cygwin programs.
> >
> 
> What is the point of this?
> Is it so /include appears where so many other Unix program expect it to
> appear?
> I guess you could acheive the samething by
> ln -s //d/root/mingw32/h /h
> 

Yes.  I like /usr/include to be where it is supposed to be.

> 
> >I've never had the problems people have with using -mno-cygwin.
> 
> 
> Glad to hear it. I am glad that you got this program to compile :-)
> 
> Thanks again,

You're welcome.  BTW, I did see Mumit's response to this and to his defense I
have to say the "cygwin" doesn't include "conio.h" because "cygwin" is an
ANSI/POSIX system.  However, the windows headers are included and the gcc
compiler environment is supporting both methods.  The problem really is how the
files are located and when you try to mix "cygwin" and "mingw32" the compiler
has to be able to find the correct headers and _YOU_ have to tell it where to
find them.  I choose to avoid the problem, I don't mix the two.

Hmm.  I just had a brainstorm idea, I wonder if it would help to have a
directory structure of:

include/cygwin/<posix_headers>
include/mingw32/<windows_headers>
lib/cygwin/<cygwin_libraries>
lib/mingw32/<windows_libraries>

as opposed to:

include/<posix_headers>
include/mingw32/<windows_headers>
lib/<cygwin_libraries>
lib/mingw32/<windows_libraries>

Mumit, what do you think?  Would it help to segregate the two independant
headers/libraries from the compiler perspective?


=====
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't cc me)
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting simple STL program to compile
  1999-09-23  0:37 ` Mumit Khan
@ 1999-09-30 23:42   ` Mumit Khan
  0 siblings, 0 replies; 10+ messages in thread
From: Mumit Khan @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

" Clark Sims " <clarksimsgnu@my-Deja.com> writes:
>  
> This is rather unsettling. Don't the programmers at Cygnus test for STL funct
> ionality?

STL works just fine. Why would "Cygnus" test for features that are
specific to Microsoft runtime? If I remember correctly, you are 
using conio.h and getch(), which are not part of UNIX/POSIX nor 
standard C++, so Cygwin obviously doesn't support it.

There is no conio.h in Cygwin, nor will there be a conio.h in Cygwin in 
the future.

And, contrary to what you believe, getch is not a "Unix" function. There 
is a getch in curses, but that's obviously not what you're looking for 
here.

Mixing win32-specific getch and C++ streams is also a very bad idea. Your
use of fflush(NULL) seems odd -- you can't portably "flush" input streams.

> This is such a big part of where C++ programming is heading.

As I mention earlier, STL works just fine. You need to learn what is STL
and what is not STL before making such statements.

> Isn't this basicly the whole compiler. Wouldn't it have been easier to just c
> hange the path? Why download cygwin at all?

If you're going to use POSIX functionality, perhaps mingw32 port is what
you need.

http://www.xraylith.wisc.edu/~khan/software/gnu-win32/

while you're there, also check mno-cygwin howto to see how -mno-cygwin
really works.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting simple STL program to compile
@ 1999-09-23  6:17 Earnie Boyd
  1999-09-30 23:42 ` Earnie Boyd
  0 siblings, 1 reply; 10+ messages in thread
From: Earnie Boyd @ 1999-09-23  6:17 UTC (permalink / raw)
  To: Clark Sims, cygwin users

---  Clark Sims  <clarksimsgnu@my-Deja.com> wrote:
-8<-
> Where can I download mingw32-gcc-2.95?
> 

From Mumit's site.  URL pointer on my page.

> 
> >build it with no problems.  I copied cygwin to another directory tree,
> removed
> >the compiler and bin-utilities, removed the lib and include directories,
> then
> >added the mingw32 versions of what I removed.  I prefer this structure when
> 
> 
> Isn't this basicly the whole compiler. Wouldn't it have been easier to just
> change the path? Why download cygwin at all?
> 

Yes it is the "whole" compiler.  I use cygwin for the UNIXy feel.  I have to
use both so being able to do `ls /some/directory' is pleasant.  The way I have
things structured I can test different scenarios of cygwin environments without
having to bother other scenarios.  All I have to do is change where / points
and everything else is configured.  I can do this in a .bat file that I can
shortcut to the desktop and choose at will the environment I want to use (only
one at a time though).

> 
> >building native programs.  I also have a boot.bat file that does an
> effective
> >change root by doing a sh -c 'cd bin && ./umount / && ./mount
> d:\\root\mingw32
> >/' before starting bash.  I also create and copy a more normalized directory
> >tree which allows cygwin to be more friendly to non-cygwin programs.
> >
> 
> What is the point of this?
> Is it so /include appears where so many other Unix program expect it to
> appear?
> I guess you could acheive the samething by
> ln -s //d/root/mingw32/h /h
> 

Yes.  I like /usr/include to be where it is supposed to be.

> 
> >I've never had the problems people have with using -mno-cygwin.
> 
> 
> Glad to hear it. I am glad that you got this program to compile :-)
> 
> Thanks again,

You're welcome.  BTW, I did see Mumit's response to this and to his defense I
have to say the "cygwin" doesn't include "conio.h" because "cygwin" is an
ANSI/POSIX system.  However, the windows headers are included and the gcc
compiler environment is supporting both methods.  The problem really is how the
files are located and when you try to mix "cygwin" and "mingw32" the compiler
has to be able to find the correct headers and _YOU_ have to tell it where to
find them.  I choose to avoid the problem, I don't mix the two.

Hmm.  I just had a brainstorm idea, I wonder if it would help to have a
directory structure of:

include/cygwin/<posix_headers>
include/mingw32/<windows_headers>
lib/cygwin/<cygwin_libraries>
lib/mingw32/<windows_libraries>

as opposed to:

include/<posix_headers>
include/mingw32/<windows_headers>
lib/<cygwin_libraries>
lib/mingw32/<windows_libraries>

Mumit, what do you think?  Would it help to segregate the two independant
headers/libraries from the compiler perspective?


=====
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't cc me)
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting simple STL program to compile
  1999-09-22 17:32  Clark Sims 
@ 1999-09-23  0:37 ` Mumit Khan
  1999-09-30 23:42   ` Mumit Khan
  1999-09-30 23:42 `  Clark Sims 
  1 sibling, 1 reply; 10+ messages in thread
From: Mumit Khan @ 1999-09-23  0:37 UTC (permalink / raw)
  To: cygwin

" Clark Sims " <clarksimsgnu@my-Deja.com> writes:
>  
> This is rather unsettling. Don't the programmers at Cygnus test for STL funct
> ionality?

STL works just fine. Why would "Cygnus" test for features that are
specific to Microsoft runtime? If I remember correctly, you are 
using conio.h and getch(), which are not part of UNIX/POSIX nor 
standard C++, so Cygwin obviously doesn't support it.

There is no conio.h in Cygwin, nor will there be a conio.h in Cygwin in 
the future.

And, contrary to what you believe, getch is not a "Unix" function. There 
is a getch in curses, but that's obviously not what you're looking for 
here.

Mixing win32-specific getch and C++ streams is also a very bad idea. Your
use of fflush(NULL) seems odd -- you can't portably "flush" input streams.

> This is such a big part of where C++ programming is heading.

As I mention earlier, STL works just fine. You need to learn what is STL
and what is not STL before making such statements.

> Isn't this basicly the whole compiler. Wouldn't it have been easier to just c
> hange the path? Why download cygwin at all?

If you're going to use POSIX functionality, perhaps mingw32 port is what
you need.

http://www.xraylith.wisc.edu/~khan/software/gnu-win32/

while you're there, also check mno-cygwin howto to see how -mno-cygwin
really works.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting simple STL program to compile
@ 1999-09-22 17:32  Clark Sims 
  1999-09-23  0:37 ` Mumit Khan
  1999-09-30 23:42 `  Clark Sims 
  0 siblings, 2 replies; 10+ messages in thread
From:  Clark Sims  @ 1999-09-22 17:32 UTC (permalink / raw)
  To: earnie_boyd, cygwin

 
--

On Fri, 17 Sep 1999 20:31:16   Earnie Boyd wrote:
>---  Clark Sims  <clarksimsgnu@my-Deja.com> wrote:
>>  OS) NT4 SP5
>> Cygwin ver) 20.1
>> GCC ver) 2.91.57
>> Watcom ver) 11.0b
>> STL) SGI port, 3.12.3
>> 
>> I wrote the attached program which uses, strings, vectors and the "Unix" 
>> function, getch. It compiled and ran correctly using the Watcom comiler, so
>> I am pretty sure that everything in the program is correct. I also copied
>> most
>> of the syntax from Stroustrup's "The C++ Programming Language", 3rd edition,
>> chapters 20 & 21, so most (all?) of the functions and syntax for the STL 
>> should be correct.
>> 
>> I can't get the program to compile with Cygnus-GCC or Cygnus-G++. I have
.
>> 
>> Could someone show me how to get this program to compile?
>> 
>

Sorry for the long delay. I have been out of the office for some time.

>I tried this even with a month old snapshot and using cygwin I couldn't get a
>build.

This is rather unsettling. Don't the programmers at Cygnus test for STL functionality?
This is such a big part of where C++ programming is heading.


>
>However,  I've a crossbread mix of cygwin and mingw32-gcc-2.95 that I used to

Where can I download mingw32-gcc-2.95?


>build it with no problems.  I copied cygwin to another directory tree, removed
>the compiler and bin-utilities, removed the lib and include directories, then
>added the mingw32 versions of what I removed.  I prefer this structure when


Isn't this basicly the whole compiler. Wouldn't it have been easier to just change the path? Why download cygwin at all?


>building native programs.  I also have a boot.bat file that does an effective
>change root by doing a sh -c 'cd bin && ./umount / && ./mount d:\\root\mingw32
>/' before starting bash.  I also create and copy a more normalized directory
>tree which allows cygwin to be more friendly to non-cygwin programs.
>

What is the point of this?
Is it so /include appears where so many other Unix program expect it to appear?
I guess you could acheive the samething by
ln -s //d/root/mingw32/h /h


>I've never had the problems people have with using -mno-cygwin.


Glad to hear it. I am glad that you got this program to compile :-)

Thanks again,

Clark


--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting simple STL program to compile
@ 1999-09-17 20:31 Earnie Boyd
  1999-09-30 23:42 ` Earnie Boyd
  0 siblings, 1 reply; 10+ messages in thread
From: Earnie Boyd @ 1999-09-17 20:31 UTC (permalink / raw)
  To: Clark Sims

---  Clark Sims  <clarksimsgnu@my-Deja.com> wrote:
>  OS) NT4 SP5
> Cygwin ver) 20.1
> GCC ver) 2.91.57
> Watcom ver) 11.0b
> STL) SGI port, 3.12.3
> 
> I wrote the attached program which uses, strings, vectors and the "Unix" 
> function, getch. It compiled and ran correctly using the Watcom comiler, so
> I am pretty sure that everything in the program is correct. I also copied
> most
> of the syntax from Stroustrup's "The C++ Programming Language", 3rd edition,
> chapters 20 & 21, so most (all?) of the functions and syntax for the STL 
> should be correct.
> 
> I can't get the program to compile with Cygnus-GCC or Cygnus-G++. I have
> tried
> the following command lines: 
> 
> gcc -mng-cygwin -o mypg mypg.cpp
> g++ -mno-cygwin -o mypg mypg.cpp
> g++ -mno-cygwin -o mypg mypg.cpp
> gcc -mno-cygwin -o mypg -I//d/STLport-3.12.3/stl mypg.cpp 
> g++ -mno-cygwin -o mypg -I//d/STLport-3.12.3/stl mypg.cpp 
> gcc -mno-cygwin -o mypg -I//d/cygnus/include/g++-3 mypg.cpp 
> g++ -mno-cygwin -o mypg -I//d/cygnus/include/g++-3 mypg.cpp 
> 
> None of these work.
> 
> Could someone show me how to get this program to compile?
> 

I tried this even with a month old snapshot and using cygwin I couldn't get a
build.

However,  I've a crossbread mix of cygwin and mingw32-gcc-2.95 that I used to
build it with no problems.  I copied cygwin to another directory tree, removed
the compiler and bin-utilities, removed the lib and include directories, then
added the mingw32 versions of what I removed.  I prefer this structure when
building native programs.  I also have a boot.bat file that does an effective
change root by doing a sh -c 'cd bin && ./umount / && ./mount d:\\root\mingw32
/' before starting bash.  I also create and copy a more normalized directory
tree which allows cygwin to be more friendly to non-cygwin programs.

I've never had the problems people have with using -mno-cygwin.
===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't cc me)
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-17  6:28 Getting simple STL program to compile  Clark Sims 
1999-09-30 23:42 `  Clark Sims 
1999-09-17 20:31 Earnie Boyd
1999-09-30 23:42 ` Earnie Boyd
1999-09-22 17:32  Clark Sims 
1999-09-23  0:37 ` Mumit Khan
1999-09-30 23:42   ` Mumit Khan
1999-09-30 23:42 `  Clark Sims 
1999-09-23  6:17 Earnie Boyd
1999-09-30 23:42 ` Earnie Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).