gcc: problem with scanf/printf with 64 bit integers on cygwin with -mno-cygwin

2009-02-25 Thread Helmut Brandl
I use the type unsigned long long and long long to get 64 bit
integers on gcc.

For reading and writing I use the formatting e.g.

  unsigned long long u64;

  u64 = ...;

  printf(a 64 bit integer %llu\n, u64);

This has worked up to now on all systems using gcc except on cygwin
compiling with the option -mno-cygwin and on mingw.

I get the following problems:

- If I print a 64 bit integer alone, the output is ok, if I print 64 bit
and 32 bit integers with the same print statement, the output is not the
content of the integers.

- If I scan a 64 bit integer and the corresponding and the variable into
which I read is not initialized, the input is not correct.

Is this problem known?

Unfortunately the problem is within a big program. But if needed, I
could try to isolate it in a small program. But I don't know, if the
problem is deterministic, so I cannot promise that.


Kind regards
Helmut

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: gcc: problem with scanf/printf with 64 bit integers on cygwin with -mno-cygwin

2009-02-25 Thread Larry Hall (Cygwin)

On 02/25/2009, Helmut Brandl wrote:

I use the type unsigned long long and long long to get 64 bit
integers on gcc.

For reading and writing I use the formatting e.g.

  unsigned long long u64;

  u64 = ...;

  printf(a 64 bit integer %llu\n, u64);

This has worked up to now on all systems using gcc except on cygwin
compiling with the option -mno-cygwin and on mingw.


Cygwin's '-mno-cygwin' flag means use Cygwin's mingw compiler package.
So this is a mingw issue.  I recommend looking for the solution at the
mingw site.

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

_

A: Yes.
 Q: Are you sure?
 A: Because it reverses the logical flow of conversation.
 Q: Why is top posting annoying in email?

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: GCC: problem with library search path when targeting mingw

2006-08-15 Thread Damien Fouilleul
I'm not sure that I agree with your assements, /usr/lib as always been 
available (at least displayed) as a default search path in 
'print-search-dirs' even when using the -mno-cygwin switch, but for some 
reason, has always been ignored when  linking for MinGW.


I think the problem has to do with 
'/usr/lib/gcc/i686-pc-mingw/3.4.4/../../..' in the search paths, I'm not 
sure if this path was available in the previous packages of 
gcc/mingw-runtime/binutils  (I don't feel like downgrading to check it 
out :) ), but this is the one that's giving me trouble rather than 
/usr/lib, so I don't think -Wl,-nostdlib will be of any help.


I agree with you that -mno-cygwin has been a bad choice, as it requires 
a lot of hacking around to get some configure scripts to recognize/use 
this option when cross-compiling autotools based packages for MinGW, but 
until this recent problem, I've always managed to get by without 
tweaking configure scripts, typically overriding CC, CXX, CPPFLAGS, 
etc... on the command line was enough.


Damien

Christopher Faylor wrote:


 Thanks for the report.  This has been mentioned before, it's a problem in
gcc's 'specs', which are command-line pattern matching strings (more-or-less)
used by the gcc compiler driver to select the right options for the
sub-programs that it invokes.  It's basically a consequence of the fact that
we're using the same driver to drive a native compiler /and/ a cross-compiler;
normally, a cross-compiler wouldn't include any of the system paths such as
/usr/lib at all, but for a native compiler that's exactly what you want it to
do.


The /usr/lib inclusion is actually likely to be a binutils problem
since ld includes /usr/lib by default.  Possibly adding -Wl,-nostdlib to
the command line would help.

In any event, I really think that -mno-cygwin is 1) a bad choice for an
option name and 2) a bad way to accomplish what is essentially
cross-compilation.  I regret that I stood by idly and watched that
option go into gcc.

cgf




Damien Fouilleul wrote:

hello,

I'm a big fan of cygwin and I use it a lot to compile mingw apps,
however with the latest mingw-runtime, I'm having trouble running
configure scripts successfully as test such 'dlopen() in -ldl', which
used to fail for mingw target (as expected) now succeeds. This causes
havoc in compilation as the resulting config.h file contains reference
to APIs not supported by mingw.

after having a look at gcc -mno-cygwin -print-search-dirs, I think I may
have found the culprit in the following element of the library search 
path:

'/usr/lib/gcc/i686-pc-mingw/3.4.4/../../..', as this points back
straight at /usr/lib, the cygin main library path. This means now that
the following command

$ gcc -mno-cygwin dlopen-test.c -dl

Now passes with flying colors. I have to edit all my config.h as I do
not know of any way to remove this path from the search paths

Similarily, I have a similar but less serious problems with headers
paths for files such as math.h, float.h, these are available for both
cygwin and mingw, but they are different files.Unfortunately,
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include has precedence over
'/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include'
when targetting mingw by default, therefore the cygwin version is chosen
over the mingw one.
In 99% of cases, this is usually not a problem, as the files are nearly
identical, but they are some Microsoft specific code in the mingw, which
is required to compile Trolltech QT, for example.
If i use the following compiler option '-isystem /usr/include/mingw',
then everything works fine.

I hope this help
  Damien



For reference:

binutils-20060709-1
gcc-3.4.4-1
mingw-runtime-3.10.1

$ gcc -mno-cygwin -print-search-dirs
install: /usr/lib/gcc/i686-pc-mingw32/3.4.4/
programs:
=/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/:/usr/libexec/gcc/i686-pc-mingw32/3.4.4/:/usr/libexec/gcc/i686-pc-mingw32/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/bin/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/bin/ 


libraries:
=/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../:/lib/i686-pc-mingw32/3.4.4/:/lib/:/usr/lib/i686-pc-mingw32/3.4.4/:/usr/lib/ 



$ gcc -print-search-dirs
install: /usr/lib/gcc/i686-pc-cygwin/3.4.4/
programs:

GCC: problem with library search path when targeting mingw

2006-08-14 Thread Damien Fouilleul

hello,

I'm a big fan of cygwin and I use it a lot to compile mingw apps,
however with the latest mingw-runtime, I'm having trouble running
configure scripts successfully as test such 'dlopen() in -ldl', which
used to fail for mingw target (as expected) now succeeds. This causes
havoc in compilation as the resulting config.h file contains reference
to APIs not supported by mingw.

after having a look at gcc -mno-cygwin -print-search-dirs, I think I may
have found the culprit in the following element of the library search path:
'/usr/lib/gcc/i686-pc-mingw/3.4.4/../../..', as this points back
straight at /usr/lib, the cygin main library path. This means now that
the following command

$ gcc -mno-cygwin dlopen-test.c -dl

Now passes with flying colors. I have to edit all my config.h as I do
not know of any way to remove this path from the search paths

Similarily, I have a similar but less serious problems with headers
paths for files such as math.h, float.h, these are available for both
cygwin and mingw, but they are different files.Unfortunately,
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include has precedence over
'/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include'
when targetting mingw by default, therefore the cygwin version is chosen
over the mingw one.
In 99% of cases, this is usually not a problem, as the files are nearly
identical, but they are some Microsoft specific code in the mingw, which
is required to compile Trolltech QT, for example.
If i use the following compiler option '-isystem /usr/include/mingw',
then everything works fine.

I hope this help
  Damien



For reference:

binutils-20060709-1
gcc-3.4.4-1
mingw-runtime-3.10.1

$ gcc -mno-cygwin -print-search-dirs
install: /usr/lib/gcc/i686-pc-mingw32/3.4.4/
programs:
=/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/:/usr/libexec/gcc/i686-pc-mingw32/3.4.4/:/usr/libexec/gcc/i686-pc-mingw32/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/bin/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/bin/
libraries:
=/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib/i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../i686-pc-mingw32/3.4.4/:/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../:/lib/i686-pc-mingw32/3.4.4/:/lib/:/usr/lib/i686-pc-mingw32/3.4.4/:/usr/lib/

