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

Author Topic: Compiling the graphics.lib  (Read 5170 times)

0 Members and 3 Guests are viewing this topic.

MaxKielland

  • Newbie
  • *
  • Posts: 6
    • View Profile
Compiling the graphics.lib
« on: May 18, 2014, 05:17:01 pm »
Hi,

I'm re-compiling the lib and dll with bcc32 (Borland/embarcadero C++ Builder compiler). When building GLCheck.cpp I get a number of errors regarding multiple declarations.

bcc32 command line for "..\src\SFML\Graphics\GLCheck.cpp"
..\src\SFML\Graphics\GLCheck.cpp
[bcc32 Error] _stddef.h(178): Multiple declaration for 'ptrdiff_t'
[bcc32 Error] glew.h(156): Earlier declaration of 'ptrdiff_t'
[bcc32 Error] iosfwd(385): Multiple declaration for 'char_traits<wchar_t>::int_type'
[bcc32 Error] iosfwd(136): Earlier declaration of 'char_traits<wchar_t>::int_type'
[bcc32 Error] iosfwd(391): Multiple declaration for 'char_traits<wchar_t>::assign(wchar_t &,const wchar_t &)'
[bcc32 Error] iosfwd(141): Earlier declaration of 'char_traits<wchar_t>::assign(wchar_t &,const wchar_t &)'
[bcc32 Error] iosfwd(396): Multiple declaration for 'char_traits<wchar_t>::eq(const wchar_t &,const wchar_t &)'
[bcc32 Error] iosfwd(146): Earlier declaration of 'char_traits<wchar_t>::eq(const wchar_t &,const wchar_t &)'
[bcc32 Error] iosfwd(401): Multiple declaration for 'char_traits<wchar_t>::lt(const wchar_t &,const wchar_t &)'
[bcc32 Error] iosfwd(151): Earlier declaration of 'char_traits<wchar_t>::lt(const wchar_t &,const wchar_t &)'
[bcc32 Error] iosfwd(407): Multiple declaration for 'char_traits<wchar_t>::compare(const wchar_t *,const wchar_t *,unsigned int)'
[bcc32 Error] iosfwd(156): Earlier declaration of 'char_traits<wchar_t>::compare(const wchar_t *,const wchar_t *,unsigned int)'
[bcc32 Error] iosfwd(414): Multiple declaration for 'char_traits<wchar_t>::length(const wchar_t *)'
[bcc32 Error] iosfwd(167): Earlier declaration of 'char_traits<wchar_t>::length(const wchar_t *)'
[bcc32 Error] iosfwd(421): Multiple declaration for 'char_traits<wchar_t>::copy(wchar_t *,const wchar_t *,unsigned int)'
[bcc32 Error] iosfwd(176): Earlier declaration of 'char_traits<wchar_t>::copy(wchar_t *,const wchar_t *,unsigned int)'
[bcc32 Error] iosfwd(429): Multiple declaration for 'char_traits<wchar_t>::find(const wchar_t *,unsigned int,const wchar_t &)'
[bcc32 Error] iosfwd(187): Earlier declaration of 'char_traits<wchar_t>::find(const wchar_t *,unsigned int,const wchar_t &)'
[bcc32 Error] iosfwd(436): Multiple declaration for 'char_traits<wchar_t>::move(wchar_t *,const wchar_t *,unsigned int)'
[bcc32 Error] iosfwd(197): Earlier declaration of 'char_traits<wchar_t>::move(wchar_t *,const wchar_t *,unsigned int)'
[bcc32 Error] iosfwd(443): Multiple declaration for 'char_traits<wchar_t>::assign(wchar_t *,unsigned int,wchar_t)'
[bcc32 Error] iosfwd(212): Earlier declaration of 'char_traits<wchar_t>::assign(wchar_t *,unsigned int,wchar_t)'
[bcc32 Error] iosfwd(454): Multiple declaration for 'char_traits<wchar_t>::to_int_type(const wchar_t &)'
[bcc32 Error] iosfwd(227): Earlier declaration of 'char_traits<wchar_t>::to_int_type(const wchar_t &)'
[bcc32 Error] iosfwd(465): Multiple declaration for 'char_traits<wchar_t>::eof()'
[bcc32 Error] iosfwd(238): Earlier declaration of 'char_traits<wchar_t>::eof()'
[bcc32 Error] iosfwd(486): Multiple declaration for 'char_traits<char>::assign(char &,const char &)'
[bcc32 Error] iosfwd(141): Earlier declaration of 'char_traits<char>::assign(char &,const char &)'
[bcc32 Error] iosfwd(491): Multiple declaration for 'char_traits<char>::eq(const char &,const char &)'
[bcc32 Error] iosfwd(146): Earlier declaration of 'char_traits<char>::eq(const char &,const char &)'
[bcc32 Error] iosfwd(496): Multiple declaration for 'char_traits<char>::lt(const char &,const char &)'
[bcc32 Error] iosfwd(151): Earlier declaration of 'char_traits<char>::lt(const char &,const char &)'
[bcc32 Error] iosfwd(502): Multiple declaration for 'char_traits<char>::compare(const char *,const char *,unsigned int)'
[bcc32 Error] iosfwd(156): Earlier declaration of 'char_traits<char>::compare(const char *,const char *,unsigned int)'
[bcc32 Error] iosfwd(509): Multiple declaration for 'char_traits<char>::length(const char *)'
[bcc32 Error] iosfwd(167): Earlier declaration of 'char_traits<char>::length(const char *)'
[bcc32 Error] iosfwd(516): Multiple declaration for 'char_traits<char>::copy(char *,const char *,unsigned int)'
[bcc32 Error] iosfwd(176): Earlier declaration of 'char_traits<char>::copy(char *,const char *,unsigned int)'
[bcc32 Error] iosfwd(524): Multiple declaration for 'char_traits<char>::find(const char *,unsigned int,const char &)'
[bcc32 Error] iosfwd(187): Earlier declaration of 'char_traits<char>::find(const char *,unsigned int,const char &)'
[bcc32 Error] iosfwd(531): Multiple declaration for 'char_traits<char>::move(char *,const char *,unsigned int)'
[bcc32 Error] iosfwd(197): Earlier declaration of 'char_traits<char>::move(char *,const char *,unsigned int)'
[bcc32 Error] iosfwd(538): Multiple declaration for 'char_traits<char>::assign(char *,unsigned int,char)'
[bcc32 Error] iosfwd(212): Earlier declaration of 'char_traits<char>::assign(char *,unsigned int,char)'
[bcc32 Error] iosfwd(549): Multiple declaration for 'char_traits<char>::to_int_type(const char &)'
[bcc32 Error] iosfwd(227): Earlier declaration of 'char_traits<char>::to_int_type(const char &)'
[bcc32 Error] iosfwd(560): Multiple declaration for 'char_traits<char>::eof()'
[bcc32 Error] iosfwd(238): Earlier declaration of 'char_traits<char>::eof()'
[bcc32 Error] xutility(346): Dependent type qualifier 'bool' is not a class or struct type
[bcc32 Error] xutility(347): Dependent type qualifier 'bool' is not a class or struct type
[bcc32 Error] xutility(347): Too many error or warning messages
Failed
Elapsed time: 00:00:00.4
« Last Edit: May 18, 2014, 05:58:12 pm by MaxKielland »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Compiling the graphics.lib
« Reply #1 on: May 18, 2014, 05:26:43 pm »
How old is that compiler?  ???

