Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Error on linux x64  (Read 6362 times)

0 Members and 1 Guest are viewing this topic.

Agon

  • Newbie
  • *
  • Posts: 4
    • View Profile
Error on linux x64
« on: November 01, 2008, 06:18:48 pm »
Hi, I'm tried to compile sfml C++ but I got an error:

Code: [Select]
g++ -o IPAddress.o -c IPAddress.cpp -W -Wall -pedantic -I../../../include -I../../ -DNDEBUG -O2 -fPIC                                                                                                              
IPAddress.cpp: In static member function ‘static sf::IPAddress sf::IPAddress::GetLocalAddress()’:
IPAddress.cpp:151: error: ‘memset’ was not declared in this scope
IPAddress.cpp: In static member function ‘static sf::IPAddress sf::IPAddress::GetPublicAddress()’:
IPAddress.cpp:202: error: ‘memset’ was not declared in this scope
IPAddress.cpp:238: error: ‘strcat’ was not declared in this scope


And a real up to date list of packages which are required to build sfml would be great.
Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Error on linux x64
« Reply #1 on: November 01, 2008, 06:30:59 pm »
Quote
Hi, I'm tried to compile sfml C++ but I got an error

This is already fixed for next version.

Quote
And a real up to date list of packages which are required to build sfml would be great.

Hmm, I thought I already did that, but apparently not :D
However, it should be in one or two posts on this forum.
Laurent Gomila - SFML developer

christoph

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • http://www.christoph-egger.org
Error on linux x64
« Reply #2 on: November 01, 2008, 07:29:46 pm »
On debian GNU/Linux the following packages are needed:

Code: [Select]
libgl1-mesa-glx, mesa-common-dev,
  libglu1-mesa-dev, libxrandr-dev, libfreetype6-dev, libopenal-dev,
  libsndfile1-dev, libjpeg62-dev, libpng12-dev, libglew1.5-dev,
  linux-libc-dev, libsoil-dev


substracting everything allready included in SFML tarballs you'll get this:

Code: [Select]
libgl1-mesa-glx, mesa-common-dev,
  libglu1-mesa-dev, libxrandr-dev, libfreetype6-dev, libopenal-dev,
  linux-libc-dev


not sure about the glu1 and glx package.

If you want you can use http://patch-tracking.debian.net/patch/series/view/libsfml/1.3-1/cstring_ftbfs.patch for your build problem (it's an g++ 4.3 vs <=4.2 issue), the fix is simmilar but not identical to the one done to the upcomming 1.4 by sfml authors ;)

Agon

  • Newbie
  • *
  • Posts: 4
    • View Profile
Error on linux x64
« Reply #3 on: November 01, 2008, 08:31:02 pm »
Thank you.
I'm trying to make some rpm packages for sfml.
Compiling works. But installing via cp does not because it wants to cp directly to /usr/lib
like written in src/SFML/Network/makefile:
@($(CP) $(LIBNAME) /usr/lib $(INSTALL))

The buildservice which I use creates an extra directory for building and modifies the build flags I suppose. Oh and other apps/libs are using ./configure before  :wink: make.

I think it is better to use $(LIBPATH) instead of /usr/lib

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Error on linux x64
« Reply #4 on: November 01, 2008, 08:42:58 pm »
Again, it's already done in the current version (you have a variable for the destination path). Why don't you just use the SVN version ? ;)
Laurent Gomila - SFML developer

Agon

  • Newbie
  • *
  • Posts: 4
    • View Profile
Error on linux x64
« Reply #5 on: November 01, 2008, 08:46:07 pm »
Hm ok will use the svn version until 1.4 is released.

