
Hello, I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) and OpenGL bindings. When I try to compile my work, ghc runs collect2: /usr/libexec/gcc/i686-pc-linux-gnu/3.4.3-20050110/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o a.out -u GHCziBase_Izh_static_info -u GHCziBase_Czh_static_info -u GHCziFloat_Fzh_static_info -u GHCziFloat_Dzh_static_info -u GHCziPtr_Ptr_static_info -u GHCziWord_Wzh_static_info -u GHCziInt_I8zh_static_info -u GHCziInt_I16zh_static_info -u GHCziInt_I32zh_static_info -u GHCziInt_I64zh_static_info -u GHCziWord_W8zh_static_info -u GHCziWord_W16zh_static_info -u GHCziWord_W32zh_static_info -u GHCziWord_W64zh_static_info -u GHCziStable_StablePtr_static_info -u GHCziBase_Izh_con_info -u GHCziBase_Czh_con_info -u GHCziFloat_Fzh_con_info -u GHCziFloat_Dzh_con_info -u GHCziPtr_Ptr_con_info -u GHCziPtr_FunPtr_con_info -u GHCziStable_StablePtr_con_info -u GHCziBase_False_closure -u GHCziBase_True_closure -u GHCziPack_unpackCString_closure -u GHCziIOBase_stackOverflow_closure -u GHCziIOBase_heapOverflow_closure -u GHCziIOBase_NonTermination_closure -u GHCziIOBase_BlockedOnDeadMVar_closure -u GHCziIOBase_BlockedIndefinitely_closure -u GHCziIOBase_Deadlock_closure -u GHCziWeak_runFinalizzerBatch_closure -u __stginit_Prelude /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../crt1.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../crti.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/crtbegin.o -L/home/yin/devel/third/sdlh/SDLstable/img/lib/SDL-0.2.0 -L/usr/lib/ghc-6.4 -L/usr/lib -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110 -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110 -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../../i686-pc-linux-gnu/lib -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../.. Main.o -lHSSDL-0.2.0 \ /usr/lib \ -lSDL -lHSOpenGL -lHSOpenGL_cbits -lGLU -lGL -lm -lHSbase -lHSbase_cbits -lHSrts -lm -lgmp -ldl -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/crtend.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../crtn.o Collect2 don't understand the /usr/lib parameter and fails with this message: /usr/bin/ld: /usr/lib: No such file: File format not recognized collect2: ld returned 1 exit status I just rerun collect2 by hand without pre /usr/lib parameter, and it works. What have I to do or where have to look in to find and resolve the problem? I use Gentoo 2005.0 and SDL binding from SDLStable brach installed by hand (I didn't use Portage). Is it the packages.conf file, where propably is the problem? Thanks for every answer... Matej 'Yin' Gagyi

