| Author |
Message |
Szpak
[1] Users
19 posts
Location: Poland
Occupation:
Age:
|
#427
2005-01-15 16:31 GMT
|
|
Hi,
I'm not able to link my program with oggvorbis library. I get link errors. What is strange, when I remove needed .a files linking ends successfuly, but program ends with runtime error.
I use Dev-C++ 4.9.9.1, DirectX9c and OggVorbis devpaks.
Did anybody use OggVorbis devpak without this problem?
Marcin
g++.exe main.o FSound.o -o "oggt1.exe" -L"E:/Dev-Cpp/lib" -logg -lvorbis -lvorbisenc -lvorbisfile -ld3d9 -ld3dx9 -ldsound -ldxguid -luuid -lgdi32 -lole32 -lwinmm
Warning: .drectve `%.*s' unrecognized
E:/Dev-Cpp/lib/libvorbisfile.a(vorbisfile.o.b)(.text+0xcd):vorbisfile.c: undefined reference to `ogg_page_serialno'
E:/Dev-Cpp/lib/libvorbisfile.a(vorbisfile.o.b)(.text+0x16b):vorbisfile.c: undefined reference to `ogg_page_serialno'
E:/Dev-Cpp/lib/libvorbisfile.a(vorbisfile.o.b)(.text+0x23e):vorbisfile.c: undefined reference to `ogg_sync_reset'
E:/Dev-Cpp/lib/libvorbisfile.a(vorbisfile.o.b)(.text+0x29b):vorbisfile.c: undefined reference to `ogg_sync_reset'
E:/Dev-Cpp/lib/libvorbisfile.a(vorbisfile.o.b)(.text+0x2fb):vorbisfile.c: undefined reference to `vorbis_block_clear'
E:/Dev-Cpp/lib/libvorbisfile.a(vorbisfile.o.b)(.text+0x309):vorbisfile.c: undefined reference to `vorbis_dsp_clear'
E:/Dev-Cpp/lib/libvorbisfile.a(vorbisfile.o.b)(.text+0x314):vorbisfile.c: undefined reference to `ogg_stream_clear'
(...)
make.exe: *** [oggt1.exe] Error 1
|
|
|
|
|
ZoE
[99] ServerOp
200 posts
http://www.g-productions.net
Location: Greece
Occupation:
Age: 33
|
#428
2005-01-15 20:06 GMT
|
|
Yep I think I have the solution. When including the header files for ogg vorbis sdk don't include the subdirs with two backslashes as shown here
#include <vorbis\\codec.h>
but with one forward slash
#include <vorbis/codec.h>
This known issue prevents using c-style in MinGW and the programm doesn't crash. As for linking I couldn't find any problem. It works for me great with two examples made from scratch. Static linking and dynamic linking work either well.
The only G-Racer available on earth.
Check out http://g-racer.net
|
|
|
|
|
Szpak
[1] Users
19 posts
Location: Poland
Occupation:
Age:
|
#429
2005-01-16 01:10 GMT
|
|
Thanks for reply.
I don't use \\.
I tried with libogg.a against -logg as well, but without any effect. I think dev-cpp sees libs (I don't have "no such file or directory" error).
Could you send me your project configuration or some minimal file using oggvorbis? (I have problem even with linking vorbisfile_example.c) and I indeed don't know why.
Did you use the same MinGW version (this from Dev-c++ 4.9.9.0/1)?
|
|
|
|
|
Anonymous
[] ? []
posts
Location:
Occupation:
Age:
|
#438
2005-01-28 17:02 GMT
|
|
in your linker pannel within the project settings, you should link with -ogg -vorbis etc. and not with relative paths.
|
|
|
|
|
Szpak
[1] Users
19 posts
Location: Poland
Occupation:
Age:
|
#440
2005-01-29 22:34 GMT
|
|
I have -logg, -lvorbis, etc. I tried with -ogg, ... but it didn't work (the same errors). But I think -logg is better choice, because it links with libogg.a (lib compatible with mingw), not with ogg.lib, but I can be wrong.
Btw, do you have some simple project which work with your dev-cpp? I'm not able to link anything
|
|
|
|
|
Anonymous
[] ? []
posts
Location:
Occupation:
Age:
|
#441
2005-01-31 19:20 GMT
|
|
In your linker options, put -lvorbis before -logg. I have the following in my linker options: -lvorbis -lvorbisfile -logg With this I can compile the
decoder_example.c program. If I put -logg first I fail with linker errors also.
Hope this helps,
Dale
|
|
|
|
|
Szpak
[1] Users
19 posts
Location: Poland
Occupation:
Age:
|
#442
2005-02-01 11:30 GMT
|
|
Quote Anonymous :
In your linker options, put -lvorbis before -logg. I have the following in my linker options: -lvorbis -lvorbisfile -logg With this I can compile the
decoder_example.c program. If I put -logg first I fail with linker errors also.
Hope this helps,
Indeed. It was good trace. I didn't know that library sequence is important.
Your order works with example_decode, but in my program I had to change it to:
-lvorbisfile
-lvorbisenc
-lvorbis
-logg
which works with all examples too.
Big thanks for help
Marcin
|
|
|
|
|
Anonymous
[] ? []
posts
Location:
Occupation:
Age:
|
#445
2005-02-02 19:02 GMT
|
|
Glad this was some help to you. The order of the library files has something to do with forward reference when linking. Any time I have odd linker problems I will play with the order of the library files. This usually takes care of it.
You may want to download the example code at http://www.wischik.com/scr/holsavers.html
This is a really good screen saver site. One of the screen saver examples plays ogg files. It looks like a really good learning tool.
Dale
|
|
|
|
|
Szpak
[1] Users
19 posts
Location: Poland
Occupation:
Age:
|
#446
2005-02-03 18:50 GMT
|
|
Interesting acticle and examples.
Thanks again
Marcin
|
|
|
|
|