Edit:
Now I'm using the svn version compiling works but installing not.
But I get an different error:
Code: [Select]
+ make install DESTDIR=/var/tmp/sfml-1.3.917-build                                                              
make[1]: Entering directory `/usr/src/packages/BUILD/sfml/src/SFML'                                            
make[2]: Entering directory `/usr/src/packages/BUILD/sfml/src/SFML/System'                                      
ln: accessing `/var/tmp/sfml-1.3.917-build/lib/libsfml-system.so': Not a directory                              
make[2]: *** [install] Error 1                                                                                  
make[2]: Leaving directory `/usr/src/packages/BUILD/sfml/src/SFML/System'                                      
make[1]: *** [install] Error 2                                                                                  
make[1]: Leaving directory `/usr/src/packages/BUILD/sfml/src/SFML'                                              
make: *** [install] Error 2                                                                                    
error: Bad exit status from /var/tmp/rpm-tmp.70981 (%install)    

christoph

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • http://www.christoph-egger.org
Error on linux x64
« Reply #6 on: November 01, 2008, 09:51:27 pm »
Hehe, I ran into excatly the same issue while testing the new svn for my debian packages.

The problem (as far as I understand) is, taht src/SFML/Makefile does replace your destdir variable by /usr (which is actually much better than 1.3 where you had to patch $(DESTDIR) in all the src/SFML/*/Makefile by hand -- Thanks to Laurent for this considerable improvment !)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Error on linux x64
« Reply #7 on: November 01, 2008, 09:54:49 pm »
As far as I understand (but I'm less experienced in Linux stuff than you guys), SFML tries to access the /lib sub-directory of the DESTDIR path, and fails because it doesn't exist.

Whatever the problem is, what is the usual way of doing it ?
Laurent Gomila - SFML developer

christoph

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • http://www.christoph-egger.org
Error on linux x64
« Reply #8 on: November 01, 2008, 10:04:46 pm »
I'm not an make crack in any way -- so there will probably be loads of people being able to help here more but something along

replacing the

Code: [Select]
export DESTDIR = /usr

by

Code: [Select]
export MYDESTDIR = $(DESTDIR)/usr

and using MYDESTDIR in all the other makefiles would be the key here.

The problem is that build-services (as the OP referred to) and packaging tools assume to be able to modify the destdir by setting the variable when invoking make.

Your solution enables one to set the destdir by editing src/SFML/Makefile

With the solution above, if DESTDIR is not set everything works as before and the users are still able to modify the destdir by editing src/SFML/Makefile but setting the make Var when invoking make install will work, too.

EDIT://
I solved it for my packaging my renaming my var to DDESTDIR and adding it to src/SFML/Makefile the following:
Code: [Select]
export DESTDIR = $(DDESTDIR)/usr

Disclaimer:
Hopefully I didn't missunderstand anything ;)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Error on linux x64
« Reply #9 on: November 01, 2008, 10:15:10 pm »
My understanding of this stuff is not the same as you. I think that DESTDIR has a default value of /usr if you don't pass it to the command line, and is overriden if you do.

The problem here is that my makefile requests a /lib sub-directory to exist.
Laurent Gomila - SFML developer

christoph

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • http://www.christoph-egger.org
Error on linux x64
« Reply #10 on: November 01, 2008, 10:44:56 pm »
Ahh yes, you are actually right (I'm removing the unneeded stuff right now).

I'll have to say thtanks for this, it's actually reducing my work quite a lot :)

So all that is needed to fix this seems to be something along having

Code: [Select]
install:
        mkdir -p $(DESTDIR)/lib
        mkdir -p $(DESTDIR)/include
        @(cd ./src/SFML && $(MAKE) $@)


as install target in ./Makefile

EDIT://
Laurent, another thing, would you consider
Code: [Select]
Index: libsfml/src/SFML/Makefile
===================================================================
--- libsfml.orig/src/SFML/Makefile 2008-11-01 22:36:36.000000000 +0100
+++ libsfml/src/SFML/Makefile 2008-11-01 22:45:17.000000000 +0100
@@ -56,4 +56,4 @@
  @(cd ./System && $(MAKE) $@ && cd ../Window && $(MAKE) $@ && cd ../Network && $(MAKE) $@ && cd ../Graphics && $(MAKE) $@ && cd ../Audio && $(MAKE) $@)
 
 install:
- @(cd ./System && $(MAKE) $@ && cd ../Window && $(MAKE) $@ && cd ../Network && $(MAKE) $@ && cd ../Graphics && $(MAKE) $@ && cd ../Audio && $(MAKE) $@ && $(CP) -r ../../../include/SFML/ /usr/include/)
+ @(cd ./System && $(MAKE) $@ && cd ../Window && $(MAKE) $@ && cd ../Network && $(MAKE) $@ && cd ../Graphics && $(MAKE) $@ && cd ../Audio && $(MAKE) $@ && $(CP) -r ../../../include/SFML/ $(DESTDIR)/include/)


to actually install the headers into destdir, too?

EDIT2://
DESTDIR includes usr/ for SFML too (instead of an extra PREFIX ;) so $(DESTDIR)/lib is enough for install target, had already changed it locally but copied wrong ;)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Error on linux x64
« Reply #11 on: November 01, 2008, 11:09:10 pm »
Sounds good, I'll try to apply these changes as soon as possible :)
Laurent Gomila - SFML developer

Agon

  • Newbie
  • *
  • Posts: 4
    • View Profile
Error on linux x64
« Reply #12 on: November 03, 2008, 05:21:18 pm »
Quote from: "Laurent"
Sounds good, I'll try to apply these changes as soon as possible :)

Are the patches included in the newest svn version? Does not seem to me.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Error on linux x64
« Reply #13 on: November 03, 2008, 09:21:39 pm »
No, when it's done I'll post a new message with something like "done" inside ;)
Laurent Gomila - SFML developer

 

anything