public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc, installation & compiling within cywin structure
       [not found] <1377874959.67331.YahooMailNeo@web160503.mail.bf1.yahoo.com>
@ 2013-08-30 17:41 ` Mark Sheffield
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Sheffield @ 2013-08-30 17:41 UTC (permalink / raw)
  To: gcc-help



Hello - I'm not sure if this forum is the correct place to pose this problem:

I have a recent installation of cygwin running under win-7.  I am trying to build another package into the installed octave, so am working on getting the gcc compiler running.  In trying to build the standard hello.cpp, I'm getting the following results:

$ g++ hello.cpp
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld: cannot find -ladvapi32
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lshell32
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld: cannot find -luser32
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lkernel32
collect2: error: ld returned 1 exit status

where hello.cpp is the standard sort of thing:

#include <iostream>
using namespace std ;

int main()
{
    cout << "Hello World\n" << endl;
    return 0 ;
}

I can't build the "c" version of the same program, get the same results.

There's nothing in usr/local/bin,  usr/local/include, usr/local/lib, they're empty directories.  This is odd.

I've set library paths:

export LD_LIBRARY_PATH=/lib
export LIBRARY_PATH=/lib
export CPATH=/usr/include
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS

/lib and /usr/include are populated with what looks to be like a reasonable set of directories, but I really don't know for sure.

I've been able to compile on my system (mingw under windows) but I can't get gcc running under cygwin.

I'm out of my water at this point and fumbling around.  The tutorials and tfm that I've found don't seem to cover what I have going on here.  Any advice?

thanks - Mark Sheffield

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

* gcc, installation & compiling within cywin structure
@ 2013-09-03 17:34 Mark Sheffield
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Sheffield @ 2013-09-03 17:34 UTC (permalink / raw)
  To: gcc-help

I'm replying to my original posting as I have made progress on it it and I've seen other posts online looking for a solution to this

The problem had to do with an incomplete installation of cygwin.  Some of the mirrors for cygwin package downloads fail with "incomplete download", and only part of the archive is installed.  In my case, everything in the installation seemed to work since the beginning, and it was only when the linker failed that I started working backward.

I tried a few of the mirror sites (reasonably local) and hit on one that worked flawlessly at ftp://mirror.cs.vt.edu.


After download and install of cygwin, putting these lines into .bashrc:

     export LD_LIBRARY_PATH=/usr/local/lib
     export LIBRARY_PATH=/usr/local/lib
     export CPATH=/usr/local/include

And then setting the path in the system environment:

     \usr\local\bin;\usr\bin;\bin;\usr\sbin; 


prior to the first system/system32 path listed in the path environment variable, hello.cpp compiled and linked with no issue.  I understand that this is only a weak first step at testing the compiler, but I did not work prior to this.


**************************** Original Post *************************
Hello - I'm not sure if this forum is the correct place to pose this problem: I have a recent installation of cygwin running under win-7.  I am trying to build another package into the installed octave, so am working on getting the gcc compiler running.  In trying to build the standard hello.cpp, I'm getting the following results: $ g++ hello.cpp
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld: cannot find -ladvapi32
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lshell32
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld: cannot find -luser32
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lkernel32
collect2: error: ld returned 1 exit status where hello.cpp is the standard sort of thing: #include <iostream>
using namespace std ; int main()
{
    cout << "Hello World\n" << endl;
    return 0 ;
} I can't build the "c" version of the same program, get the same results. There's nothing in usr/local/bin,  usr/local/include, usr/local/lib, they're empty directories.  This is odd. I've set library paths: export LD_LIBRARY_PATH=/lib
export LIBRARY_PATH=/lib
export CPATH=/usr/include
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS /lib and /usr/include are populated with what looks to be like a reasonable set of directories, but I really don't know for sure. I've been able to compile on my system (mingw under windows) but I can't get gcc running under cygwin. I'm out of my water at this point and fumbling around.  The tutorials and tfm that I've found don't seem to cover what I have going on here.  Any advice? thanks - Mark Sheffield 

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

end of thread, other threads:[~2013-09-03 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1377874959.67331.YahooMailNeo@web160503.mail.bf1.yahoo.com>
2013-08-30 17:41 ` gcc, installation & compiling within cywin structure Mark Sheffield
2013-09-03 17:34 Mark Sheffield

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).