| View previous topic :: View next topic |
| Author |
Message |
goumba
Joined: 20 Nov 2008 Posts: 8
|
Posted: Fri Sep 11, 2009 2:32 am Post subject: Cygwin: building libraries, fopen |
|
|
Hi guys, I know there was another topic on this, but the solution didn't help. I have successfully built the toolchain and libraries on Debian and Ubuntu, but I can't get the libraries to fully build under cygwin:
| Code: |
configure:2815: psp-gcc --version >&5
psp-gcc (GCC) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2826: $? = 0
configure:2815: psp-gcc -v >&5
Using built-in specs.
Target: psp
Configured with: ../configure --prefix=/usr/local/pspdev --target=psp --enable-l
anguages=c,c++ --with-newlib --with-gmp --with-mpfr --enable-cxx-flags=-G0
Thread model: single
gcc version 4.3.2 (GCC)
configure:2826: $? = 0
configure:2815: psp-gcc -V >&5
psp-gcc: '-V' option must have argument
configure:2826: $? = 1
configure:2815: psp-gcc -qversion >&5
psp-gcc: unrecognized option '-qversion'
psp-gcc: no input files
configure:2826: $? = 1
configure:2848: checking for C compiler default output file name
configure:2870: psp-gcc -L/usr/local/pspdev/lib -L/usr/local/pspdev/psp/lib -L
/usr/local/pspdev/psp/sdk/lib -lpsplibc -lpspuser conftest.c >&5
/cygdrive/c/DOCUME~1/Anthony/LOCALS~1/Temp/cc2SPKY5.o: In function `main':
conftest.c:(.text+0x20): undefined reference to `fopen'
conftest.c:(.text+0x48): undefined reference to `fclose'
collect2: ld returned 1 exit status
configure:2874: $? = 1
configure:2911: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #include <stdio.h>
| int
| main ()
| {
| FILE *f = fopen ("conftest.out", "w");
| return ferror (f) || fclose (f) != 0;
|
| ;
| return 0;
| }
configure:2917: error: in `/home/Anthony/src/psplibraries/build/freetype/builds/unix':
configure:2921: error: C compiler cannot create executables
See `config.log' for more details.
|
Looking further:
Now, in the other thread it was suggested the toolchain did not build properly. I have removed cygwin, and the toolchain, and reinstalled and rebuilt, and always get this error. I am pretty sure that the toolchain had built correctly. Also the library holds the symbol:
| Code: |
Anthony@deathstar /usr/local/pspdev
$ find . -name "*.a" | xargs grep fopen
Binary file ./i686-pc-cygwin/psp/lib/libbfd.a matches
Binary file ./lib/libiberty.a matches
Binary file ./lib/libpsp-sim.a matches
Binary file ./psp/lib/libbz2.a matches
Binary file ./psp/lib/libc.a matches***** (emphasis mine)
Binary file ./psp/lib/libg.a matches
Binary file ./psp/lib/libiberty.a matches
Binary file ./psp/lib/libstdc++.a matches
Binary file ./psp/lib/libsupc++.a matches
Binary file ./psp/lib/libz.a matches
Binary file ./psp/sdk/lib/libpsplibc.a matches
Binary file ./psp/sdk/lib/libpspprof.a matches
|
Any ideas? TIA.[/code] |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Fri Sep 11, 2009 2:59 am Post subject: |
|
|
| Code: | psp-gcc -L/usr/local/pspdev/lib -L/usr/local/pspdev/psp/lib -L
/usr/local/pspdev/psp/sdk/lib -lpsplibc -lpspuser conftest.c >&5 |
Where is it getting that commandline from? Did you specify LDFLAGS yourself when compiling? Nowhere in the psplibraries script, nor in freetype, does it contain the string "psplibc". It should be using just "-lc" there. |
|
| Back to top |
|
 |
cosmito
Joined: 04 Mar 2007 Posts: 314 Location: Portugal
|
Posted: Fri Sep 11, 2009 8:11 am Post subject: |
|
|
| psp-gcc ? |
|
| Back to top |
|
 |
jbit Site Admin

Joined: 28 May 2005 Posts: 293 Location: København, Danmark
|
Posted: Fri Sep 11, 2009 4:58 pm Post subject: |
|
|
| I guess this want to be on the PSP forums.... |
|
| Back to top |
|
 |
goumba
Joined: 20 Nov 2008 Posts: 8
|
Posted: Wed Sep 16, 2009 1:17 am Post subject: |
|
|
Hey, sorry.
Yeah its libc. I just tried psplibc to se if I'd get any further (and yes, I know plain libc is preferred). Also I added -L/usr/local/pspdev/psp/lib just to cover all bases (although if it couldn't find the lib that would be the error I would get). |
|
| Back to top |
|
 |
goumba
Joined: 20 Nov 2008 Posts: 8
|
Posted: Thu Sep 17, 2009 10:33 pm Post subject: |
|
|
I also wanted to add that unlike in similar threads, I can not compile a program separately. In other words if I try to make a simple program outside of 'configure' it still fails with the same errors.
I am very familiar with Linux and never have this problem, but need Cygwin as I don't have access to Linux at work. |
|
| Back to top |
|
 |
cory1492
Joined: 10 Dec 2004 Posts: 216
|
Posted: Fri Sep 18, 2009 3:53 am Post subject: |
|
|
google "cygwin error: C compiler cannot create executables", then search your system for other instances of cygwin1.dll outside the cygwin install directory (such as the most common abuse of this dll which is found in /windows/system)
Once that is done, consider using heimdall's pre-built-and-windows-ized toolchain (link) instead just in case that work PC relies on the software that installed the extraneous/mismatched cygwin dll files. |
|
| Back to top |
|
 |
goumba
Joined: 20 Nov 2008 Posts: 8
|
Posted: Fri Sep 18, 2009 11:05 pm Post subject: |
|
|
Thanks, but the problem isn't "C Compiler cannot create executables" because the answer's right in config.log.
When I first installed cygwin, I got an error about mismatched cygwin-1.dlls. I promptly deleted every one but in the Cygwin dir and verified the version, so that's not the problem.
The computers at work really don't have much but McAfee and Novell software installed so I didn't think of cygwin-1 on those computers. You may have a point there, thanks. |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Sat Sep 19, 2009 5:49 am Post subject: |
|
|
| I already answered the question -- that error is because you edited the script and changed -lc to -lpsplibc or whatever. If you're still getting an error with an unmodified psplibraries script, post that config.log here and we'll see what we can do. |
|
| Back to top |
|
 |
|