irrNetLite 2.1 [BETA]
How I set up irrNettLite 2 Beta with DevCpp:
(Originally I was going to post my error messages and ask for help but I could finally solve all of them)
(I guess for most of you this was super easy but as it took me some time to figure it out I'll post it for people who are too scared to ask )
Add \irrNetLite2Beta\irrNetLite\include to Include Directories
Add /irrNetLite2Beta/irrNetLite/lib/libirrnet.a to Linker
Add example1.cpp to Project
Compile: [Linker error] undefined reference to `irr::net::createIrrNetServer(irr::net::INetCallback*, unsigned int, irr::net::SNetParams const&)' etcetc
Add CNetManager.cpp, SPacket.cpp to Project
Compile: [Linker error] undefined reference to `enet_initialize'
Get libenet.a from http://www.allegro.cc/files/download-at ... &id=689470
Add ../../irrNetLite2Beta/irrNetLite/lib/libenet-mingw/libenet.a to Linker
Compile: [Linker error] undefined reference to `compressBound'
Get zdll.lib from http://www.zlib.net/zlib123-dll.zip
Add ../../irrNetLite2Beta/irrNetLite/source/zlib/zlib123-dll/lib/zdll.lib to Linker
Compile: [Linker error] undefined reference to `htonl@4' etc
Add C:/Dev-Cpp/lib/libws2_32.a to Linker
Compile & Link: success -> Crash
Copy irrNetLite2Beta\irrNetLite\source\zlib\zlib123-dll\zlib1.dll to Project Directory
Finally, the Question "Client (c) or Server (s)?" pops up.
Works with example2.cpp too
(Originally I was going to post my error messages and ask for help but I could finally solve all of them)
(I guess for most of you this was super easy but as it took me some time to figure it out I'll post it for people who are too scared to ask )
Add \irrNetLite2Beta\irrNetLite\include to Include Directories
Add /irrNetLite2Beta/irrNetLite/lib/libirrnet.a to Linker
Add example1.cpp to Project
Compile: [Linker error] undefined reference to `irr::net::createIrrNetServer(irr::net::INetCallback*, unsigned int, irr::net::SNetParams const&)' etcetc
Add CNetManager.cpp, SPacket.cpp to Project
Compile: [Linker error] undefined reference to `enet_initialize'
Get libenet.a from http://www.allegro.cc/files/download-at ... &id=689470
Add ../../irrNetLite2Beta/irrNetLite/lib/libenet-mingw/libenet.a to Linker
Compile: [Linker error] undefined reference to `compressBound'
Get zdll.lib from http://www.zlib.net/zlib123-dll.zip
Add ../../irrNetLite2Beta/irrNetLite/source/zlib/zlib123-dll/lib/zdll.lib to Linker
Compile: [Linker error] undefined reference to `htonl@4' etc
Add C:/Dev-Cpp/lib/libws2_32.a to Linker
Compile & Link: success -> Crash
Copy irrNetLite2Beta\irrNetLite\source\zlib\zlib123-dll\zlib1.dll to Project Directory
Finally, the Question "Client (c) or Server (s)?" pops up.
Works with example2.cpp too
Haha, quite a journey there. I hope you find the examples informative.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Sure, they are easy to understand. You kept it really clean.
Maybe if you got some time you could try to port your IrrNet 0.36 examples 1 2 3 4 to irrNet2+irrLicht 1.5 too as they are a bit more interactive.
Anyways, I ran into a small problem playing around a bit. I use an irrKlang Example to record some audio and would like to send it then with irrNet to another client. But I am getting the following error message:
The various lines that lead up to this should be those here:
I guess I need to take something like this
and change it to be able to handle this:
You got an idea how to make your << operator able to handle it?
Edit: and as you're at it, the >> operator as well
Maybe if you got some time you could try to port your IrrNet 0.36 examples 1 2 3 4 to irrNet2+irrLicht 1.5 too as they are a bit more interactive.
Anyways, I ran into a small problem playing around a bit. I use an irrKlang Example to record some audio and would like to send it then with irrNet to another client. But I am getting the following error message:
Code: Select all
recordclient.cpp:141: error: ambiguous overload for 'operator<<' in 'packet << &data'
SPacket.h:23: note: candidates are: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(irr::c8) <near match>
SPacket.h:25: note: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(irr::u16) <near match>
SPacket.h:27: note: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(irr::u32) <near match>
SPacket.h:29: note: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(irr::u8) <near match>
SPacket.h:31: note: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(irr::s16) <near match>
SPacket.h:33: note: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(irr::s32) <near match>
SPacket.h:41: note: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(const irr::c8*) <near match>
SPacket.h:43: note: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(const irr::core::stringc&)
SPacket.h:45: note: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(const std::string&) <near match>
SPacket.h:47: note: irr::net::SOutPacket& irr::net::SOutPacket::operator<<(const irr::core::stringw&)
Code: Select all
irrklang::ISoundSource* recordedSound = recorder->addSoundSourceFromRecordedAudio("myRecordedVoice");
[...]
void* data = recordedSound->getSampleData();
[...]
packet << &data;
Code: Select all
SOutPacket& SOutPacket::operator << (const u32 data)
{
enlargeBuffer(4);
memcpy(buff.pointer() + buff.size() - 4, &data, 4);
return *this;
}
With the data variable I was already able to do stuff likevirtual void* irrklang::ISoundSource::getSampleData ( ) [pure virtual]
Returns a pointer to the loaded and decoded sample data.
Returns:
Returns a pointer to the sample data. The data is provided in decoded PCM data.[...]
Code: Select all
irrklang::SAudioStreamFormat format = recordedSound->getAudioFormat();
[...]
unsigned long dataLen = format.getSampleDataSize();
[...]
fwrite(data, dataLen, 1, file);
Edit: and as you're at it, the >> operator as well
I recommend casting the void* to a char* and copying it to a string. Then add the string to an SOutPacket and send that.
When receiving just put it in a stringc and retrieve the raw data using c_str().
Cheers
When receiving just put it in a stringc and retrieve the raw data using c_str().
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
There shouldn't be a limit. The underlying Enet lib splits packets up into smaller ones if they get too big, and re-orders them. Although I would suspect sending a really large packet (> 1 MB) may cause the app to hang unless you multithread it.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
How about you actually take a look at it and decide yourself
I'm sure you won't be disappointed
I'm sure you won't be disappointed
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
hi
if i include irrlicht.h in the example the program crashs when it is in the client mode..
Unhandled exception at 0x00451c81 in Client.exe: 0xC0000005: Access violation reading at position 0xccccccd4.
if i debug the program
the debugger say that the error is here->
irrAllocator.h
i use visual 2008
maybe this can important too->
> Client.exe!irr::core::irrAllocator<char>::deallocate(char * ptr=0x00366958) Zeile 40 + 0xe Bytes C++
Client.exe!irr::core::array<char,irr::core::irrAllocator<char> >::~array<char,irr::core::irrAllocator<char> >() Zeile 64 C++
Client.exe!irr::net::SOutPacket::~SOutPacket() + 0x2b Bytes C++
Client.exe!main() Zeile 94 + 0xc Bytes C++
Client.exe!__tmainCRTStartup() Zeile 266 + 0x19 Bytes C
Client.exe!mainCRTStartup() Zeile 182 C
kernel32.dll!7c817067()
plz help me:(
if i include irrlicht.h in the example the program crashs when it is in the client mode..
Unhandled exception at 0x00451c81 in Client.exe: 0xC0000005: Access violation reading at position 0xccccccd4.
if i debug the program
the debugger say that the error is here->
irrAllocator.h
Code: Select all
//! Deallocate memory for an array of objects
void deallocate(T* ptr)
{
internal_delete(ptr); <<--here
}
maybe this can important too->
> Client.exe!irr::core::irrAllocator<char>::deallocate(char * ptr=0x00366958) Zeile 40 + 0xe Bytes C++
Client.exe!irr::core::array<char,irr::core::irrAllocator<char> >::~array<char,irr::core::irrAllocator<char> >() Zeile 64 C++
Client.exe!irr::net::SOutPacket::~SOutPacket() + 0x2b Bytes C++
Client.exe!main() Zeile 94 + 0xc Bytes C++
Client.exe!__tmainCRTStartup() Zeile 266 + 0x19 Bytes C
Client.exe!mainCRTStartup() Zeile 182 C
kernel32.dll!7c817067()
plz help me:(
Did you read the warning at the top of the page that said you have to recompile the MSVC lib yourself else it will crash?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Haha sorry, I will expect better of you next time!of course i read it!
Can you post full source code of example app that causes this problem?
Thank you
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
i created a new project
included Tutorial.cpp from the irrnetlite2beta.zip
then i got many errors like this
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a ist bereits in MSVCRTD.lib(cinitexe.obj) definiert.
i changed the project settings from Multithreaded-Debug-DLL (/MDd) to Multithreaded-Debug (/MTd)
the programm works fine i can send und getting information without any errors
i included irrlicht.h at the beginning auf the tutorial.cpp
the program run a few seconds then i got an error like->
if i click debug i get->
[/img]
included Tutorial.cpp from the irrnetlite2beta.zip
then i got many errors like this
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a ist bereits in MSVCRTD.lib(cinitexe.obj) definiert.
i changed the project settings from Multithreaded-Debug-DLL (/MDd) to Multithreaded-Debug (/MTd)
the programm works fine i can send und getting information without any errors
i included irrlicht.h at the beginning auf the tutorial.cpp
the program run a few seconds then i got an error like->
if i click debug i get->
[/img]
I think its because the Irrlicht versions of irrArray, string, etc, don't match the ones provided with irrNetLite (For convenience and seperation). So delete all the Irrlicht included files that came with irrNetLite, then recompile the irrNetLite lib using irrlicht.h (Just include this in irrNetLite files) and it should be ok.
I will probably update the lib later on to have a #define that takes care of this.
EDIT: Oh yeah, if it is still causing you problems you can try not using a lib at all and just include all the irrNetLite and enet files (Except for the ones that already come with Irrlicht) as part of your project, always works for me!
Cheers
I will probably update the lib later on to have a #define that takes care of this.
EDIT: Oh yeah, if it is still causing you problems you can try not using a lib at all and just include all the irrNetLite and enet files (Except for the ones that already come with Irrlicht) as part of your project, always works for me!
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net