error: 'ABC' is not a member of ‘std’

20 posts / 0 new
Last post
jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
error: 'ABC' is not a member of ‘std’

Hi, i9 get whne crosscompiling c++ software (ZGloom):
...
hud.cpp:373:15: error: ‘to_string’ is not a member of ‘std’
pos += std::to_string(player.x.GetInt());
...

and with std::atoi, std::stoi too.

How can I "enable"/add std:: methods/functions?

1)Looking on internet I can change "to_string" to use a selfmade method/function.

2)Adding -std=c++11 doesn't solve anything.

TiA

EDIT1: solved part of the problem by compling x`c++ with clib2 (-mcrt=clib2), maybe using with newlib need some other args to add to compiler.
Now I "only" get this errors:
...
ppc-amigaos-g++ -gstabs -fpermissive -mcrt=clib2 -I/usr/local/amiga/ppc-amigaos/SDK/local/common/include -std=c++11 -c -o config.o config.cpp
config.cpp: In function ‘void Config::Init()’:
config.cpp:320:29: error: ‘stoi’ is not a member of ‘std’
configkeys = std::stoi(val);
...

EDIT2: solved stoi, by finding a replacement function (http://www.cplusplus.com/articles/D9j2Nwbp/), but linking pass fails, I assume 'cos the SDL2/.. objects are newlib and can't mix clib2 and newlib :-/
Do I need to add some "special" options/args to add to makefile to compile with c++ and newlib?

salass00
salass00's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2011-02-03 11:27
Re: error: 'ABC' is not a member of ‘std’

Try adding the following into a convenient header file:

  1. #ifdef __amigaos4__
  2. namespace std {
  3. using ::atoi;
  4.  
  5. template <typename T> string to_string(const T &n) {
  6. ostringstream strm;
  7. strm << n;
  8. return strm.str();
  9. }
  10.  
  11. inline int stoi(const string &str, size_t *idx = NULL, int base = 10) {
  12. const char *start = str.c_str();
  13. const char *end;
  14. int n;
  15.  
  16. n = ::strtol(start, (char **)&end, base);
  17.  
  18. if (idx != NULL)
  19. *idx = end - start;
  20.  
  21. return n;
  22. }
  23. }
  24. #endif

Newlib does have the atoi() function. It just needs to be added to the std:: namespace, which is what the "using ::atoi;" does.

The stoi() implementation is not 100% correct as it doesn't throw any exceptions but depending on how it's used it might be good enough.

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

thx already found to_string and stoi replacement, will try with yours ASAP.

BTW now I get all objects compiled, but on linkng it fails, maybe I missed some libs/la or I put them in incorrect place in compiler/linker paths, or I need to add some more link libraries to build.

snippet of error I get:
ppc-amigaos-g++ hud.o font.o quick.o monsterlogic.o config.o iffhandler.o renderer.o script.o decrunchmania.o titlescreen.o gloommap.o gloommaths.o gamelogic.o objectgraphics.o soundhandler.o zgloom.o binresource.o menuscreen.o -lSDL2 -lSDL2_mixer -lxmp -lpthread -o ZGloom
zgloom.o: In function `fill_audio(void*, unsigned char*, int)':
zgloom.cpp:59: undefined reference to `xmp_play_buffer'
zgloom.o: In function `main':
zgloom.cpp:260: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:265: undefined reference to `xmp_start_player'
zgloom.cpp:344: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:349: undefined reference to `xmp_start_player'
zgloom.cpp:368: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:373: undefined reference to `xmp_start_player'
zgloom.cpp:413: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:418: undefined reference to `xmp_start_player'
zgloom.cpp:433: undefined reference to `xmp_end_player'
zgloom.cpp:439: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:444: undefined reference to `xmp_start_player'
zgloom.cpp:481: undefined reference to `xmp_end_player'
zgloom.cpp:500: undefined reference to `xmp_end_player'
zgloom.cpp:510: undefined reference to `xmp_end_player'
zgloom.cpp:533: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:538: undefined reference to `xmp_start_player'
zgloom.cpp:588: undefined reference to `xmp_end_player'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_mixer.a(mixer.o): In function `Mix_LoadWAV_RW':
/home/Michael/SDL2_mixer-2.0.1/mixer.c:627: undefined reference to `SDL_LoadWAV_RW'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_mixer.a(dynamic_modplug.o): In function `Mix_InitModPlug':
/home/Michael/SDL2_mixer-2.0.1/dynamic_modplug.c:98: undefined reference to `ModPlug_Load'
/home/Michael/SDL2_mixer-2.0.1/dynamic_modplug.c:98: undefined reference to `ModPlug_Load'
/home/Michael/SDL2_mixer-2.0.1/dynamic_modplug.c:99: undefined reference to `ModPlug_Unload'
/home/Michael/SDL2_mixer-2.0.1/dynamic_modplug.c:99: undefined reference to `ModPlug_Unload'
...

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

