Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
32 user(s) are online (18 user(s) are browsing Forums)

Members: 1
Guests: 31

daveyw, more...

Support us!

Headlines

 
  Register To Post  

« 1 ... 46 47 48 (49) 50 51 52 ... 74 »
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
@kas1e @capehill

I am still trying to learn C, SDL and AmigaOS4 SDK, so I will be doing strange things :)

But when I don't use -lphtread, I receive following errors:

ppc-amigaos-g++ -athread=native 10_color_keying.cpp -o 10_SDL -lSDL2 -lSDL2_image -ljpeg -lpng -ltiff -lwebp -lz
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(libwebpdsp_la-alpha_processing.o): In function `WebPInitAlphaProcessing':
/home/Michael/libwebp-1.0.3/src/dsp/alpha_processing.c:412: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/dsp/alpha_processing.c:412: undefined reference to `pthread_mutex_unlock'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(libwebpdsp_la-dec.o): In function `VP8DspInit':
/home/Michael/libwebp-1.0.3/src/dsp/dec.c:744: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/dsp/dec.c:744: undefined reference to `pthread_mutex_unlock'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(libwebpdsp_la-filters.o): In function `VP8FiltersInit':
/home/Michael/libwebp-1.0.3/src/dsp/filters.c:241: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/dsp/filters.c:241: undefined reference to `pthread_mutex_unlock'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(libwebpdsp_la-lossless.o): In function `VP8LDspInit':
/home/Michael/libwebp-1.0.3/src/dsp/lossless.c:597: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/dsp/lossless.c:597: undefined reference to `pthread_mutex_unlock'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(libwebpdsp_la-rescaler.o): In function `WebPRescalerDspInit':
/home/Michael/libwebp-1.0.3/src/dsp/rescaler.c:205: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/dsp/rescaler.c:205: undefined reference to `pthread_mutex_unlock'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(libwebpdsp_la-upsampling.o): In function `WebPInitYUV444Converters':
/home/Michael/libwebp-1.0.3/src/dsp/upsampling.c:222: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/dsp/upsampling.c:222: undefined reference to `pthread_mutex_unlock'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(libwebpdsp_la-upsampling.o): In function `WebPInitUpsamplers':
/home/Michael/libwebp-1.0.3/src/dsp/upsampling.c:263: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/dsp/upsampling.c:263: undefined reference to `pthread_mutex_unlock'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(libwebpdsp_la-yuv.o): In function `WebPInitSamplers':
/home/Michael/libwebp-1.0.3/src/dsp/yuv.c:78: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/dsp/yuv.c:78: undefined reference to `pthread_mutex_unlock'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(libwebpdsp_la-yuv.o): In function `WebPInitConvertARGBToYUV':
/home/Michael/libwebp-1.0.3/src/dsp/yuv.c:263: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/dsp/yuv.c:263: undefined reference to `pthread_mutex_unlock'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(thread_utils.o): In function `ChangeState':
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:238: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:242: undefined reference to `pthread_cond_wait'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:256: undefined reference to `pthread_mutex_unlock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:251: undefined reference to `pthread_mutex_unlock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:252: undefined reference to `pthread_cond_signal'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(thread_utils.o): In function `End':
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:335: undefined reference to `pthread_join'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:336: undefined reference to `pthread_mutex_destroy'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:337: undefined reference to `pthread_cond_destroy'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(thread_utils.o): In function `Reset':
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:287: undefined reference to `pthread_mutex_init'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:290: undefined reference to `pthread_cond_init'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:294: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:295: undefined reference to `pthread_create'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:297: undefined reference to `pthread_mutex_unlock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:299: undefined reference to `pthread_mutex_destroy'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:300: undefined reference to `pthread_cond_destroy'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:297: undefined reference to `pthread_mutex_unlock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:291: undefined reference to `pthread_mutex_destroy'
/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libwebp.a(thread_utils.o): In function `ThreadLoop':
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:209: undefined reference to `pthread_mutex_lock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:211: undefined reference to `pthread_cond_wait'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:224: undefined reference to `pthread_mutex_unlock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:225: undefined reference to `pthread_cond_signal'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:224: undefined reference to `pthread_mutex_unlock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:225: undefined reference to `pthread_cond_signal'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:224: undefined reference to `pthread_mutex_unlock'
/home/Michael/libwebp-1.0.3/src/utils/thread_utils.c:225: undefined reference to `pthread_cond_signal'



Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Sinan,Capehill
Yes, just how I expected it: one of the 3d party libs wants pthreads, and in Sinans's keys it's libwebp.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
@kas1e

Btw I tried compiling same source on Sam460 with SDK53.30 installed with gcc 4.2.4:

Is 4.2.4 not capable fo compiling SDL2 stuff ?

NTFS-USB1:SDLEXAMPLES> g++ 10_color_keying.cpp -o 10_SDL2 -lSDL2 -SDL2_image -ljpeg -lpng -ltiff -lwebp -lz -lpthread
In file included from /gcc/lib/gcc/ppc-amigaos/4.2.4/../../../../include/c++/4.2.4/bits/stl_algobase.h:73,
from /gcc/lib/gcc/ppc-amigaos/4.2.4/../../../../include/c++/4.2.4/bits/char_traits.h:46,
from /gcc/lib/gcc/ppc-amigaos/4.2.4/../../../../include/c++/4.2.4/string:47,
from 10_color_keying.cpp:8:
/gcc/lib/gcc/ppc-amigaos/4.2.4/../../../../include/c++/4.2.4/ext/type_traits.h:41:19: error: /SDK/include/include_h/utility: Is a directory



Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@SinanSam460

This seems to be about C++ and its standard library and nothing to do with SDL.

Do you have a link to these examples?

Go to top
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
@Capehill

Yes..here is the link:

https://lazyfoo.net/tutorials/SDL/index.php

Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@SinanSam460

Thanks. I tried a simple test:

Quote:

#include <string>


And compiled it with g++ version 4.2.4 but didn't hit the same issue. bits/stl_algobase.h includes <utility> which is a header in the C++ standard library and also a directory in the AmigaOS 4 SDK but I don't understand how these get mixed up now.

What happens if you compile my 1-line example above?

EDIT: did you miss an 'l' switch here:

-SDL2_image

?

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@Capehill

Quote:

And compiled it with g++ version 4.2.4 but didn't hit the same issue. bits/stl_algobase.h includes <utility> which is a header in the C++ standard library and also a directory in the AmigaOS 4 SDK but I don't understand how these get mixed up now.


In older adtools gcc ports the SDK include directories were before the gcc prefix include directories, which is probably why the SDK:include/include_h/utility directory is causing problems. This has been fixed in newer adtools gcc ports since it caused even more problems for C++ support with gcc 6 and later.

Go to top
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
@Capehill

Yes I missed -l with copy-paste, but I also tried with correct command line.

compiling one line example gives out this:

7.RAM Disk:> g++ test.c -o test -lSDL2 -lSDL2_image -ljpeg -lpng -ltiff -lwebp -lpthread
assertion "cached == 0" failed: file "../../gcc/libcpp/line-map.c", line 277
cc1plus: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.sf.net/projects/adtools/> for instructions.

Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Sinan
That "assertion" error is wellknown crap of older gcc which in SDK. You can get rid of it by run "sh" and then compile things in.

The only was for now to deal with all this it use 8.4.0 adtools version, or what is better 10.0.2 one from Sodero's fork till it not merget to adtools repo.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@kas1e

I had the same assertion when compiling on "RAM Disk" but not when compiling on a "Test" partition. Could white space in "RAM Disk" have caused that issue?

Go to top
Re: SDL2
Just popping in
Just popping in


See User information
@Capehill
It used to cause minor troubles under <4.x, I always replaced 'RAM Disk:' with 'ram:'

Go to top
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
@all

As a part of my learning curve, now I trying to compile this Mario clone.

https://github.com/jakowskidev/uMario_Jakowski

I think I copied all dependecies to SDK, and I compile with following command line,

ppc-amigaos-g++ -athread=native -Wall -Wextra -pedantic -std=c++11 -g -O2 AboutMenu.cpp Beetle.cpp Block.cpp BlockDebris.cpp Bowser.cpp BulletBill.cpp BulletBillSpawner.cpp CFG.cpp Cheep.cpp CheepSpawner.cpp Coin.cpp Console.cpp Core.cpp Event.cpp Fire.cpp Fireball.cpp Flag.cpp Hammer.cpp HammerBro.cpp IMG.cpp Koppa.cpp Lakito.cpp LevelEditor.cpp LevelText.cpp LoadingMenu.cpp main.cpp MainMenu.cpp Map.cpp MapLevel.cpp Menu.cpp MenuManager.cpp MenuOption.cpp Minion.cpp Mushroom.cpp Music.cpp MusicManager.cpp OptionsMenu.cpp PauseMenu.cpp Pipe.cpp Plant.cpp Platform.cpp Player.cpp PlayerFireBall.cpp Points.cpp Spikey.cpp Spring.cpp Sprite.cpp Squid.cpp Star.cpp Text.cpp Texture.cpp Toad.cpp UpFire.cpp Vector2.cpp Vine.cpp -o uMario -lSDL2 -lSDL2_image -lSDL2_mixer -ljpeg -lpng -ltiff -lwebp -lz -lpthread -lsmpeg2 -lflac -lmikmod -lmodplug -lvorbis -logg -lopus -lmpg123



but I am having following errors:

/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_ogg.o): In function `Mix_InitOgg':
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:119: undefined reference to `ov_clear'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:119: undefined reference to `ov_clear'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:120: undefined reference to `ov_info'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:120: undefined reference to `ov_info'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:121: undefined reference to `ov_open_callbacks'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:121: undefined reference to `ov_open_callbacks'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:122: undefined reference to `ov_pcm_total'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:122: undefined reference to `ov_pcm_total'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:123: undefined reference to `ov_read'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:123: undefined reference to `ov_read'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:124: undefined reference to `ov_time_seek'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:124: undefined reference to `ov_time_seek'


Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@SinanSam460