You'd better switch to a compiler created after Paleolithic Era...
SFML / OS X developer

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Compiling the graphics.lib
« Reply #2 on: May 18, 2014, 05:27:52 pm »
The Borland compiler is kind of ancient so it may just be too out of date to compile anything written in C++98 (as you can see, most of those errors are for standard library types/functions).  Have you tried GCC or Visual Studio?

Also, you seem to have left your post unfinished.

MaxKielland

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Compiling the graphics.lib
« Reply #3 on: May 18, 2014, 05:57:55 pm »
Sorry the question wasn't edited right. That last unfinished part can be ignored.

Well, Bcc32 has actually evolved with each version of C++ Builder. I'm using C++ Builder XE5 from 2013 with C++11 support. GCC or Visual Studio will not do the job because they will produce lib files incompatible with C++ Builder.

After some more researching I found that if I declare ___STDDEF_H_USING_LIST the error disappear. I'm not sure, but it seems to be something in the C++ Builder implementation of the keyword using.

Any suggestions on where I should put the definition?
#define ___STDDEF_H_USING_LIST

Is there some configuration file where I can add "support" for C++ Builder?
« Last Edit: May 18, 2014, 06:22:28 pm by MaxKielland »

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Compiling the graphics.lib
« Reply #4 on: May 18, 2014, 06:18:43 pm »
Those would be the CMakeLists files that tell CMake how to generate make/project files for various compilers and IDEs, and maybe a few headers like Config.hpp.  I've never heard of C++ Builder so I dunno if the SFML team would want to add support for it, but feel free to try adding it yourself.
« Last Edit: May 18, 2014, 06:21:48 pm by Ixrec »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Compiling the graphics.lib
« Reply #5 on: May 18, 2014, 06:25:47 pm »
Before adding random stuff to SFML config files to make it work with this compiler, you'd better understand the bug, and why this macro solved the problem ;)
Laurent Gomila - SFML developer