Solved compiling erros, now it's linkng showing some erros, IIRC the "position" in the linking command of some libs are important (maybe some lib aren't used/needed, but....), suggestions are welcome. TiA .-)

snippet of errors:
#make
ppc-amigaos-g++ hud.o font.o quick.o monsterlogic.o config.o binresource.o iffhandler.o renderer.o script.o decrunchmania.o titlescreen.o gloommap.o soundhandler.o gloommaths.o gamelogic.o objectgraphics.o zgloom.o menuscreen.o -lSDL2main -lSDL2_mixer -lxmp -lmikmod -lmodplug -lFLAC -lsmpeg -lvorbisfile -lvorbis -logg -lstdc++ -lSDL2 -lpthread -o ZGloom
zgloom.o: In function `fill_audio(void*, unsigned char*, int)':
zgloom.cpp:59: undefined reference to `xmp_play_buffer'
zgloom.o: In function `main':
zgloom.cpp:260: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:265: undefined reference to `xmp_start_player'
zgloom.cpp:344: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:349: undefined reference to `xmp_start_player'
zgloom.cpp:368: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:373: undefined reference to `xmp_start_player'
zgloom.cpp:413: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:418: undefined reference to `xmp_start_player'
zgloom.cpp:433: undefined reference to `xmp_end_player'
zgloom.cpp:439: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:444: undefined reference to `xmp_start_player'
zgloom.cpp:481: undefined reference to `xmp_end_player'
zgloom.cpp:500: undefined reference to `xmp_end_player'
zgloom.cpp:510: undefined reference to `xmp_end_player'
zgloom.cpp:533: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:538: undefined reference to `xmp_start_player'
zgloom.cpp:588: undefined reference to `xmp_end_player'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::reset_stream()':
MPEGstream.cpp:(.text+0x880): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0x9ec): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::next_system_buffer()':
MPEGstream.cpp:(.text+0xb60): undefined reference to `SDL_mutexV'
MPEGstream.cpp:(.text+0xb98): undefined reference to `SDL_mutexP'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::next_packet(bool, bool)':
MPEGstream.cpp:(.text+0xd54): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0xd90): undefined reference to `SDL_mutexV'
MPEGstream.cpp:(.text+0xe5c): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::new_marker(int)':
MPEGstream.cpp:(.text+0xeb8): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0xedc): undefined reference to `SDL_mutexV'
MPEGstream.cpp:(.text+0xf64): undefined reference to `SDL_mutexV'
MPEGstream.cpp:(.text+0xfd8): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::seek_marker(MPEGstream_marker const*)':
MPEGstream.cpp:(.text+0x1030): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0x10cc): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::copy_data(unsigned char*, int, bool)':
MPEGstream.cpp:(.text+0x123c): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0x1338): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::garbage_collect()':
MPEGstream.cpp:(.text+0x1484): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0x1584): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::insert_packet(unsigned char*, unsigned int, double)':
MPEGstream.cpp:(.text+0x15ec): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0x16ac): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGsystem.o): In function `MPEGsystem::Read()':
MPEGsystem.cpp:(.text+0x1a64): undefined reference to `SDL_mutexP'
MPEGsystem.cpp:(.text+0x1acc): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x1ba4): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x1c80): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x1cd8): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x1cec): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGsystem.o): In function `MPEGsystem::TotalSize()':
MPEGsystem.cpp:(.text+0x1ea0): undefined reference to `SDL_mutexP'
MPEGsystem.cpp:(.text+0x1f58): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x201c): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x20e0): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x20fc): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGsystem.o): In function `MPEGsystem::TotalTime()':
MPEGsystem.cpp:(.text+0x2154): undefined reference to `SDL_mutexP'
MPEGsystem.cpp:(.text+0x220c): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x231c): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x25bc): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x29c4): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGsystem.o): In function `MPEGsystem::TimeElapsedAudio(int)':
MPEGsystem.cpp:(.text+0x2a40): undefined reference to `SDL_mutexP'
MPEGsystem.cpp:(.text+0x2af8): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x2bf8): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x2e90): undefined reference to `SDL_mutexV'
MPEGsystem.cpp:(.text+0x2eb4): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGsystem.o): In function `MPEGsystem::Seek(int)':
MPEGsystem.cpp:(.text+0x5504): undefined reference to `SDL_mutexP'
MPEGsystem.cpp:(.text+0x5664): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGvideo.o): In function `MPEGvideo::~MPEGvideo()':
MPEGvideo.cpp:(.text+0xc58): undefined reference to `SDL_FreeYUVOverlay'
/SDK/local/newlib/lib/libsmpeg.a(MPEGvideo.o): In function `MPEGvideo::~MPEGvideo()':
MPEGvideo.cpp:(.text+0xd28): undefined reference to `SDL_FreeYUVOverlay'
/SDK/local/newlib/lib/libsmpeg.a(MPEGvideo.o): In function `MPEGvideo::~MPEGvideo()':
MPEGvideo.cpp:(.text+0xdf8): undefined reference to `SDL_FreeYUVOverlay'
/SDK/local/newlib/lib/libsmpeg.a(MPEGvideo.o): In function `MPEGvideo::SetDisplay(SDL_Surface*, SDL_mutex*, void (*)(SDL_Surface*, int, int, unsigned int, unsigned int))':
MPEGvideo.cpp:(.text+0x12f4): undefined reference to `SDL_FreeYUVOverlay'
MPEGvideo.cpp:(.text+0x1328): undefined reference to `SDL_CreateYUVOverlay'
/SDK/local/newlib/lib/libsmpeg.a(MPEGvideo.o): In function `MPEGvideo::MoveDisplay(int, int)':
MPEGvideo.cpp:(.text+0x152c): undefined reference to `SDL_mutexP'
MPEGvideo.cpp:(.text+0x155c): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGvideo.o): In function `MPEGvideo::ScaleDisplayXY(int, int)':
MPEGvideo.cpp:(.text+0x15a4): undefined reference to `SDL_mutexP'
MPEGvideo.cpp:(.text+0x15d4): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGvideo.o): In function `MPEGvideo::SetDisplayRegion(int, int, int, int)':
MPEGvideo.cpp:(.text+0x1624): undefined reference to `SDL_mutexP'
MPEGvideo.cpp:(.text+0x1684): undefined reference to `SDL_FreeYUVOverlay'
MPEGvideo.cpp:(.text+0x16c0): undefined reference to `SDL_CreateYUVOverlay'
MPEGvideo.cpp:(.text+0x16dc): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(gdith.o): In function `MPEGvideo::DisplayFrame(vid_stream*)':
gdith.cpp:(.text+0x588): undefined reference to `SDL_mutexP'
gdith.cpp:(.text+0x598): undefined reference to `SDL_LockYUVOverlay'
gdith.cpp:(.text+0x8d4): undefined reference to `SDL_mutexP'
gdith.cpp:(.text+0x8f0): undefined reference to `SDL_DisplayYUVOverlay'
gdith.cpp:(.text+0x978): undefined reference to `SDL_UnlockYUVOverlay'
gdith.cpp:(.text+0x9d4): undefined reference to `SDL_mutexV'
gdith.cpp:(.text+0x9f4): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(gdith.o): In function `MPEGvideo::Filter(SMPEG_Filter*)':
gdith.cpp:(.text+0xab0): undefined reference to `SDL_mutexP'
gdith.cpp:(.text+0xadc): undefined reference to `SDL_mutexV'
/Devel/SDK/gcc/bin/../lib/gcc/ppc-amigaos/8.3.0/../../../libstdc++.a(eh_alloc.o): In function `__gnu_cxx::__mutex::lock()':
/var/lib/jenkins/workspace/native-gcc-8/native-build/gcc-native-build-8.3.0/ppc-amigaos/libstdc++-v3/include/ext/concurrence.h:150: undefined reference to `__gthread_active_p'
/Devel/SDK/gcc/bin/../lib/gcc/ppc-amigaos/8.3.0/../../../libstdc++.a(eh_alloc.o): In function `__gnu_cxx::__mutex::unlock()':
...

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