As you know position of linking libs is important.

I use this on link stage:
LIBS = -lSDL2_image -ltiff -lwebp -lpng -ljpeg -lz -lm -lvorbisfile -lvorbis -lSDL2 -lpthread

or this one:
LIBS = -athread=native -lSDL2_mixer -lmikmod -lmodplug -lFLAC -lsmpeg2 -lvorbisfile -lvorbis -logg -lSDL2

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@SinanSam460

As others have already pointed out you need to rearrange your link libs.

In your example with uMario you have to set them at least like so:

-lSDL2 -lSDL2_image -ljpeg -lpng -ltiff -lwebp -lSDL2_mixer -lsmpeg2 -lflac -lmikmod -lmodplug -lvorbis -logg -lopus -lmpg123 -lz -lpthread

As you can see you need to place the corresponding libs after their "master" includes...so, image libs after -lSDL2_image and audio libs after -SDL2_mixer.

You should also always place -lpthread and -lz at the end of your linker line, as it will be used "globally" then and don't need to be repeated (if needed).

Good luck

Go to top
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
Thanks for the suggestion..I didn't know that linking order is important, but I still errors related to ogg.

/usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_mixer.a(dynamic_ogg.o): In function `Mix_InitOgg':
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:119: undefined reference to `ov_clear'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:119: undefined reference to `ov_clear'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:120: undefined reference to `ov_info'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:120: undefined reference to `ov_info'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:121: undefined reference to `ov_open_callbacks'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:121: undefined reference to `ov_open_callbacks'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:122: undefined reference to `ov_pcm_total'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:122: undefined reference to `ov_pcm_total'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:123: undefined reference to `ov_read'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:123: undefined reference to `ov_read'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:124: undefined reference to `ov_time_seek'
/home/Michael/SDL2_mixer-2.0.1/dynamic_ogg.c:124: undefined reference to `ov_time_seek'

Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@SinanSam460

Try to switch -lvorbis and -logg.

Sorry, suggesting this without access to my gear

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@SinanSam460

Are these symbols provided by libvorbisfile.a? https://xiph.org/vorbis/doc/vorbisfile/ov_info.html

Go to top
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
@Capehill

I can see them at vorbisfile.h from libvorbis at OS4Depot

extern int ov_clear(OggVorbis_File *vf);
extern int ov_fopen(const char *path,OggVorbis_File *vf);
extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
const char *initial, long ibytes, ov_callbacks callbacks);

extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
const char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test_open(OggVorbis_File *vf);

extern long ov_bitrate(OggVorbis_File *vf,int i);
extern long ov_bitrate_instant(OggVorbis_File *vf);
extern long ov_streams(OggVorbis_File *vf);
extern long ov_seekable(OggVorbis_File *vf);
extern long ov_serialnumber(OggVorbis_File *vf,int i);

Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Sinan
There is very easy pattern to follow to fix all possible "undefined" errors on the linking stage.

You have your SDK directory in which we imagine you unpack all the stuff already (lots of 3d party libs, includes, etc from os4depot). Once you have any undefine , you do search in all your *.a files on that undefine.
I.e. for search in all *.a files in whole SDK for "ov_clear". Find out then in which one : it will be or libogg.a, or libvorbis.a or libvorbisfile.a or something. Then, you need to know that linking order is matter : the *.a lib which ask for undefined symbold come first, then you add -l_lib_which_you_find. Usually that one will ALSO ask for some undefines, you search in which one, add it as well, etc, etc.

I.e. that just boring, routine work.


If you didn't find those undefined function names in your SDK, it then time to go on os4depot, and find out libs where they used. Offten can be understandable from the name of undefined functions. But if not, you then type in google "ov_read", and after few links will find out from where it comes => download/install to SDK => add on linking stage after library asking for undefs.

But most of us just use our strings workng everywhere most of time, like one Javier show.

For example my "usual for SDL2 apps" line is:

Quote:

-lSDL2 -lSDL2_mixer -lmikmod -lmodplug -lflac -lsmpeg2 -lvorbisfile -lvorbis -logg -lSDL2_ttf -lSDL2_image -lSDL2_gfx -lpng -ljpeg -ltiff -lwebp -lfreetype -lm -lz -lpthread



What I mean, that the most important thing there to understand is that once you add linking with let's say SDL_Image, it will need image libs as well (libpng, libjpeg, libtiff,etc) and without will bring undefs. SDL_Mixer need sound/music libs as well: mikmod, flac, smpeg, and so on, and without will give undefs. Freetype library also needs few other libs. But basically, once you got that linking order is important and that its all "flat" (i.e. undefs in one library just fixed by adding necessary library after guilty one) everything will be easy.


Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
@all

Thanks for your help and suggestions.

I was able to compile uMario a few minutes ago..




Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top

  Register To Post
« 1 ... 46 47 48 (49) 50 51 52 ... 74 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project