MaxKielland

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Compiling the graphics.lib
« Reply #6 on: May 18, 2014, 06:50:07 pm »
Before adding random stuff to SFML config files to make it work with this compiler, you'd better understand the bug, and why this macro solved the problem ;)

Well I didn't add any "random" code. I'm detecting the C++ Builder compiler and make adjustments accordingly.

#ifdef __BCPLUSPLUS__
    #define ___STDDEF_H_USING_LIST
#endif


I could enter this in the project file instead, but then no one will see that this is actually done, unless they go into the project's properties and specifically look under "Conditional defines".

C++ Builder has always been a bit awkward when it comes to MSVC compatibility, so I'm not surprised if the keyword using is causing some problems.

But of course, it would be good to get this confirmed...
« Last Edit: May 18, 2014, 06:51:50 pm by MaxKielland »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Compiling the graphics.lib
« Reply #7 on: May 18, 2014, 08:06:25 pm »
I don't know if there are any legal implications, but if you can somehow show us/me the contents of those files (_stddef.h, iosfwd and xutility), I can probably figure out which defines are not set properly that would cause these issues.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

MaxKielland

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Compiling the graphics.lib
« Reply #8 on: May 18, 2014, 11:50:13 pm »
I don't know if there are any legal implications, but if you can somehow show us/me the contents of those files (_stddef.h, iosfwd and xutility), I can probably figure out which defines are not set properly that would cause these issues.

It is the source from http://www.sfml-dev.org/download/sfml/2.1/SFML-2.1-sources.zip I have not modified it, only created a lib project in C++ Builder, added the files and paths I found in CMake.txt and hit Build.

Actually it was enough to just build GLCheck.cpp to get the error.

For those who never heard about C++ Builder, have a look here or here. It is a cross development platform for Windows, Mac, iOS, Android and Google glass. Rumors say that Linux support is in the pipe.

I can send you my C++ Builder project file if it would be of any use to you.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Compiling the graphics.lib
« Reply #9 on: May 19, 2014, 12:50:50 am »
He's asking for the _stddef.h, iosfwd and xutility headers that C++ Builder itself provides and uses.  Every compiler has to provide its own copy of standard headers like these in order for programs to include and link against standard C++ library functions.  They won't be in SFML or any single C++ Builder project.  I assume they'd be somewhere in C++ Builder's install path.

MaxKielland

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Compiling the graphics.lib
« Reply #10 on: May 20, 2014, 12:59:27 am »
Alright sorry for that :o
Here are the requested embarcadero (Borland) files.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Compiling the graphics.lib
« Reply #11 on: May 20, 2014, 02:55:01 am »
I had a look at those files. Either they don't conform to standard conventions or the compiler is just doing something really wrong. No idea how to fix this. You should consider switching to another compiler if you can afford it.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

MaxKielland

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Compiling the graphics.lib
« Reply #12 on: May 20, 2014, 05:41:39 am »
Thank you for trying. I will see if I can get this to work somehow...