Page 1 of 1

[FIX] cygwin compilation

Posted: Thu Feb 05, 2009 1:12 pm
by lokiare
I've gotten Irrlicht to compile under cygwin by changing

void CGUISpinBox::setValue(f32 val)

in CGUISpinBox.cpp to:

Code: Select all

char str[100];
core::string<char> fs(FormatString.c_str());

snprintf(str, 99, fs.c_str(), val);
core::stringw str2(str);
EditBox->setText(str2.c_str());
verifyValueRange();
I'm not sure how well that will work, but I'd like to know if there is a better option. I'm looking into porting this to the PSP, but I'm new to cygwin and makefiles (was raised on MVSC++). Are there any dependencies other than jpeglib, libpng, and zlib? these have all been successfully ported to PSP.

Posted: Thu Feb 05, 2009 2:21 pm
by rogerborg
That looks like it'll work, but what problem were you getting, and why (I wonder) aren't you getting it anywhere else?

Posted: Thu Feb 05, 2009 5:55 pm
by hybrid
Seems like either the swprintf redefinition isn't properly working or you didn't add the proper defines in IrrCompileConfig. Adding a new platform means adding the basic underlying support for it first. So please post your desired platform/API defines and the compiler error message from your failed try.
BTW: I moved the thread here...

Posted: Tue Feb 17, 2009 4:02 am
by lokiare
I'm attempting to port to the PSP as a "real" port. This way it can keep updated and work with all of the new stuff.

Posted: Tue Feb 17, 2009 8:04 am
by hybrid
The thing is that you'll probably get a Windows define due to using cygwin (or something like that). This may lead to undesired defines for the os specific stuff. You will have to take care of the proper defines and probably set some of them manually.
Also, always post full error messages with the full compiler output.

Posted: Thu Feb 26, 2009 6:04 pm
by lokiare
Just to clarify, cygwin doesn't support swprintf. It is only used in one place in the entire engine. This is the solution to get it to compile under cygwin, for windows (not PSP).