On 7/18/05, yin
Hello,
I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) and OpenGL bindings. When I try to compile my work, ghc runs collect2:
/usr/libexec/gcc/i686-pc-linux-gnu/3.4.3-20050110/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o a.out -u GHCziBase_Izh_static_info -u GHCziBase_Czh_static_info -u GHCziFloat_Fzh_static_info -u GHCziFloat_Dzh_static_info -u GHCziPtr_Ptr_static_info -u GHCziWord_Wzh_static_info -u GHCziInt_I8zh_static_info -u GHCziInt_I16zh_static_info -u GHCziInt_I32zh_static_info -u GHCziInt_I64zh_static_info -u GHCziWord_W8zh_static_info -u GHCziWord_W16zh_static_info -u GHCziWord_W32zh_static_info -u GHCziWord_W64zh_static_info -u GHCziStable_StablePtr_static_info -u GHCziBase_Izh_con_info -u GHCziBase_Czh_con_info -u GHCziFloat_Fzh_con_info -u GHCziFloat_Dzh_con_info -u GHCziPtr_Ptr_con_info -u GHCziPtr_FunPtr_con_info -u GHCziStable_StablePtr_con_info -u GHCziBase_False_closure -u GHCziBase_True_closure -u GHCziPack_unpackCString_closure -u GHCziIOBase_stackOverflow_closure -u GHCziIOBase_heapOverflow_closure -u GHCziIOBase_NonTermination_closure -u GHCziIOBase_BlockedOnDeadMVar_closure -u GHCziIOBase_BlockedIndefinitely_closure -u GHCziIOBase_Deadlock_closure -u GHCziWeak_runFinalizzerBatch_closure -u __stginit_Prelude /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../crt1.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../crti.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/crtbegin.o -L/home/yin/devel/third/sdlh/SDLstable/img/lib/SDL-0.2.0 -L/usr/lib/ghc-6.4 -L/usr/lib -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110 -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110 -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../../i686-pc-linux-gnu/lib -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../.. Main.o -lHSSDL-0.2.0 \ /usr/lib \ -lSDL -lHSOpenGL -lHSOpenGL_cbits -lGLU -lGL -lm -lHSbase -lHSbase_cbits -lHSrts -lm -lgmp -ldl -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/crtend.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../crtn.o
Collect2 don't understand the /usr/lib parameter and fails with this message:
/usr/bin/ld: /usr/lib: No such file: File format not recognized collect2: ld returned 1 exit status
I just rerun collect2 by hand without pre /usr/lib parameter, and it works. What have I to do or where have to look in to find and resolve the problem? I use Gentoo 2005.0 and SDL binding from SDLStable brach installed by hand (I didn't use Portage).
How did you invoke GHC? How did you install the SDL binding? What does 'ghc-pkg describe SDL' say? -- Friendly, Lemmih

Lemmih wrote:
On 7/18/05, yin
wrote: Hello,
I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) and OpenGL bindings. When I try to compile my work, ghc runs collect2:
I just rerun collect2 by hand without pre /usr/lib parameter, and it works. What have I to do or where have to look in to find and resolve the problem? I use Gentoo 2005.0 and SDL binding from SDLStable brach installed by hand (I didn't use Portage).
How did you invoke GHC?
Yes, I did (I sad it).
How did you install the SDL binding?
$ cd ~/SDLStable/src/Core $ runhaskell Setup.lhs configure --prefix=~/SDLstable_img/ $ runhaskell Setup.lhs build $ su Password: # runhaskell Setup.lhs install
What does 'ghc-pkg describe SDL' say?
See atachment. Thanks, you're fast! Matej 'Yin' Gagyi name: SDL version: 0.2.0 license: BSD3 copyright: 2004-2005, Lemmih maintainer: Lemmih (lemmih@gmail.com) stability: homepage: package-url: description: category: Foreign binding author: Lemmih (lemmih@gmail.com) exposed: True exposed-modules: Graphics.UI.SDL Graphics.UI.SDL.CPUInfo Graphics.UI.SDL.General Graphics.UI.SDL.Video Graphics.UI.SDL.WindowManagement Graphics.UI.SDL.Audio Graphics.UI.SDL.AudioSpec Graphics.UI.SDL.Events Graphics.UI.SDL.Time Graphics.UI.SDL.Keysym Graphics.UI.SDL.Color Graphics.UI.SDL.RWOps Graphics.UI.SDL.Types Graphics.UI.SDL.Rect Graphics.UI.SDL.Utilities Graphics.UI.SDL.Version Graphics.UI.SDL.Joystick hidden-modules: import-dirs: /home/yin/devel/third/sdlh/SDLstable/img/lib/SDL-0.2.0 library-dirs: /home/yin/devel/third/sdlh/SDLstable/img/lib/SDL-0.2.0 hs-libraries: HSSDL-0.2.0 extra-libraries: include-dirs: includes: SDL.h depends: base-1.0 hugs-options: cc-options: -I/usr/include/SDL -D_REENTRANT ld-options: -L/usr/lib -Wl -rpath /usr/lib -lSDL framework-dirs: frameworks: haddock-interfaces: haddock-html:

On 7/18/05, yin
Lemmih wrote:
On 7/18/05, yin
wrote: Hello,
I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) and OpenGL bindings. When I try to compile my work, ghc runs collect2:
I just rerun collect2 by hand without pre /usr/lib parameter, and it works. What have I to do or where have to look in to find and resolve the problem? I use Gentoo 2005.0 and SDL binding from SDLStable brach installed by hand (I didn't use Portage).
How did you invoke GHC?
Yes, I did (I sad it).
I mean, what command line gave that error message?
How did you install the SDL binding?
$ cd ~/SDLStable/src/Core $ runhaskell Setup.lhs configure --prefix=~/SDLstable_img/ $ runhaskell Setup.lhs build $ su Password: # runhaskell Setup.lhs install
What does 'ghc-pkg describe SDL' say?
See atachment.
Thanks, you're fast!
Matej 'Yin' Gagyi
name: SDL version: 0.2.0 license: BSD3 copyright: 2004-2005, Lemmih maintainer: Lemmih (lemmih@gmail.com) stability: homepage: package-url: description: category: Foreign binding author: Lemmih (lemmih@gmail.com) exposed: True exposed-modules: Graphics.UI.SDL Graphics.UI.SDL.CPUInfo Graphics.UI.SDL.General Graphics.UI.SDL.Video Graphics.UI.SDL.WindowManagement Graphics.UI.SDL.Audio Graphics.UI.SDL.AudioSpec Graphics.UI.SDL.Events Graphics.UI.SDL.Time Graphics.UI.SDL.Keysym Graphics.UI.SDL.Color Graphics.UI.SDL.RWOps Graphics.UI.SDL.Types Graphics.UI.SDL.Rect Graphics.UI.SDL.Utilities Graphics.UI.SDL.Version Graphics.UI.SDL.Joystick hidden-modules: import-dirs: /home/yin/devel/third/sdlh/SDLstable/img/lib/SDL-0.2.0 library-dirs: /home/yin/devel/third/sdlh/SDLstable/img/lib/SDL-0.2.0 hs-libraries: HSSDL-0.2.0 extra-libraries: include-dirs: includes: SDL.h depends: base-1.0 hugs-options: cc-options: -I/usr/include/SDL -D_REENTRANT ld-options: -L/usr/lib -Wl -rpath /usr/lib -lSDL
Hmm, looks like GHC is having issues with -rpath. I'm not sure how to solve this correctly but one solution would be to remove it from your package.conf file. -- Friendly, Lemmih

Lemmih wrote:
On 7/18/05, yin
wrote: Lemmih wrote:
On 7/18/05, yin
wrote: Hello,
I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) and OpenGL bindings. When I try to compile my work, ghc runs collect2:
I just rerun collect2 by hand without pre /usr/lib parameter, and it works. What have I to do or where have to look in to find and resolve the problem? I use Gentoo 2005.0 and SDL binding from SDLStable brach installed by hand (I didn't use Portage).
How did you invoke GHC?
Yes, I did (I sad it).
I mean, what command line gave that error message?
I'm sorry, I'm an idiot: $ ghc --make Main.hs I compiling your Haskell + SDL + OpenGL example from haskell wiki and my modifications (big modifications).
What does 'ghc-pkg describe SDL' say?
See atachment.
Thanks, you're fast!
Matej 'Yin' Gagyi
name: SDL version: 0.2.0 license: BSD3 copyright: 2004-2005, Lemmih maintainer: Lemmih (lemmih@gmail.com) stability: homepage: package-url: description: category: Foreign binding author: Lemmih (lemmih@gmail.com) exposed: True exposed-modules: Graphics.UI.SDL Graphics.UI.SDL.CPUInfo Graphics.UI.SDL.General Graphics.UI.SDL.Video Graphics.UI.SDL.WindowManagement Graphics.UI.SDL.Audio Graphics.UI.SDL.AudioSpec Graphics.UI.SDL.Events Graphics.UI.SDL.Time Graphics.UI.SDL.Keysym Graphics.UI.SDL.Color Graphics.UI.SDL.RWOps Graphics.UI.SDL.Types Graphics.UI.SDL.Rect Graphics.UI.SDL.Utilities Graphics.UI.SDL.Version Graphics.UI.SDL.Joystick hidden-modules: import-dirs: /home/yin/devel/third/sdlh/SDLstable/img/lib/SDL-0.2.0 library-dirs: /home/yin/devel/third/sdlh/SDLstable/img/lib/SDL-0.2.0 hs-libraries: HSSDL-0.2.0 extra-libraries: include-dirs: includes: SDL.h depends: base-1.0 hugs-options: cc-options: -I/usr/include/SDL -D_REENTRANT ld-options: -L/usr/lib -Wl -rpath /usr/lib -lSDL
Hmm, looks like GHC is having issues with -rpath. I'm not sure how to solve this correctly but one solution would be to remove it from your package.conf file.
Problem solved. Thank you! Now you have to find a way to correct the problem in your distribution. Maybe, I can help you with long-time-low-priority work around SDL... do you have some work for my? I'm "haskell freshmen" and I need some real-work. Thank you, one more time. Matej 'Yin' Gagyi

Am Montag, 18. Juli 2005 18:46 schrieb yin:
[...] ld-options: -L/usr/lib -Wl -rpath /usr/lib -lSDL
This looks a bit suspicious: The syntax for ld options is "-rpath DIR", so the option for gcc should be "-Wl,-rpath,DIR". Ugly, but I didn't invent that. :-) Furthermore, I've never seen a Linux/*nix system where the (dynamic) linker doesn't look into /usr/lib, so probably the best way is to simply use: ld-options: -lSDL In addition, the -rpath option can be a bit surprising for the user of the executable later, depending on OS/platform peculiarities. Cheers, S.

On 7/20/05, Sven Panne
Am Montag, 18. Juli 2005 18:46 schrieb yin:
[...] ld-options: -L/usr/lib -Wl -rpath /usr/lib -lSDL
This looks a bit suspicious: The syntax for ld options is "-rpath DIR", so the option for gcc should be "-Wl,-rpath,DIR". Ugly, but I didn't invent that. :-) Furthermore, I've never seen a Linux/*nix system where the (dynamic) linker doesn't look into /usr/lib, so probably the best way is to simply use:
ld-options: -lSDL
In addition, the -rpath option can be a bit surprising for the user of the executable later, depending on OS/platform peculiarities.
'sdl-config' is used to set 'ld-options'. Hard coding it is not an option. -- Friendly, Lemmih
participants (3)
-
Lemmih
-
Sven Panne
-
yin