Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JainAmber> Hello
- <JainAmber> I'm trying to compile a simple "Hello world" C program under Cygwin
- <JainAmber> Here's the C program: http://codepad.org/TzdsJcXs
- <JainAmber> When I compile this with 'gcc -o test.exe test.c", a file test.exe gets created.
- <JainAmber> But when I try to run it on Cygwin prompt as './test.exe' I get this error: "-bash: ./testit: cannot execute binary file"
- <JainAmber> * "-bash: ./test: cannot execute binary file"
- <JainAmber> When I run "file test.exe", I get: "test.exe: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.0.0, not stripped"
- <JainAmber> What am I doing wrong?
- <JainAmber> Also, I'm using linux-x86_64-gcc (version 4.7.1-1) from Cygwin Ports (i.e. http://sourceware.org/cygwinports/)...
- <cygwinports> you said you were using 'gcc -o test.exe test.c', so which is it?
- <JainAmber> cygwinports, I updated gcc symbolic link to point to 'i686-pc-linux-gnu-gcc-4.7.1.exe' (in /cygdrive/c/cygwin/bin)
- <cygwinports> don't do that
- <JainAmber> What should I do then?
- <cygwinports> 'gcc' is supposed to be the *native* compiler
- <cygwinports> what are you trying to do?
- <JainAmber> I'm trying to port a project to Cygwin. And I found that std::future isn't defined, it is only declared..
- <JainAmber> I found out that std::future isn't defined (it is only declared) from http://cygwin.1069669.n5.nabble.com/GCC-4-4-0-Can-t-activate-threading-support-td50226.html
- <cygwinports> well then you need to use a *cygwin* gcc, not a linux one
- <JainAmber> Ah yes, I got it now... I'm using the wrong package
- <JainAmber> cygwinports, what is difference between linux gcc and cygwin gcc?
- <JainAmber> I mean what is Linux gcc for in cygwin ports?
- <cygwinports> one makes binaries which run on linux, the other makes binaries which run on cygwin
- <cygwinports> std::future is C++11, you'll need to wait for a cygwin gcc-4.7
- <JainAmber> I could not find other threads on Cygwin mailing list that state whether threads are available in newer version of gcc/g++ port (4.7 in Cygwin Ports project)...so I thought of installing it and checking it out myself...
- <JainAmber> ok
- <JainAmber> Any idea about work/progress on cygwin-gcc-4.7?
- <cygwinports> its being worked on, but I can't give you a date right now
- <JainAmber> I don't understand much C++ but if the port does *not* requires writing C++ code, I can help/volunteer for cygwin-gcc-4.7...
- <JainAmber> This seems a bit outdated but I guess this will be helpful: http://cygwin.wikia.com/wiki/How_to_install_a_newer_version_of_GCC
- <JainAmber> A recent post on Cygwin mailing list says: "Ignore the wikia article." .... Aye aye sir!
- <cygwinports> patches are definitely required for Cygwin, feel free to see the gcc4 source package for the patchset and build procedure
- <JainAmber> ok
- <JainAmber> Thanks a lot, cygwinports!
Add Comment
Please, Sign In to add comment