$ gcc -print-search-dirs
install: /usr/lib/gcc/i686-pc-cygwin/3.4.4/
programs:
=/usr/lib/gcc/i686-pc-cygwin/3.4.4/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/:/usr/lib/gcc/i686-pc-cygwin/:/usr/libexec/gcc/i686-pc-cygwin/3.4.4/:/usr/libexec/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/i686-pc-cygwin/3.4.4/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/
libraries:
=/usr/lib/gcc/i686-pc-cygwin/3.4.4/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/lib/i686-pc-cygwin/3.4.4/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/lib/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../i686-pc-cygwin/3.4.4/:/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../:/lib/i686-pc-cygwin/3.4.4/:/lib/:/usr/lib/i686-pc-cygwin/3.4.4/:/usr/lib/

$ cpp -mno-cygwin --verbose test.c
Reading specs from /usr/lib/gcc/i686-pc-mingw32/3.4.4/specs
Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose
--prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc --enable-nls
--without-included-gettext --enable-version-specific-runtime-libs
--without-x --enable-libgcj --disable-java-awt --with-system-zlib
--enable-interpreter --disable-libgcj-debug --enable-threads=posix
--enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptions
--enable-hash-synchronization --enable-libstdcxx-debug : (reconfigured)
Thread model: posix
gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
/usr/lib/gcc/i686-pc-mingw32/3.4.4/cc1.exe -E -quiet -v -D__MSVCRT__
-D__MINGW32__ -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT -idirafter
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api -idirafter
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib/../../include/w32api 


test.c -mno-cygwin -mtune=pentiumpro
ignoring nonexistent directory /usr/local/include/mingw
ignoring duplicate directory /usr/include/mingw
ignoring duplicate directory
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib/../../include/w32api
#include ... 

Re: Help: gcc problem in Cygwin!

2006-08-02 Thread Larry Hall (Cygwin)

http://cygwin.com/acronyms/#TOFU.  Reformatted.

Frank C. wrote:

--- Larry Hall (Cygwin)
reply-to-list-only-lh at cygwin dot com wrote:

   ^^^
http://cygwin.com/acronyms/#PCYMTNQREAIYR.  Thanks.




Frank C. wrote:

Dear all,

I've been trying to install a software on Cygwin

under

Windows XP, but without any success. The steps are

(1)

'./configure', and (2) 'make'.

I had following error message after running

'make'.

cygpath: can't convert empty path


/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o)

:: undefined reference to '[EMAIL PROTECTED]'
collect2: ld returned 1 exit status
make: *** [libquicknet3.a] Error 1


Can anyone let me know what's wrong here? It seems
that there is a confusion on which linker to use

for

gcc, and GNU ld is not on the path. I attach the
output from './configure' at the end. Do you think

it

is related to those outputs? If so, how to fix it?

If

not, what's the cause?
checking for ld used by GCC... ${CXX}
checking if the linker (${CXX}) is GNU ld... no




Make sure you've installed the 'binutils' package
and that
'ld' from this package is in your path.  If this
doesn't
resolve the problem, then please read and follow the
problem
reporting guidelines found here:

Problem reports:  

http://cygwin.com/problems.html



--
Larry Hall 
http://www.rfk.com

RFK Partners, Inc.  (508)
893-9779 - RFK Office
216 Dalton Rd.  (508)
893-9889 - FAX
Holliston, MA 01746

--
Unsubscribe info: 
http://cygwin.com/ml/#unsubscribe-simple
Problem reports:  
http://cygwin.com/problems.html

Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Larry,

Thanks for your quick reply!

I installed the latest version of Cygwin, and almost
all packages which includes 'binutils' package. I
checked and found 'ld' in the path: (1)
cygwin\bin\ld.exe (678 kb), and (2)
cygwin\usr\i686-pc-cygwin\bin\ld.exe (1 kb). Is this
normal?



Yes, that's normal.  The latter is a symbolic link to the former.



I did a quick search on the list and couldn't find
exact answer to my question.

Do you have any more thoughts? Thanks!



OK, this looks like it must be a configure problem then.  'cygpath'
is apparently being invoked by the script with an empty path.  If
you can narrow down where in this script that this is happening,
you should have more luck determining why this is the case and how
to resolve it.  My WAG is that it's resolving some environment variable
or path that doesn't actually exist.  But I can't say more without
further details.

HTH,


--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Help: gcc problem in Cygwin!

2006-08-02 Thread Stein Somers
Frank, you could run make with the -n flag to see what commands it issues (even 
hidden command lines).  This generates enormous amounts of output for all 
commands far beyond the one that is bothering you now, so run for instance:


make -n 21 | less

If you're lucky, you'll see cygpath mentioned early on.  If you're very lucky, 
the context would tell where to look further.


--
Stein

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Help: gcc problem in Cygwin!

2006-08-01 Thread Frank C.
Dear all,

I've been trying to install a software on Cygwin under
Windows XP, but without any success. The steps are (1)
'./configure', and (2) 'make'.

I had following error message after running 'make'.

cygpath: can't convert empty path
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o)
:: undefined reference to '[EMAIL PROTECTED]'
collect2: ld returned 1 exit status
make: *** [libquicknet3.a] Error 1


Can anyone let me know what's wrong here? It seems
that there is a confusion on which linker to use for
gcc, and GNU ld is not on the path. I attach the
output from './configure' at the end. Do you think it
is related to those outputs? If so, how to fix it? If
not, what's the cause?
checking for ld used by GCC... ${CXX}
checking if the linker (${CXX}) is GNU ld... no


Appreciate your help!

Best,
Frank


--
./configure
--
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... i686-pc-cygwin
checking for gcc... gcc
checking for C compiler default output... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler...
yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none
needed
checking for g++... g++
checking whether we are using the GNU C++ compiler...
yes
checking whether g++ accepts -g... yes
checking for a BSD-compatible install...
/usr/bin/install -c
checking for ranlib... ranlib

checking for ld used by GCC... ${CXX}
checking if the linker (${CXX}) is GNU ld... no

checking for ${CXX} option to reload object files...
-r
checking for BSD-compatible nm... /usr/bin/nm -B
checking for a sed that does not truncate output...
/usr/bin/sed
checking whether ln -s works... yes
checking how to recognise dependent libraries...
file_magic file
format pei*-i386(.*architecture: i386)?
checking command to parse /usr/bin/nm -B output... ok
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for ranlib... (cached) ranlib
checking for strip... strip
checking for objdir... .libs
checking for gcc option to produce PIC... -DDLL_EXPORT
checking if gcc PIC flag -DDLL_EXPORT works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions...
yes
checking whether the linker (${CXX}) supports shared
libraries... yes
checking how to hardcode library paths into
programs... immediate
checking whether stripping libraries is possible...
yes
checking dynamic linker characteristics... Win32
ld.exe
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
creating libtool
checking for sqrt in -lm... yes
checking for standard_arithmetic in -lsunmath... no
checking for pthread_create in -lpthread... yes
checking for pkg-config... /usr/bin/pkg-config
checking for rtst... checking for rtst_exit in
-lrtst... no
checking for quicknet_testdata dir... not found
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for sys/stat.h... (cached) yes
checking sunmath.h usability... no
checking sunmath.h presence... no
checking for sunmath.h... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for long long... yes
checking for unsigned long long... yes
checking for special C compiler options needed for
large files... no
checking for _FILE_OFFSET_BITS value needed for large
files... no
checking for _LARGE_FILES value needed for large
files... no
checking for vprintf... yes
checking for _doprnt... no
checking for 

Re: Help: gcc problem in Cygwin!

2006-08-01 Thread Larry Hall (Cygwin)

