Problems building Panda3D on FreeBSD

Hi,

I am trying to build Panda3D on FreeBSD after having installed it successfully on Windows, Mac OS X and Linux.

So far on FreeBSD, I installed gcc49 and had to link the g++ and gcc names to refer to clang++ and gcc49. Now I am getting the following compile errors.

[  8%] Building C++ object built/tmp/p3downloader_composite2.o
In file included from panda/src/downloader/p3downloader_composite2.cxx:6:
panda/src/downloader/httpDate.cxx:226:21: error: redefinition of 'timezone' as different kind of symbol
    extern long int timezone;
                    ^
/usr/include/time.h:193:7: note: previous definition is here
char *timezone(int, int);       /* XXX XSI conflict */
      ^
In file included from panda/src/downloader/p3downloader_composite2.cxx:6:
panda/src/downloader/httpDate.cxx:227:11: error: invalid operands to binary expression ('time_t' (aka 'long') and
      'char *(*)(int, int)')
    _time -= timezone;
    ~~~~~ ^  ~~~~~~~~
2 errors generated.
Storing dependency cache.
Elapsed Time: 1 min 36 sec
The following command returned a non-zero value: g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3downloader_composite2.o -Ibuilt/tmp -Ibuilt/include -I/usr/local/include/python2.7 -I/usr/local/include -DMAKEPANDA= -Ipanda/src/downloader -pthread -msse2 -O2 -DBUILDING_PANDAEXPRESS panda/src/downloader/p3downloader_composite2.cxx
Build terminated.
$ pwd
/usr/home/erik/Downloads/panda3d-1.8.1
$ uname -a
FreeBSD freebsd 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
$ 

Should I try more recent code from 1.9 or is there some easy way around this?

Thanks,
Erik

Hi, welcome to the forums!

deflected recently checked in fixes for this. Did you grab the latest version of the source from GitHub?

Thanks for the advice. I will get the latest code and let you know the result.

I tried getting the latest from git and doing the build.

I got quite a bit farther. Previously it bombed out around 8%, and this time it got as far as 38%.

This one seems like I haven’t installed something important, possibly related to dates and times. Here is part of the build output – I clipped out most of the stuff in the middle.

$ python makepanda/makepanda.py --everything
rpm: not found
rpm: not found
WARNING: Could not locate pkg-config package eigen3, excluding from build
WARNING: Could not locate thirdparty package artoolkit, excluding from build
WARNING: Could not locate thirdparty package fcollada, excluding from build
WARNING: Could not locate thirdparty package fmodex, excluding from build
WARNING: Could not locate thirdparty package freetype, excluding from build
WARNING: Could not locate thirdparty package gles, excluding from build
WARNING: Could not locate thirdparty package nvidiacg, excluding from build
WARNING: Could not locate thirdparty package opencv, excluding from build
WARNING: Could not locate thirdparty package vrpn, excluding from build
WARNING: Could not locate thirdparty package rocket, excluding from build
WARNING: Could not locate pkg-config package gtk+-2.0, excluding from build
Generating dependencies...
[  0%] Building C++ object built/tmp/p3dtoolbase_composite1.o
[  0%] Building C++ object built/tmp/p3dtoolbase_composite2.o
[  0%] Building C object built/tmp/p3dtoolbase_lookup3.o.
.
.
.
[ 38%] Building C++ object built/tmp/pandafx_pandafx.o
[ 38%] Linking dynamic library built/lib/libpandafx.so
[ 38%] Building Interrogate object built/tmp/fx_module.o
Referencing Library libp3distort
[ 38%] Linking dynamic library built/panda3d/fx.so
[ 38%] Building C++ object built/tmp/p3ffmpeg_composite1.o
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:18:
In file included from /usr/include/c++/v1/mutex:176:
In file included from /usr/include/c++/v1/__mutex_base:15:
In file included from /usr/include/c++/v1/chrono:279:
/usr/include/c++/v1/ctime:60:9: error: no member named 'clock' in the global namespace
using ::clock;
      ~~^
/usr/include/c++/v1/ctime:61:9: error: no member named 'difftime' in the global namespace
using ::difftime;
      ~~^
/usr/include/c++/v1/ctime:62:9: error: no member named 'mktime' in the global namespace; did you mean
      'mktemp'?
using ::mktime;
      ~~^
/usr/include/unistd.h:532:7: note: 'mktemp' declared here
char    *mktemp(char *);
         ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:18:
