forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cygwin: building libraries, fopen

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
goumba



Joined: 20 Nov 2008
Posts: 8

PostPosted: Fri Sep 11, 2009 2:32 am    Post subject: Cygwin: building libraries, fopen Reply with quote

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
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Fri Sep 11, 2009 2:59 am    Post subject: Reply with quote

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
View user's profile Send private message
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Fri Sep 11, 2009 8:11 am    Post subject: Reply with quote

psp-gcc ?
Back to top
View user's profile Send private message Visit poster's website
jbit
Site Admin


Joined: 28 May 2005
Posts: 293
Location: København, Danmark

PostPosted: Fri Sep 11, 2009 4:58 pm    Post subject: Reply with quote

I guess this want to be on the PSP forums....
Back to top
View user's profile Send private message Visit poster's website
goumba



Joined: 20 Nov 2008
Posts: 8

PostPosted: Wed Sep 16, 2009 1:17 am    Post subject: Reply with quote

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
View user's profile Send private message
goumba



Joined: 20 Nov 2008
Posts: 8

PostPosted: Thu Sep 17, 2009 10:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Fri Sep 18, 2009 3:53 am    Post subject: Reply with quote

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
View user's profile Send private message
goumba



Joined: 20 Nov 2008
Posts: 8

PostPosted: Fri Sep 18, 2009 11:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Sep 19, 2009 5:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group