Frank C. wrote:

Dear all,

I've been trying to install a software on Cygwin under
Windows XP, but without any success. The steps are (1)
'./configure', and (2) 'make'.

I had following error message after running 'make'.

cygpath: can't convert empty path
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o)
:: undefined reference to '[EMAIL PROTECTED]'
collect2: ld returned 1 exit status
make: *** [libquicknet3.a] Error 1


Can anyone let me know what's wrong here? It seems
that there is a confusion on which linker to use for
gcc, and GNU ld is not on the path. I attach the
output from './configure' at the end. Do you think it
is related to those outputs? If so, how to fix it? If
not, what's the cause?
checking for ld used by GCC... ${CXX}
checking if the linker (${CXX}) is GNU ld... no





Make sure you've installed the 'binutils' package and that
'ld' from this package is in your path.  If this doesn't
resolve the problem, then please read and follow the problem
reporting guidelines found here:


Problem reports:   http://cygwin.com/problems.html




--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Help: gcc problem in Cygwin!

2006-08-01 Thread Frank C.
Larry,

Thanks for your quick reply!

I installed the latest version of Cygwin, and almost
all packages which includes 'binutils' package. I
checked and found 'ld' in the path: (1)
cygwin\bin\ld.exe (678 kb), and (2)
cygwin\usr\i686-pc-cygwin\bin\ld.exe (1 kb). Is this
normal?

I did a quick search on the list and couldn't find
exact answer to my question.

Do you have any more thoughts? Thanks!

Best,
Frank

(BTW, I installed Cygwin in this folder:
D:\software\cygwin)

Error message:

/bin/sh ./libtool --mode=link g++ QN_libc.o ... -o
libquicknet3.a
cygpath: can't convert empty path

g++ QN_libc.o ... -o libquicknet3.a.exe 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o)
:: undefined reference to '[EMAIL PROTECTED]'
collect2: ld returned 1 exit status
make: *** [libquicknet3.a] Error 1




--- Larry Hall (Cygwin)
[EMAIL PROTECTED] wrote:

 Frank C. wrote:
  Dear all,
  
  I've been trying to install a software on Cygwin
 under
  Windows XP, but without any success. The steps are
 (1)
  './configure', and (2) 'make'.
  
  I had following error message after running
 'make'.
  
  cygpath: can't convert empty path
 

/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o)
  :: undefined reference to '[EMAIL PROTECTED]'
  collect2: ld returned 1 exit status
  make: *** [libquicknet3.a] Error 1
  
  
  Can anyone let me know what's wrong here? It seems
  that there is a confusion on which linker to use
 for
  gcc, and GNU ld is not on the path. I attach the
  output from './configure' at the end. Do you think
 it
  is related to those outputs? If so, how to fix it?
 If
  not, what's the cause?
  checking for ld used by GCC... ${CXX}
  checking if the linker (${CXX}) is GNU ld... no
  
 
 
 
 Make sure you've installed the 'binutils' package
 and that
 'ld' from this package is in your path.  If this
 doesn't
 resolve the problem, then please read and follow the
 problem
 reporting guidelines found here:
 
  Problem reports:  
 http://cygwin.com/problems.html
 
 
 
 -- 
 Larry Hall 
 http://www.rfk.com
 RFK Partners, Inc.  (508)
 893-9779 - RFK Office
 216 Dalton Rd.  (508)
 893-9889 - FAX
 Holliston, MA 01746
 
 --
 Unsubscribe info: 
 http://cygwin.com/ml/#unsubscribe-simple
 Problem reports:  
 http://cygwin.com/problems.html
 Documentation: http://cygwin.com/docs.html
 FAQ:   http://cygwin.com/faq/
 
 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: gcc problem - cygwin-1.5.19-4

2006-01-31 Thread Gerrit P. Haase
Hi,

COLLETTE wrote:

 Hello,

 I've a problem with gcc: sometimes gcc can't find some include files.

 TestSpeedMetric.cpp:46:26: ParetoSoft.hpp: No such file or directory
 TestSpeedMetric.cpp: In function `int main()':
 TestSpeedMetric.cpp:155: error: `ParetoSoft' undeclared (first use this
 function)
 TestSpeedMetric.cpp:155: error: (Each undeclared identifier is reported
 only once for each function it appears in.)
 TestSpeedMetric.cpp:155: error: expected primary-expression before int
 TestSpeedMetric.cpp:155: error: expected `;' before int
 make[1]: *** [TestSpeedMetric] Error 1

 If I do a new make, everything works fine. This is not a Makefile 
 problem, but more a gcc problem. Gcc version is 3.4.4 (cygwin special).

I don't think so.  Maybe the header is a generated file or it is copied
and you use make -j3, so it may be that make tries to invoke gcc to
compile the file before another make process has finished its work and
the file is actually not there where it is expected?

What flags do you use to invoke make?  What is the according rule in the
Makefile?  How is the actual command line?  More details needed to
narrow this down.


Gerrit
-- 
=^..^= http://nyckelpiga.de/donate.html


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: gcc problem - cygwin-1.5.19-4

2006-01-31 Thread COLLETTE Yann

Hello,

It's not a flag problem: sometimes when I invoke make this problem 
happens and the, 1 or 2 seconds after, if I invoke again make, it 
works fine without any modifications. I have never meet this problem 
with the preceding version of cygwin. It happened since 1.5.19.

Could it be a transient network problem ?

Your sincerely,

Yann COLLETTE

Gerrit P. Haase a écrit :

Hi,

COLLETTE wrote:

  

Hello,



  

I've a problem with gcc: sometimes gcc can't find some include files.



  

TestSpeedMetric.cpp:46:26: ParetoSoft.hpp: No such file or directory
TestSpeedMetric.cpp: In function `int main()':
TestSpeedMetric.cpp:155: error: `ParetoSoft' undeclared (first use this
function)
TestSpeedMetric.cpp:155: error: (Each undeclared identifier is reported
only once for each function it appears in.)
TestSpeedMetric.cpp:155: error: expected primary-expression before int
TestSpeedMetric.cpp:155: error: expected `;' before int
make[1]: *** [TestSpeedMetric] Error 1



  
If I do a new make, everything works fine. This is not a Makefile 
problem, but more a gcc problem. Gcc version is 3.4.4 (cygwin special).



I don't think so.  Maybe the header is a generated file or it is copied
and you use make -j3, so it may be that make tries to invoke gcc to
compile the file before another make process has finished its work and
the file is actually not there where it is expected?

What flags do you use to invoke make?  What is the according rule in the
Makefile?  How is the actual command line?  More details needed to
narrow this down.


Gerrit
  




-- Disclaimer 
Ce message ainsi que les eventuelles pieces jointes constituent une 
correspondance privee et confidentielle a l'attention exclusive du destinataire 
designe ci-dessus. Si vous n'etes pas le destinataire du present message ou une 
personne susceptible de pouvoir le lui delivrer, il vous est signifie que toute 
divulgation, distribution ou copie de cette transmission est strictement 
interdite. Si vous avez recu ce message par erreur, nous vous remercions d'en 
informer l'expediteur par telephone ou de lui retourner le present message, 
puis d'effacer immediatement ce message de votre systeme.
***
This e-mail and any attachments is a confidential correspondence intended only 
for use of the individual or entity named above. If you are not the intended 
recipient or the agent responsible for delivering the message to the intended 
recipient, you are hereby notified that any disclosure, distribution or copying 
of this communication is strictly prohibited. If you have received this 
communication in error, please notify the sender by phone or by replying this 
message, and then delete this message from your system.


gcc problem - cygwin-1.5.19-4

2006-01-23 Thread COLLETTE Yann

Hello,

I've a problem with gcc: sometimes gcc can't find some include files.