kas1e
kas1e's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2010-11-30 15:30
Re: error: 'ABC' is not a member of ‘std’

To get rid of gthread errors you need to build your objects and link the file with options "athread=native".

To get rif of most of SDL_* errors, you need correctly put SDL libs in place.

The one i dind't like its xmp_ errors, its like you didn't link wth libxmp library

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

Thx for the "-athread=native" tip. Now it only shows "1" error :-):
#make
ppc-amigaos-g++ hud.o font.o quick.o monsterlogic.o config.o binresource.o iffhandler.o renderer.o script.o decrunchmania.o titlescreen.o gloommap.o soundhandler.o gloommaths.o gamelogic.o objectgraphics.o zgloom.o menuscreen.o -athread=native -lSDL2main -lSDL2_mixer -lxmp -lmikmod -lmodplug -lFLAC -lsmpeg -lvorbisfile -lvorbis -logg -lSDL2 -lpthread -lstdc++ -o ZGloom
zgloom.o: In function `fill_audio(void*, unsigned char*, int)':
zgloom.cpp:59: undefined reference to `xmp_play_buffer'
zgloom.o: In function `main':
zgloom.cpp:260: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:265: undefined reference to `xmp_start_player'
zgloom.cpp:344: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:349: undefined reference to `xmp_start_player'
zgloom.cpp:368: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:373: undefined reference to `xmp_start_player'
zgloom.cpp:413: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:418: undefined reference to `xmp_start_player'
zgloom.cpp:433: undefined reference to `xmp_end_player'
zgloom.cpp:439: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:444: undefined reference to `xmp_start_player'
zgloom.cpp:481: undefined reference to `xmp_end_player'
zgloom.cpp:500: undefined reference to `xmp_end_player'
zgloom.cpp:510: undefined reference to `xmp_end_player'
zgloom.cpp:533: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:538: undefined reference to `xmp_start_player'
zgloom.cpp:588: undefined reference to `xmp_end_player'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::reset_stream()':
MPEGstream.cpp:(.text+0x880): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0x9ec): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::next_system_buffer()':
MPEGstream.cpp:(.text+0xb60): undefined reference to `SDL_mutexV'
MPEGstream.cpp:(.text+0xb98): undefined reference to `SDL_mutexP'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::next_packet(bool, bool)':
MPEGstream.cpp:(.text+0xd54): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0xd90): undefined reference to `SDL_mutexV'
MPEGstream.cpp:(.text+0xe5c): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(MPEGstream.o): In function `MPEGstream::new_marker(int)':
MPEGstream.cpp:(.text+0xeb8): undefined reference to `SDL_mutexP'
MPEGstream.cpp:(.text+0xedc): undefined reference to `SDL_mutexV'
MPEGstream.cpp:(.text+0xf64): undefined reference to `SDL_mutexV'
MPEGstream.cpp:(.text+0xfd8): undefined reference to `SDL_mutexV'
...
MPEGvideo.cpp:(.text+0x1624): undefined reference to `SDL_mutexP'
MPEGvideo.cpp:(.text+0x1684): undefined reference to `SDL_FreeYUVOverlay'
MPEGvideo.cpp:(.text+0x16c0): undefined reference to `SDL_CreateYUVOverlay'
MPEGvideo.cpp:(.text+0x16dc): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(gdith.o): In function `MPEGvideo::DisplayFrame(vid_stream*)':
gdith.cpp:(.text+0x588): undefined reference to `SDL_mutexP'
gdith.cpp:(.text+0x598): undefined reference to `SDL_LockYUVOverlay'
gdith.cpp:(.text+0x8d4): undefined reference to `SDL_mutexP'
gdith.cpp:(.text+0x8f0): undefined reference to `SDL_DisplayYUVOverlay'
gdith.cpp:(.text+0x978): undefined reference to `SDL_UnlockYUVOverlay'
gdith.cpp:(.text+0x9d4): undefined reference to `SDL_mutexV'
gdith.cpp:(.text+0x9f4): undefined reference to `SDL_mutexV'
/SDK/local/newlib/lib/libsmpeg.a(gdith.o): In function `MPEGvideo::Filter(SMPEG_Filter*)':
gdith.cpp:(.text+0xab0): undefined reference to `SDL_mutexP'
gdith.cpp:(.text+0xadc): undefined reference to `SDL_mutexV'
make: *** [ZGloom] Error 1
...
Yes I guess is the dependices between lib, that I need to put in correct order, any clues?