In file included from /usr/include/c++/v1/mutex:176:
In file included from /usr/include/c++/v1/__mutex_base:15:
In file included from /usr/include/c++/v1/chrono:279:
/usr/include/c++/v1/ctime:63:9: error: no member named 'time' in the global namespace
using ::time;
      ~~^
/usr/include/c++/v1/ctime:64:9: error: no member named 'asctime' in the global namespace; did you mean
      'adjtime'?
using ::asctime;
      ~~^
/usr/include/sys/time.h:481:5: note: 'adjtime' declared here
int     adjtime(const struct timeval *, struct timeval *);
        ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:18:
In file included from /usr/include/c++/v1/mutex:176:
In file included from /usr/include/c++/v1/__mutex_base:15:
In file included from /usr/include/c++/v1/chrono:279:
/usr/include/c++/v1/ctime:65:9: error: no member named 'ctime' in the global namespace
using ::ctime;
      ~~^
/usr/include/c++/v1/ctime:66:9: error: no member named 'gmtime' in the global namespace
using ::gmtime;
      ~~^
/usr/include/c++/v1/ctime:67:9: error: no member named 'localtime' in the global namespace
using ::localtime;
      ~~^
/usr/include/c++/v1/ctime:68:9: error: no member named 'strftime' in the global namespace
using ::strftime;
      ~~^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2359:27: error: member access into incomplete type 'tm'
    __get_weekdayname(__tm->tm_wday, __b, __e, __err, __ct);
                          ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2371:25: error: member access into incomplete type 'tm'
    __get_monthname(__tm->tm_mon, __b, __e, __err, __ct);
                        ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2383:20: error: member access into incomplete type 'tm'
    __get_year(__tm->tm_year, __b, __e, __err, __ct);
                   ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2400:31: error: member access into incomplete type 'tm'
        __get_weekdayname(__tm->tm_wday, __b, __e, __err, __ct);
                              ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2405:29: error: member access into incomplete type 'tm'
        __get_monthname(__tm->tm_mon, __b, __e, __err, __ct);
                            ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2415:23: error: member access into incomplete type 'tm'
        __get_day(__tm->tm_mday, __b, __e, __err, __ct);
                      ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2430:24: error: member access into incomplete type 'tm'
        __get_hour(__tm->tm_hour, __b, __e, __err, __ct);
                       ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2433:27: error: member access into incomplete type 'tm'
        __get_12_hour(__tm->tm_hour, __b, __e, __err, __ct);
                          ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2436:32: error: member access into incomplete type 'tm'
        __get_day_year_num(__tm->tm_yday, __b, __e, __err, __ct);
                               ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
In file included from panda/src/ffmpeg/p3ffmpeg_composite1.cxx:1:
In file included from panda/src/ffmpeg/config_ffmpeg.cxx:15:
In file included from panda/src/ffmpeg/config_ffmpeg.h:18:
In file included from built/include/pandabase.h:22:
In file included from built/include/dtoolbase.h:431:
In file included from built/include/dtoolbase_cc.h:59:
In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:133:
/usr/include/c++/v1/locale:2439:25: error: member access into incomplete type 'tm'
        __get_month(__tm->tm_mon, __b, __e, __err, __ct);
                        ^
/usr/include/wchar.h:102:8: note: forward declaration of 'tm'
struct tm;
       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Storing dependency cache.
Elapsed Time: 29 min 58 sec
The following command returned a non-zero value: g++ -ftemplate-depth-50 -fPIC -c -o built/tmp/p3ffmpeg_composite1.o -Ibuilt/tmp -Ibuilt/include -I/usr/local/include/python2.7 -I/usr/local/include -I/usr/local/include/libavformat -I/usr/local/include/libavcodec -I/usr/local/include/libavutil -I/usr/local/include/libswscale -I/usr/local/include/libswresample -Ipanda/src/ffmpeg -pthread -fno-exceptions -msse2 -ffast-math -fno-finite-math-only -O2 -DBUILDING_FFMPEG panda/src/ffmpeg/p3ffmpeg_composite1.cxx
Build terminated.
$ 

Still would love to get help figuring this out.

Thanks,
Erik

I don’t think this is an issue with missing a package; these functions seem to be part of the standard C library. Instead, perhaps we’re missing an #include statement somewhere, perhaps of time.h. It’s odd that it only happens in the ffmpeg code, though, which makes me suspect something from the ffmpeg headers is causing issues with something from Panda’s headers.

If you don’t strictly need ffmpeg support (if you only plan to play .ogg vorbis or .wav files with Panda, you don’t need ffmpeg) you can add --no-ffmpeg to the makepanda command line to skip ffmpeg support.