TestSpeedMetric.cpp:46:26: ParetoSoft.hpp: No such file or directory
TestSpeedMetric.cpp: In function `int main()':
TestSpeedMetric.cpp:155: error: `ParetoSoft' undeclared (first use this 
function)
TestSpeedMetric.cpp:155: error: (Each undeclared identifier is reported 
only once for each function it appears in.)

TestSpeedMetric.cpp:155: error: expected primary-expression before int
TestSpeedMetric.cpp:155: error: expected `;' before int
make[1]: *** [TestSpeedMetric] Error 1

If I do a new make, everything works fine. This is not a Makefile 
problem, but more a gcc problem. Gcc version is 3.4.4 (cygwin special).


Your sincerely,

Yann COLLETTE


-- Disclaimer 
Ce message ainsi que les eventuelles pieces jointes constituent une 
correspondance privee et confidentielle a l'attention exclusive du destinataire 
designe ci-dessus. Si vous n'etes pas le destinataire du present message ou une 
personne susceptible de pouvoir le lui delivrer, il vous est signifie que toute 
divulgation, distribution ou copie de cette transmission est strictement 
interdite. Si vous avez recu ce message par erreur, nous vous remercions d'en 
informer l'expediteur par telephone ou de lui retourner le present message, 
puis d'effacer immediatement ce message de votre systeme.
***
This e-mail and any attachments is a confidential correspondence intended only 
for use of the individual or entity named above. If you are not the intended 
recipient or the agent responsible for delivering the message to the intended 
recipient, you are hereby notified that any disclosure, distribution or copying 
of this communication is strictly prohibited. If you have received this 
communication in error, please notify the sender by phone or by replying this 
message, and then delete this message from your system.

Cygwin Configuration Diagnostics
Current System Time: Tue Jan 24 08:34:55 2006

Windows XP Professional Ver 5.1 Build 2600 Service Pack 1

Path:   C:\cygwin\usr\local\bin
C:\cygwin\bin
C:\cygwin\bin
C:\cygwin\usr\X11R6\bin
c:\WINDOWS\system32
c:\WINDOWS
c:\WINDOWS\System32\Wbem
c:\Perl\bin
c:\Program Files\Bea\Tuxedo8.0\bin
c:\Program Files\QuickTime\QTSystem\
c:\Program Files\Statopt7\V_7.2.1\data\librairies\matlab\bin\win32
c:\Program 
Files\Statopt7\V_7.2.1\data\librairies\SADMessagerie\bin_pcwin
C:\cygwin\MikTeX\miktex\bin
.\
bin
c:\Program Files\microsoft visual studio\common\tools
c:\Program Files\microsoft visual studio\VC98\Bin
c:\Program Files\microsoft visual studio\common\MsDev98\Bin
.\
C:\cygwin\lib\lapack

Output from C:\cygwin\bin\id.exe (nontsec)
UID: 217681(a067685)GID: 10545(mkgroup-l-d)
545(Users)  10545(mkgroup-l-d)

Output from C:\cygwin\bin\id.exe (ntsec)
UID: 217681(a067685)GID: 10545(mkgroup-l-d)
545(Users)  10545(mkgroup-l-d)

SysDir: C:\WINDOWS\System32
WinDir: C:\WINDOWS

USER = 'a067685'
PWD = '/cygdrive/g'
HOME = '/cygdrive/g'
MAKE_MODE = 'unix'

HOMEPATH = '\'
MANPATH = 
'/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man:/usr/share/qt3/doc/man'
APPDATA = 'C:\Documents and Settings\a067685\Application Data'
HOSTNAME = 'FR20038882'
TERM = 'cygwin'
PROCESSOR_IDENTIFIER = 'x86 Family 15 Model 3 Stepping 4, GenuineIntel'
WINDIR = 'C:\WINDOWS'
TEXDOCVIEW_txt = 'cygstart %s'
TEXDOCVIEW_dvi = 'cygstart %s'
QTDIR = '/usr/lib/qt3'
OLDPWD = '/usr/bin'
USERDOMAIN = 'CORP'
OS = 'Windows_NT'
ALLUSERSPROFILE = 'C:\Documents and Settings\All Users'
TEMP = '/cygdrive/c/DOCUME~1/a067685/LOCALS~1/Temp'
COMMONPROGRAMFILES = 'C:\Program Files\Common Files'
LIB = ';c:\Program Files\microsoft visual studio\VC98\Lib;c:\Program 
Files\microsoft visual studio\common\MsDev98\Bin;'
QTJAVA = 'C:\Program Files\JavaSoft\JRE\1.3.1_07\lib\ext\QTJava.zip'
USERNAME = 'a067685'
TEXDOCVIEW_pdf = 'cygstart %s'
PROCESSOR_LEVEL = '15'
SYSTEMDRIVE = 'C:'
TEXDOCVIEW_html = 'cygstart %s'
USERPROFILE = 'C:\Documents and Settings\a067685'
CLIENTNAME = 'Console'
QMAKESPEC = '/usr/lib/qt3/mkspecs/cygwin-g++'
!G: = 'G:\'
PS1 = '\[\e]0;[EMAIL PROTECTED] \[\e[33m\]\w\[\e[0m\]\n\$ '
LOGONSERVER = '\\DC-MASSENET'
PROCESSOR_ARCHITECTURE = 'x86'
!C: = 'C:\Cygwin\bin'
SHLVL = '1'
USERDNSDOMAIN = 'CORP.NOXIANE.NET'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
HOMEDRIVE = 'G:'
PROMPT = '$P$G'
COMSPEC = 'C:\WINDOWS\system32\cmd.exe'
TMP = '/cygdrive/c/DOCUME~1/a067685/LOCALS~1/Temp'
SYSTEMROOT = 'C:\WINDOWS'
PRINTER = '\\I-PREVERT\MFP00149'
CVS_RSH = '/bin/ssh'
PROCESSOR_REVISION = '0304'
CLASSPATH = 'C:\Program Files\JavaSoft\JRE\1.3.1_07\lib\ext\QTJava.zip'
TEXDOCVIEW_ps = 'cygstart %s'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info:'
PROGRAMFILES = 'C:\Program Files'
HOMESHARE = '\\F-RENOUTET\a067685'
NUMBER_OF_PROCESSORS = '1'
INCLUDE

gcc problem

2004-03-02 Thread Lauer Rainer
Hi Gents,
I've installed the latest version of cygwin (as of today 2.03.04). My PC is
running Windows 2000 with service pack 4. Installation is done on my loca
drive d:. I tried a small C++ and failed, the reason is totally unclear to
me.
The program is:
#include iostream

using namespace std;

int main()
{
  int selection;
  bool loop = true;
  
  while (loop)
  {
#if 0
cout  endl;
cout  *\n;
cout  *  Learning bed C++ *\n;
cout  *\n;

cout   CHAPTER 4 \n;
cout  =\n\n;

cout   1: Review_5\n;
cout  -1: Exit\n;
cout  $ ;
cin  selection;
cout  endl;

switch (selection)
{
  case -1:
loop = false;
break;
  case 0:
break;
  case 1:
break;
  case 2:
break;
  case 3:
break;
  case 4:
break;
  case 5:
break;
  case 6:
break;
  case 7:
break;
  case 8:
break;
  case 9:
break;
  case 10:
break;
  case 11:
break;
}//  switch (selection)
#endif
  }//  while (loop)
  return 0;
}//main

The error message is:
$ gcc -o gtest gtest.cc
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x4d):gtest.cc:
undefined reference to `std::ios_base::Init::Init[in-charge]()'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x68):gtest.cc:
undefined reference to `std::ios_base::Init::~Init [in-charge]()'
collect2: ld returned 1 exit status

Desperatelly I installed the complete (!) cygwin - the result is still the
same.

When I set the #if 0 to #if 1the error message looks like:
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xa1):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar 
std::endl
char, std::char_traitschar (std::basic_ostreamchar,
std::char_traitschar )'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xa8):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xad):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar
::operator
(std::basic_ostreamchar, std::char_traitschar 
(*)(std::basic_ostreamchar, std::char_traitschar ))'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xbc):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xc1):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar 
std::operator std::char_traitschar (std::basic_ostreamchar,
std::char_traitschar, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xd0):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xd5):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar 
std::operator std::char_traitschar (std::basic_ostreamchar,
std::char_traitschar, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xe4):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xe9):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar 
std::operator std::char_traitschar (std::basic_ostreamchar,
std::char_traitschar, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xf8):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xfd):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar 
std::operator std::char_traitschar (std::basic_ostreamchar,
std::char_traitschar, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x10c):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x111):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar 
std::operator std::char_traitschar (std::basic_ostreamchar,
std::char_traitschar, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x120):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x125):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar 
std::operator std::char_traitschar (std::basic_ostreamchar,
std::char_traitschar, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x134):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x139):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar 
std::operator std::char_traitschar (std::basic_ostreamchar,
std::char_traitschar , char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x148):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x14d):gtest.cc:
undefined reference to `std::basic_ostreamchar, std::char_traitschar 