the xmp lib I got from os4depot xmp.lha, maybe is not enught, or I missed some files to add to my sdk.

THX

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

Me was linking libsmpeg and it shoudb be libsmpg2. now I need to fix the XMP error "only" :-)

#make
ppc-amigaos-g++ hud.o font.o quick.o monsterlogic.o config.o binresource.o iffhandler.o renderer.o script.o decrunchmania.o titlescreen.o gloommap.o soundhandler.o gloommaths.o gamelogic.o objectgraphics.o zgloom.o menuscreen.o -athread=native -lSDL2main -lSDL2_mixer -lxmp -lmikmod -lmodplug -lFLAC -lsmpeg2 -lvorbisfile -lvorbis -logg -lSDL2 -lpthread -lstdc++ -o ZGloom
zgloom.o: In function `fill_audio(void*, unsigned char*, int)':
zgloom.cpp:59: undefined reference to `xmp_play_buffer'
zgloom.o: In function `main':
zgloom.cpp:260: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:265: undefined reference to `xmp_start_player'
zgloom.cpp:344: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:349: undefined reference to `xmp_start_player'
zgloom.cpp:368: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:373: undefined reference to `xmp_start_player'
zgloom.cpp:413: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:418: undefined reference to `xmp_start_player'
zgloom.cpp:433: undefined reference to `xmp_end_player'
zgloom.cpp:439: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:444: undefined reference to `xmp_start_player'
zgloom.cpp:481: undefined reference to `xmp_end_player'
zgloom.cpp:500: undefined reference to `xmp_end_player'
zgloom.cpp:510: undefined reference to `xmp_end_player'
zgloom.cpp:533: undefined reference to `xmp_load_module_from_memory'
zgloom.cpp:538: undefined reference to `xmp_start_player'
zgloom.cpp:588: undefined reference to `xmp_end_player'
make: *** [ZGloom] Error 1
#

EDIT1: maybe the xmp port I use/have is too old or different as if doesn't have such fucbntions/methods :-/
The one I use/have it has:
EXPORT xmp_context xmp_create_context (void);
EXPORT int xmp_test_module (char *, struct xmp_test_info *);
EXPORT void xmp_free_context (xmp_context);
EXPORT int xmp_load_module (xmp_context, char *);
EXPORT void xmp_release_module (xmp_context);
EXPORT int xmp_player_start (xmp_context, int, int);
EXPORT int xmp_player_frame (xmp_context);
EXPORT void xmp_player_get_info (xmp_context, struct xmp_module_info *);
EXPORT void xmp_player_end (xmp_context);
EXPORT void xmp_inject_event (xmp_context, int, struct xmp_event *);
EXPORT char **xmp_get_format_list (void);
EXPORT int xmp_control (xmp_context, int, ...);

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

kas1e
kas1e's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2010-11-30 15:30
Re: error: 'ABC' is not a member of ‘std’

It can be that our libxml on os4depot is old one and didn't have those functions ? You need to check in includes from os4depot archve, if you have there those functions (just search over all libxml includes inside of archive). And if not, try to download latest version of libxml and check if it have there. And if yes, then it mean those functions are new ones, and need to port new version of libxmp. But if we have them in os4depot archve, then something else wrong.

Or maybe those functions are come from game itself , in some other object file which you forget to link with ?

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

its xmP (audo replayer) not xmL :-)

BIG THX to salass00 and kas1e!!!!

Anyway I "commented" out all audio stuff and....
http://jabirulo.byethost13.com/temp/zgloom_debug.7z
http://jabirulo.byethost13.com/temp/zgloom_stripped.7z

You need data files (free):
https://github.com/earok/GloomAmiga/archive/master.zip

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

kas1e
kas1e's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2010-11-30 15:30
Re: error: 'ABC' is not a member of ‘std’

Yeah, I mean XMP above, of course, XML was just a typo.

It looks like general XMP functions, strange that you have ufdef on linking. Games without audio are of no fun :)

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

:-)

BTW how "difficult" would be to add to zgloom (uses SDL2) to add openGL, just to use gfx card to resize window/gfx.
Would it require a total overhaul of the surces or just "changing" a couple of functions/methods?

TiA

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

salass00
salass00's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2011-02-03 11:27
Re: error: 'ABC' is not a member of ‘std’

The source code for XMP is available at:

http://xmp.sourceforge.net/

if you want to have a go at compiling it yourself.

All of the AmigaOS specific changes should be included there (IIRC) so it should only be a matter of doing a standard ./configure and make.

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

thx, downloaded, but there isa no confgure script to launch :-(
Will try to copy an existiing Makefile and change to use on amigaos4

OK using as "template" libSDL2 makefile and libXMP Makefile I created:

  1. CC = ppc-amigaos-gcc
  2. #CFLAGS = -O2 -Iinclude -Isrc -Dinline=__inline -DPATH_MAX=1024 -D_USE_MATH_DEFINES
  3. CFLAGS = -gstabs -O2 -Wall -Iinclude -Isrc -D__USE_INLINE__ -fPIC -DPATH_MAX=1024 -D_USE_MATH_DEFINES
  4. AR = ppc-amigaos-ar
  5. RANLIB = ppc-amigaos-ranlib
  6.  
  7. TARGET_STATIC = libxmp.a
  8. TARGET_SHARED = libxmp.so
  9.  
  10. OBJS = src/virtual.o src/format.o src/period.o src/player.o src/read_event.o src/dataio.o \
  11. src/mkstemp.o src/fnmatch.o src/md5.o src/lfo.o src/scan.o src/control.o src/med_extras.o \
  12. src/filter.o src/effects.o src/mixer.o src/mix_all.o src/load_helpers.o src/load.o src/hio.o \
  13. ...
  14. src/depackers/oxm.o src/depackers/vorbis.o src/depackers/crc32.o src/depackers/xfd_link.o
  15.  
  16. .c: .o
  17. $(CC) -c $(CFLAGS) -o $^@ $<
  18.  
  19. all: $(TARGET_STATIC) $(TARGET_SHARED)
  20.  
  21. $(TARGET_STATIC): $(OBJS)
  22. $(AR) crv $@ $^
  23. $(RANLIB) $@
  24.  
  25. $(TARGET_SHARED): $(OBJECTS) $(VERSION_OBJECT)
  26. $(CC) -shared -Wl,-soname,$(TARGET_SHARED) -o $(TARGET_SHARED) $(OBJS)
  27.  
  28. clean:
  29. rm $(OBJS) $(TARGET_STATIC) $(TARGET_SHARED)

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

kas1e
kas1e's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2010-11-30 15:30
Re: error: 'ABC' is not a member of ‘std’

When there no ./configure script to launch, it mean you need to run "autogen.sh" firstly. It will create configure , then run configure, something like this:

  1. ./autogen.sh
  2.  
  3. ./configure --build=x86_64 --host=ppc-amigaos --target=ppc-amigaos --enable-static --disable-shared

And if all fine then Make. But you surely need to change some thing in xmp library to build amigaos4 version properly. If i remember right it not just ./configure ; make.

I think you maybe wrong install libxmp from os4depot ? I mean, maybe you tried to link with clib2 version of stub lib ? It can't be that standard basic xmp functions undefined.

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

There is no autogen.sh script niether :-(

  1. Usuario@NS50 /amiga/libxmp
  2. $ ls
  3. config.guess include Makefile.vc test-dev
  4. config.sub INSTALL Makefile.in Makefile.vc.in
  5. configure.ac install-sh Makefile.lite README vc
  6. docs jni Makefile.os2 src
  7. examples lite Makefile.os2.in test

the original libxmp I got from os4depot is the one from xmp.lha archive, and seems too old for ZGloom, as it uses functions/methods not available on os4depot's libxmp.
I need libxmp XMP_VERSION "4.5.0".
ZGloom uses (apart others) those functions, non existant on os4depot libxmp:
xmp_load_module_from_memory (xmp_context, void *, long);
xmp_load_module_from_file (xmp_context, void *, long);

EDIT1: ok, maybe I was downloading from bad site, (re)trying with XMP 4.4.1, hope this one works.

THX for all help.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

kas1e
kas1e's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2010-11-30 15:30
Re: error: 'ABC' is not a member of ‘std’

If no autogen.sh, and no ./configure, then:

aclocal --force
autoconf -f
autoheader -f
automake -a -c -f

And you will have them.

Or, you can take for example any other Makefile (as i see you have Makefile.os2), copy it to Makefile_os4, and just replace there manually things. And then run make -f Makefile_os4

salass00
salass00's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2011-02-03 11:27
Re: error: 'ABC' is not a member of ‘std’

You should be able to generate the configure script from configure.ac using autoconf or something like that, but if you download one of the release archives you don't have to:

https://sourceforge.net/projects/xmp/files/libxmp/4.4.1/

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

yes, you're right. dowloaded such version and I'm tryng to compile static & shared versions of libxmp.

thx for tips/suggestions, will post results ASAP

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: error: 'ABC' is not a member of ‘std’

ok, V4.4.1 libxmp.a using crosscompiler went fine :-)

But when linking to ZGloom I get:

  1. ppc-amigaos-g++ hud.o font.o objectgraphics.o quick.o monsterlogic.o config.o iffhandler.o renderer.o menuscreen.o script.o decrunchmania.o gloommap.o gloommaths.o gamelogic.o soundhandler.o titlescreen.o zgloom.o binresource.o -athread=native -lSDL2_mixer -lxmp -lmikmod -lmodplug -lFLAC -lsmpeg2 -lvorbisfile -lvorbis -logg -lSDL2 -lpthread -o ZGloom.debug
  2. /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libxmp.a(xfd.o): In function `close_xfd':
  3. /amiga/libxmp-4.4.1/src/depackers/xfd.c:57: undefined reference to `IxfdMaster'
  4. /amiga/libxmp-4.4.1/src/depackers/xfd.c:57: undefined reference to `IxfdMaster'
  5. /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libxmp.a(xfd.o): In function `open_xfd':
  6. /amiga/libxmp-4.4.1/src/depackers/xfd.c:44: undefined reference to `IxfdMaster'
  7. /amiga/libxmp-4.4.1/src/depackers/xfd.c:44: undefined reference to `IxfdMaster'
  8. /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libxmp.a(xfd.o): In function `decrunch_xfd':
  9. /amiga/libxmp-4.4.1/src/depackers/xfd.c:129: undefined reference to `IxfdMaster'
  10. /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libxmp.a(xfd.o):/amiga/libxmp-4.4.1/src/depackers/xfd.c:129: more undefined references to `IxfdMaster' follow
  11. collect2: error: ld returned 1 exit status
  12. make: *** [Makefile:22: ZGloom.debug] Error 1

Looks like it needs lixfdmaster.a, but I decided to go to "dirty" way, disabled XFD on XMP, recompiled lbxmp.a again and when linking to ZGloom no problem :-) not "correct way" to do, but will test it ASAP.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

kas1e
kas1e's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2010-11-30 15:30
Re: error: 'ABC' is not a member of ‘std’

It seems that libxmp.a you build, was build with some inclues from xfd, or linked with them somehow. I assume pure libxml know nothing about xfdmaster from amiga, so it seems you maybe applied some amiga specific changes, or use old includes.

Anyway, as you do its not dirty way, its right way : when you build some game which need support of some type of music, to make size of binary smaller you can strip off all the other formats from music libraries you build.

For example, when need it i build lib_mixer, lib_modplug and lib_xmp with minimal set of support i need for game of choice, and then size of binary smaller.

Log in or register to post comments