Re: gcc problem

2004-03-02 Thread Laurent Vaucher

The error message is:
$ gcc -o gtest gtest.cc
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x4d):gtest.cc:
undefined reference to `std::ios_base::Init::Init[in-charge]()'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x68):gtest.cc:
undefined reference to `std::ios_base::Init::~Init [in-charge]()'
collect2: ld returned 1 exit status
 

Maybe you could just try g++ instead of gcc in the command line to force 
it to recognize .cc extension as a C++ source file, not some kind of 
preprocessor input.

Laurent.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: gcc problem

2004-03-02 Thread Gerrit P. Haase
Hello Rainer,

you wrote:

 I've installed the latest version of cygwin (as of today 2.03.04). My PC is
 running Windows 2000 with service pack 4. Installation is done on my loca
 drive d:. I tried a small C++ and failed, the reason is totally unclear to
 me.
 The program is:
[...]

 The error message is:
 $ gcc -o gtest gtest.cc
 /cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x4d):gtest.cc:
 undefined reference to `std::ios_base::Init::Init[in-charge]()'
 /cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x68):gtest.cc:
 undefined reference to `std::ios_base::Init::~Init [in-charge]()'
 collect2: ld returned 1 exit status

g++ is in a separate package named gcc-g++, be sure you have installed
this too.  Then you need to link against libstdc++ when using gcc as
driver:
 gcc -o gtest gtest.cc -lstdc++
or you use g++ as driver which includes libstdc++ automatically:
 g++ -o gtest gtest.cc


HTH,
Gerrit
-- 
=^..^= http://nyckelpiga.de/donate.html


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: gcc problem

2004-03-02 Thread Gareth Pearce

 
 g++ is in a separate package named gcc-g++, be sure you have installed
 this too.  Then you need to link against libstdc++ when using gcc as
 driver:
  gcc -o gtest gtest.cc -lstdc++
 or you use g++ as driver which includes libstdc++ automatically:
  g++ -o gtest gtest.cc

Just want to drop my usual line here - Do use g++ rather then gcc -lstdc++
Since gcc -lstdc++ isn't always enough, and what is enough may not always be
enough in the future.

Gareth
PS - in response to the other email - .cc Is pre-processor input - since
that's the Normal state for c++ code - pre-processor input of which the
output is then fed to a c++ compiler. (Virtually at least, in practice it
can end up being integrated somewhat.  The C standard allows 'as if'
interpretation in the implementation of the pre-processing component.)



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: gcc problem in my installation of cygwin

2003-11-24 Thread Larry Hall (RFK Partners, Inc)
At 11:26 PM 11/23/2003, Nikhil Bhargava you wrote:
hello Ms. Larry,


That would be more properly phrased as 'Mr. Hall' but I don't require such 
formalism.  'Larry' is fine.



I am thankful for the help. I didnot tried google as i thought i wouldnot be able to 
find this problem. I wil be careful in future and  will go throughthe link you have 
quoted.


Great, thanks.



nikhil


- Original Message -

DATE: Sun, 23 Nov 2003 13:45:00
From: Larry Hall [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc: 

At 12:05 PM 11/23/2003, Nikhil Bhargava you wrote:
hello friends,

I have installed latest version of cygwin and also set the path accordingly.

But while compiling my C code, I am getting following error

$ gcc timer.c
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/
find -luser32
collect2: ld returned 1 exit status


Please help me rectify the problem.


Do you google?  

http://www.google.com/search?hl=enlr=ie=UTF-8oe=UTF-8as_qdr=allq=%22find+-luser32%22+site%3Acygwin.combtnG=Google+Search

The first hit here would seem to answer your question just fine.  No?

Also, as I'm always fond of pointing out, you can find what package
a file of interest is in by going to http://cygwin.com/packages/ and
entering its (libuser32.a in this case).



--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 






Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



gcc problem in my installation of cygwin

2003-11-23 Thread Nikhil Bhargava
hello friends,

I have installed latest version of cygwin and also set the path accordingly.

But while compiling my C code, I am getting following error

$ gcc timer.c
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/
find -luser32
collect2: ld returned 1 exit status


Please help me rectify the problem.

nikhil bhargava



Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: gcc problem in my installation of cygwin

2003-11-23 Thread Larry Hall
At 12:05 PM 11/23/2003, Nikhil Bhargava you wrote:
hello friends,

I have installed latest version of cygwin and also set the path accordingly.

But while compiling my C code, I am getting following error

$ gcc timer.c
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/
find -luser32
collect2: ld returned 1 exit status


Please help me rectify the problem.


Do you google?  

http://www.google.com/search?hl=enlr=ie=UTF-8oe=UTF-8as_qdr=allq=%22find+-luser32%22+site%3Acygwin.combtnG=Google+Search

The first hit here would seem to answer your question just fine.  No?

Also, as I'm always fond of pointing out, you can find what package
a file of interest is in by going to http://cygwin.com/packages/ and
entering its (libuser32.a in this case).



--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: gcc problem in my installation of cygwin

2003-11-23 Thread Nikhil Bhargava
hello Ms. Larry,

I am thankful for the help. I didnot tried google as i thought i wouldnot be able to 
find this problem. I wil be careful in future and  will go throughthe link you have 
quoted.

nikhil


- Original Message -

DATE: Sun, 23 Nov 2003 13:45:00
From: Larry Hall [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc: 

At 12:05 PM 11/23/2003, Nikhil Bhargava you wrote:
hello friends,

I have installed latest version of cygwin and also set the path accordingly.

But while compiling my C code, I am getting following error

$ gcc timer.c
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/
find -luser32
collect2: ld returned 1 exit status


Please help me rectify the problem.


Do you google?  

http://www.google.com/search?hl=enlr=ie=UTF-8oe=UTF-8as_qdr=allq=%22find+-luser32%22+site%3Acygwin.combtnG=Google+Search

The first hit here would seem to answer your question just fine.  No?

Also, as I'm always fond of pointing out, you can find what package
a file of interest is in by going to http://cygwin.com/packages/ and
entering its (libuser32.a in this case).



--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 






Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



gcc problem

2003-09-14 Thread swa004
Hi,
I just installed Cygwin on my XP. When I tried to compile my first C
program, ld complains about some run time library linking problem:
$ gcc a.c
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a(pseudo-reloc.o)(.te
xt+0
x49): undefined reference to `___RUNTIME_PSEUDO_RELOC_LIST__'
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a(pseudo-reloc.o)(.te
xt+0
x51): undefined reference to `___RUNTIME_PSEUDO_RELOC_LIST_END__'
num_of_bfd=36 num_of_left_bfd=36 whole_size=   0 whole_reduced_size=
0

collect2: ld returned 1 exit status

Is it a installation problem? Any input is appreciated.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



1.3.22: (gcc) problem using gettimeofday with -mno-cygwin

2003-03-31 Thread Rob Siklos
Hello,

I am trying to compile the following trivial program:


#include stdio.h
#include sys/time.h

int main()
{
  struct timeval tv;
  gettimeofday(tv, NULL) ;
  printf(%ld %ld\n, tv.tv_sec, tv.tv_usec);
  return 0;
}



When I use gcc with no options, everything works fine.  However, if I use
the -mno-cygwin flag, I get the following error message:


gcc -Wall -mno-cygwingettime.c   -o gettime
gettime.c: In function `main':
gettime.c:7: warning: implicit declaration of function `gettimeofday'
/c/DOCUME~1/rsiklos/LOCALS~1/Temp/ccqKF5Mc.o(.text+0x37):gettime.c:
undefined reference to `gettimeofday'
make: *** [gettime] Error 1
)

Anybody have any ideas?  I am using the latest versions of everthing from
the cygwin installer.  cygcheck file attached.

Thanks,

Rob.


cygcheck.out
Description: Binary data
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

Re: 1.3.22: (gcc) problem using gettimeofday with -mno-cygwin

2003-03-31 Thread Rolf Campbell
Rob Siklos wrote:
Hello,

I am trying to compile the following trivial program:


#include stdio.h
#include sys/time.h
int main()
{
  struct timeval tv;
  gettimeofday(tv, NULL) ;
  printf(%ld %ld\n, tv.tv_sec, tv.tv_usec);
  return 0;
}

When I use gcc with no options, everything works fine.  However, if I use
the -mno-cygwin flag, I get the following error message:

gcc -Wall -mno-cygwingettime.c   -o gettime
gettime.c: In function `main':
gettime.c:7: warning: implicit declaration of function `gettimeofday'
/c/DOCUME~1/rsiklos/LOCALS~1/Temp/ccqKF5Mc.o(.text+0x37):gettime.c:
undefined reference to `gettimeofday'
make: *** [gettime] Error 1
)
Anybody have any ideas?  I am using the latest versions of everthing from
the cygwin installer.  cygcheck file attached.
My first idea:  Windows doesn't provide gettimeofday.



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: 1.3.22: (gcc) problem using gettimeofday with -mno-cygwin

2003-03-31 Thread Christopher Faylor
On Mon, Mar 31, 2003 at 10:36:40AM -0500, Rolf Campbell wrote:
Rob Siklos wrote:
Hello,

I am trying to compile the following trivial program:


#include stdio.h
#include sys/time.h

int main()
{
  struct timeval tv;
  gettimeofday(tv, NULL) ;
  printf(%ld %ld\n, tv.tv_sec, tv.tv_usec);
  return 0;
}



When I use gcc with no options, everything works fine.  However, if I use
the -mno-cygwin flag, I get the following error message:


gcc -Wall -mno-cygwingettime.c   -o gettime
gettime.c: In function `main':
gettime.c:7: warning: implicit declaration of function `gettimeofday'
/c/DOCUME~1/rsiklos/LOCALS~1/Temp/ccqKF5Mc.o(.text+0x37):gettime.c:
undefined reference to `gettimeofday'
make: *** [gettime] Error 1
)

Anybody have any ideas?  I am using the latest versions of everthing from
the cygwin installer.  cygcheck file attached.

My first idea:  Windows doesn't provide gettimeofday.

Bingo.

cgf
--
Please use the resources at cygwin.com rather than sending personal email.
Special for spam email harvesters: send email to [EMAIL PROTECTED]
and be permanently blocked from mailing lists at sources.redhat.com

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: 1.3.22: (gcc) problem using gettimeofday with -mno-cygwin

2003-03-31 Thread Rob Siklos
 My first idea:  Windows doesn't provide gettimeofday.

 Bingo.

Oh- that's too bad.

Does anyone know if Windows provides something similar?  If so, how would I
access it from my program?

Thanks a lot,

Rob.

- Original Message -
From: Christopher Faylor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 10:41 AM
Subject: Re: 1.3.22: (gcc) problem using gettimeofday with -mno-cygwin


 On Mon, Mar 31, 2003 at 10:36:40AM -0500, Rolf Campbell wrote:
 Rob Siklos wrote:
 Hello,
 
 I am trying to compile the following trivial program:
 
 
 #include stdio.h
 #include sys/time.h
 
 int main()
 {
   struct timeval tv;
   gettimeofday(tv, NULL) ;
   printf(%ld %ld\n, tv.tv_sec, tv.tv_usec);
   return 0;
 }
 
 
 
 When I use gcc with no options, everything works fine.  However, if I
use
 the -mno-cygwin flag, I get the following error message:
 
 
 gcc -Wall -mno-cygwingettime.c   -o gettime
 gettime.c: In function `main':
 gettime.c:7: warning: implicit declaration of function `gettimeofday'
 /c/DOCUME~1/rsiklos/LOCALS~1/Temp/ccqKF5Mc.o(.text+0x37):gettime.c:
 undefined reference to `gettimeofday'
 make: *** [gettime] Error 1
 )
 
 Anybody have any ideas?  I am using the latest versions of everthing
from
 the cygwin installer.  cygcheck file attached.
 
 My first idea:  Windows doesn't provide gettimeofday.

 Bingo.

 cgf
 --
 Please use the resources at cygwin.com rather than sending personal email.
 Special for spam email harvesters: send email to [EMAIL PROTECTED]
 and be permanently blocked from mailing lists at sources.redhat.com

 --
 Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
 Bug reporting: http://cygwin.com/bugs.html
 Documentation: http://cygwin.com/docs.html
 FAQ:   http://cygwin.com/faq/






--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: 1.3.22: (gcc) problem using gettimeofday with -mno-cygwin

2003-03-31 Thread Shankar Unni
Rob Siklos wrote:

Does anyone know if Windows provides something similar?  If so, how would I
access it from my program?
The best thing would be to visit http://msdn.microsoft.com and read the 
library (the Win32 SDK).

There have also been various attempts to provide very thin (usually 
partial) POSIX API layers on top of Win32 (unlike, say, Cygwin or UWin, 
which provide nearly complete POSIX emulation layers on top of Win32). 
Just google for Unix POSIX API Win32 or something like that.

Here's one such attempt: http://pw32.sourceforge.net/main.html

--
Shankar.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: gcc problem with filename case insensitivity

2003-02-25 Thread David Starks-Browning
On Monday 24 Feb 03, Elfyn McBratney writes:
  ...
  and I compile with gcc -Imy/include/dir sourcefile.c where
  String.h lives in my/include/dir.
 
  GCC uses my/include/dir/String.h to satisfy the string.h directive.
 
 I just tried this with check_case:strict in my CYGWIN environment
 variable, and that works. It finds /usr/include/string.h and my local
 include/String.h .

Wow, that was it.  Thank you very very much!

Cheers,
David


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



gcc problem with filename case insensitivity

2003-02-24 Thread David Starks-Browning
Greetings,

I have a problem which I realise comes from Windows' being
case-insensitive with filenames.  Even so, maybe someone here knows
how to solve it.

Suppose I have this source file:

#include string.h
#include String.h

int main() {
  // some stuff
}

and I compile with gcc -Imy/include/dir sourcefile.c where
String.h lives in my/include/dir.

GCC uses my/include/dir/String.h to satisfy the string.h directive.

Is there any way to get GCC to check case when locating include files?

Interestingly, this used to work in B18!  (Hahaha!)
Seriously, though, the B18 release announcement has this remark:

   The conflict between String.h and string.h (and other such pairs of
header files) where you include one and get the other has been fixed.

(describing gcc in the release).

A Google search on filename case gcc site:cygwin.com turned up only
10 hits, and the B18 release announcement was one of them. :-)

Is there any possibility to get case-sensitive behavior from GCC in
this respect?

Thanks,
David


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: gcc problem with filename case insensitivity

2003-02-24 Thread Elfyn McBratney
 I have a problem which I realise comes from Windows' being
 case-insensitive with filenames.  Even so, maybe someone here knows
 how to solve it.

 Suppose I have this source file:

 #include string.h
 #include String.h

 int main() {
   // some stuff
 }

 and I compile with gcc -Imy/include/dir sourcefile.c where
 String.h lives in my/include/dir.

 GCC uses my/include/dir/String.h to satisfy the string.h directive.

 Is there any way to get GCC to check case when locating include files?

 Interestingly, this used to work in B18!  (Hahaha!)
 Seriously, though, the B18 release announcement has this remark:

The conflict between String.h and string.h (and other such pairs of
 header files) where you include one and get the other has been fixed.

 (describing gcc in the release).

 A Google search on filename case gcc site:cygwin.com turned up only
 10 hits, and the B18 release announcement was one of them. :-)

 Is there any possibility to get case-sensitive behavior from GCC in
 this respect?


I just tried this with check_case:strict in my CYGWIN environment
variable, and that works. It finds /usr/include/string.h and my local
include/String.h .


Regards,

Elfyn McBratney
[EMAIL PROTECTED]
www.exposure.org.uk



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: gcc problem with filename case insensitivity

2003-02-24 Thread Alex Vinokur

David Starks-Browning [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 Greetings,

 I have a problem which I realise comes from Windows' being
 case-insensitive with filenames.  Even so, maybe someone here knows
 how to solve it.

 Suppose I have this source file:

 #include string.h
 #include String.h

 int main() {
   // some stuff
 }

 and I compile with gcc -Imy/include/dir sourcefile.c where
 String.h lives in my/include/dir.

 GCC uses my/include/dir/String.h to satisfy the string.h directive.

 Is there any way to get GCC to check case when locating include files?

 Interestingly, this used to work in B18!  (Hahaha!)
 Seriously, though, the B18 release announcement has this remark:

The conflict between String.h and string.h (and other such pairs of
 header files) where you include one and get the other has been fixed.

 (describing gcc in the release).

 A Google search on filename case gcc site:cygwin.com turned up only
 10 hits, and the B18 release announcement was one of them. :-)

 Is there any possibility to get case-sensitive behavior from GCC in
 this respect?

 Thanks,
 David



Try to use
www.absey-vine.co.uk/software/2lower.exe
http://www.ais.org/~gary/hold/2LowerProBetaSetup.exe

   =
   Alex Vinokur
 mailto:[EMAIL PROTECTED]
 http://www.simtel.net/pub/oth/19088.html
   =




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: gcc problem?

2002-11-25 Thread CHAUVIERE Jean-Raymond
I didn't program in C for a long time but as far as I remember,
scanf read 1 string using white space as separator.

to enter aaa bbb ccc
you need scanf(%s %s %s, ...) or gets

use gets
or scanf(%s, ..)
followed by
while('\n'!=getchar());
but you loose the extra typed words

hope this helps.


On Thu, 21 Nov 2002 10:46:26 +0800, Carlo Florendo [EMAIL PROTECTED]
wrote:

Hello,

Ever since I installed a newer cygwin, I've encountered problems which I
didn't encounter before.  First, there was the
ls -lproblem which has not yet been resolved (and which is threaded as ls
problem in this list.).  Just today, i discovered something wrong while
using gcc.  I  compiled the snippet below and it's supposed to prompt me for
input twice.  However, I only get prompted once.  (Using the visual c++
compiler, the borland 5.5 compiler gives the correct results)

The reverse is true for the example below: ie you were encountering
problems before, but not realising it.

My gcc version is 2.95.3-5.
Cygwin version is The cygwin1.dll version I am using is
1.3.15-cygwin-1-3-15-1.

---begin snippet-
#include stdio.h
int main()
{
   int n;
   char string[80];
   for ( n=0 ; n2 ; n++ )
   {
 printf( Enter some words:  );
 scanf( %s, string);
 printf( The first word you entered is : %s\n, string );
 fflush ( stdin );
^^^hint: while('\n'!=getchar());
   }
   return 0;
}

You can't flush(stdin). Nothing wrong with Cygwin here, simply the other
compilers implementing stuff that isn't part of the language. The FAQ
for comp.lang.c or alt.comp.lang.learn.c-c++ will no doubt give you
ample insight.





--
CHAUVIERE Jean-Raymond
06 80 38 01 14

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Re: gcc problem?

2002-11-24 Thread Guy Harrison
On Thu, 21 Nov 2002 10:46:26 +0800, Carlo Florendo [EMAIL PROTECTED]
wrote:

Hello,

Ever since I installed a newer cygwin, I've encountered problems which I
didn't encounter before.  First, there was the
ls -lproblem which has not yet been resolved (and which is threaded as ls
problem in this list.).  Just today, i discovered something wrong while
using gcc.  I  compiled the snippet below and it's supposed to prompt me for
input twice.  However, I only get prompted once.  (Using the visual c++
compiler, the borland 5.5 compiler gives the correct results)

The reverse is true for the example below: ie you were encountering
problems before, but not realising it.

My gcc version is 2.95.3-5.
Cygwin version is The cygwin1.dll version I am using is
1.3.15-cygwin-1-3-15-1.

---begin snippet-
#include stdio.h
int main()
{
   int n;
   char string[80];
   for ( n=0 ; n2 ; n++ )
   {
 printf( Enter some words:  );
 scanf( %s, string);
 printf( The first word you entered is : %s\n, string );
 fflush ( stdin );
^^^hint: while('\n'!=getchar());
   }
   return 0;
}

You can't flush(stdin). Nothing wrong with Cygwin here, simply the other
compilers implementing stuff that isn't part of the language. The FAQ
for comp.lang.c or alt.comp.lang.learn.c-c++ will no doubt give you
ample insight.


-- 
[EMAIL PROTECTED]

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Flushing stdin (was: Re: gcc problem?)

2002-11-24 Thread Eric R. Krause
Carlo,

Visual C++ 6.0 CRT (and AFAICT, that of Visual C++.NET too) allow you to
flush an input stream.  The only problem with that is that the C standard
apparently defines flushing ONLY for output streams (sec. 7.9.5.2).  Why in
the hell MicroSquash didn't disclose that this behavior was M$-specific, who
knows--it's yet another way they try to lock you into their software.

For reading words entered by the user, I'd approach the situation using
fgets() and a pair of string buffers--one to hold the input line and one to
hold the word that is sscanf()'ed.  After we've read the word, we can
loop-read until there are no more characters on stdin (in case we entered
past the size of the string buffer), knowing that our word is in a separate
buffer and that each iteration both are NULLed out.

Here's the code...

#include string.h
#include stdio.h
int main() {
char string[80];
char word[80];  /* extra string buffer */
int i;

for (i = 0; i  2; i++) {
memset(string, 0, 80 * sizeof(char));
memset(word, 0, 80 * sizeof(char));
printf(Enter some words: );
fgets(string, 80, stdin);   /* see note A */
sscanf(string, %s, word);
printf(The first word you entered was... %s\n, word);
while (!strchr(string, '\n'))
fgets(string, 80, stdin);
}
return 0;
}

Note A:
Pressing Enter as soon as the prompt comes up will cause fgets() to write a
newline and a NULL to the buffer and return.  If you want to FORCE the user
to enter a non-blank line, then change
fgets(string, 80, stdin);
to
do {
fgets(string, 80, stdin);
} while (string[0] == '\n');

---
Eric R. Krause


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




RE: Flushing stdin (was: Re: gcc problem?)

2002-11-24 Thread Stephan Mueller
I believe the name of the company you're referring to is Microsoft.  (In
addition to the spelling, note that the 's' is not capitalized.)  It
matters, because you'll have a much easier time reporting the small bug
you've discovered (these do occur in large systems, and the
documentation for large systems) if you use the correct company name
when searching for a web site on which to actually submit the bug
report.

BTW, which C standard do you mean?  7.9.5.2 doesn't seem to exist in
either of my copies (I have the 1989 ANSI version, and the 1999 ISO
version handy).

stephan(speaking, of course, only for myself, and not my employer);

-Original Message-
From: Eric R. Krause [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, November 24, 2002 12:14 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Flushing stdin (was: Re: gcc problem?)


Carlo,

Visual C++ 6.0 CRT (and AFAICT, that of Visual C++.NET too) allow you to
flush an input stream.  The only problem with that is that the C
standard apparently defines flushing ONLY for output streams (sec.
7.9.5.2).  Why in the hell MicroSquash didn't disclose that this
behavior was M$-specific, who knows--it's yet another way they try to
lock you into their software.

For reading words entered by the user, I'd approach the situation using
fgets() and a pair of string buffers--one to hold the input line and one
to hold the word that is sscanf()'ed.  After we've read the word, we can
loop-read until there are no more characters on stdin (in case we
entered past the size of the string buffer), knowing that our word is in
a separate buffer and that each iteration both are NULLed out.

Here's the code...

#include string.h
#include stdio.h
int main() {
char string[80];
char word[80];  /* extra string buffer */
int i;

for (i = 0; i  2; i++) {
memset(string, 0, 80 * sizeof(char));
memset(word, 0, 80 * sizeof(char));
printf(Enter some words: );
fgets(string, 80, stdin);   /* see note A */
sscanf(string, %s, word);
printf(The first word you entered was... %s\n, word);
while (!strchr(string, '\n'))
fgets(string, 80, stdin);
}
return 0;
}

Note A:
Pressing Enter as soon as the prompt comes up will cause fgets() to
write a newline and a NULL to the buffer and return.  If you want to
FORCE the user to enter a non-blank line, then change
fgets(string, 80, stdin);
to
do {
fgets(string, 80, stdin);
} while (string[0] == '\n');

---
Eric R. Krause


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




RE: gcc problem?

2002-11-23 Thread Rolf Campbell
This is not a bug in Cygwin or Gcc.  Scanf(%s, ...) only reads from
the stdin if the input buffer is empty.  If you only enter a single word
on the first prompt, then it will wait for you to type the 2nd word.  If
Borland produces different results then maybe they are wrong (or simply
different).

-Rolf

 -Original Message-
 From: Carlo Florendo [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, November 20, 2002 9:46 PM
 To: [EMAIL PROTECTED]
 Subject: gcc problem?
 
 
 Hello,
 
 Ever since I installed a newer cygwin, I've encountered 
 problems which I didn't encounter before.  First, there was 
 the ls -lproblem which has not yet been resolved (and which 
 is threaded as ls problem in this list.).  Just today, i 
 discovered something wrong while using gcc.  I  compiled the 
 snippet below and it's supposed to prompt me for input twice. 
  However, I only get prompted once.  (Using the visual c++ 
 compiler, the borland 5.5 compiler gives the correct results)
 
 My gcc version is 2.95.3-5.
 Cygwin version is The cygwin1.dll version I am using is 
 1.3.15-cygwin-1-3-15-1.
 
 ---begin snippet-
 #include stdio.h
 int main()
 {
int n;
char string[80];
for ( n=0 ; n2 ; n++ )
{
  printf( Enter some words:  );
  scanf( %s, string);
  printf( The first word you entered is : %s\n, string );
  fflush ( stdin );
}
return 0;
 }
 ---end snippet-
 
 
 Thanks!
 
 
 Carlo Florendo
 Astra (Philippines), Inc.
 Email: [EMAIL PROTECTED]
 Web: http://www.astra.ph
 
 
 
 --
 Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
 Bug reporting: http://cygwin.com/bugs.html
 Documentation: http://cygwin.com/docs.html
 FAQ:   http://cygwin.com/faq/
 
 

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




GCC problem

2002-03-21 Thread Mike Hayden

I have installed the cygwin package (1.3.10) on my Win2k machine.

My goal is to build a GCC cross-compiler for a PowerPC target.  The problem
I have is rebuilding the GNU tools.  When I start with the binutils via the
configure script I get the following error:

Configuring for a i686-pc-cygwin host.
Created Makefile in /tmp/build/binutils using mh-frag
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld:
cannot find -luser32
collect2: ld returned 1 exit status
*** The command 'gcc -o conftest -g -O2   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.


I also tried to compile a simple Hello world program to verify if the
problem was only with the configure or some overall gcc problem.  I got a
similar error:

/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld:
cannot find -luser32
collect2: ld returned 1 exit status


I have read the mailing list and noted that many people have had the same
problem.  In most all of those cases the advice was to reinstall cygwin and
make sure the w32api package was downloaded and installed.

I have done this 2x, first I hand picked the packages and tried it and
second I downloaded and installed ALL and tried it.  It did not work in
either case.

Any advice would be appreciated.

Thanks in advance,
MH


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




GCC problem

2002-03-21 Thread David Starks-Browning

On Thursday 21 Mar 02, Mike Hayden writes:
 /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld:
 cannot find -luser32
 collect2: ld returned 1 exit status
 
 I have read the mailing list and noted that many people have had the same
 problem.  In most all of those cases the advice was to reinstall cygwin and
 make sure the w32api package was downloaded and installed.

This is acknowledged as a known problem and is being looked into.

Regards,
David


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




JNI/gcc problem (solved)

2002-01-08 Thread David P. Caldwell

Thanks to Chuck Wilson:

In order for this to work, the --add-stdcall-alias option has to be passed
to the linker on the gcc command line.  So, referring to
http://www.inonit.com/cygwin/jni/helloWorld/c.html, the gcc command line
would need to be changed to:

gcc -mno-cygwin -I$jdk/include -I$jdk/include/win32 -Wl,--add-stdcall-alias 
-shared -o HelloWorld.dll HelloWorld.c

I'll update the online version of the tutorial as soon as I can.

-- David.
David P. Caldwell wrote:

 I was having trouble figuring out how to build Java/JNI programs with
 Cygwin.  There were a number of threads in the mailing list about it, and
 some were helpful, but it still took a great deal of slogging.

 After I got it working, I put a tutorial on the web
 (http://www.inonit.com/cygwin/) on how to do it.

 If you are an expert on these matters (and don't feel like reading the
 tutorial), one question came up.  I was unable to link my examples into
DLLs
 using gcc.  (Or, more properly, I was able to link it into a DLL, but the
 Java virtual machine would invariably complain that the function it was
 looking for did not exist.)  I ended up using LCC-Win32.  There's some
more
 information about what occurred (and my cygcheck -s output) at
 http://www.inonit.com/cygwin/jni/helloWorld/c.html.


I don't have Java installed on this machine so I can't test this myself.
  But, try the following additional options to gcc:

-Wl,--export-all-symbols

If that doesn't work, then try again with the above option, but in addition:

-Wl,--add-stdcall-alias

Does any of that help?

--Chuck


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




GCC problem

2001-12-14 Thread gahan

when i'm tryin' to compile any file i see: cannot exec `as' or cannot 
create executables.
is 'as' any file? why i see these errors?
gahan.



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/