n> C:\MILXView-win32-depend\itk-3.16.0\Utilities\itksys/
n> SystemTools.hxx(48) : error C2371: 'mode_t' : redefinition; different
n> basic types
n> 13> C:\MILXView-win32-depend\wxWidgets-2.9.1\include\wx/
n> filefn.h(98) : see declaration of 'mode_t'
n>
n> Searching on the internet I found (http://trac.wxwidgets.org/ticket/
n> 11429) which states "typedef int mode_t;" modify "#define mode_t int".
Do you use ACE too or is there some other reason you can't avoid defining
mode_t yourself in SystemTools.hxx?
n> However if I do this I can no longer build wxwidgets I get many errors
n> such as:
n>
n> 6>C:\MILXView-win32-depend\wxWidgets-2.9.1\include\wx/filefn.h(568) :
n> error C2143: syntax error : missing ')' before ';'
I don't see how could this caused by replacing typedef with #define. Are
you sure you didn't make some typo elsewhere when doing it? Comparing your
modified version with the original one using diff could be useful.
Anyhow, the real solution to #11429 is to do what I wrote in my comment
there, i.e. wrap mode_t definition in "#if wxNEEDS_MODE_T" test and
predefine wxNEEDS_MODE_T as 0 for projects, such as yours, that already
define mode_t.
n> I am using Visual Studio 2008 on windows 7 64 bit machine. I also have
n> an error that compiled okay on XP win32 wxwidgets 2.8.10:
n>
n> error C2450: switch expression of type 'wxUniChar' is illegal
n> Ambiguous user-defined-conversion
This is one of the few known problems with the Unicode-related changes.
You really, really ought to read about them in the manual. In particular,
this one is the very first in the list at
http://docs.wxwidgets.org/2.9.1/overview_unicode.html#overview_unicode_compilation_errors
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
n> Note: I initially tried to build wxWidgets 2.9.1 using wx_vc9.sln, but
n> found that the build order was wrong so had to run the build several
n> times to get everything to build. I aslo tried using wx_dll.dsw which
n> proved successful immediately so I assume the build order is correct
n> here.
Yes, this is a known problem (which unfortunately is not that easy to
solve).
n> However, when linking against my application code the libraries tried
n> to look in ~/lib/vc_amd64_dll, but wxWidgets had created a directory
n> named vc_dll. So to solve the issue I just renamed the directory. Are
n> you aware of this issue?
Do you use auto linking (i.e. include include/msvc/wx/setup.h) and really
building in 64 bits?
n> Or did I miss out a configuration step.
I think there is some mismatch between the way you built the library and
the way you use it although I have no idea how could linking succeed at all
if the libraries are 64 bit and the applications 32 (or vice versa).
n> Also the wx_dll.dsw didn't build the wxmsw29ud_ribbon.lib so had to
n> build it via the wx_vc9.sln as ribbon was not part of the wx_dll.dsw
n> solution. easy fixes just wondered if you had encountered them?
No but I'll add ribbon to wx_dll.dsw, thanks.
n> I managed to get my application running but it now crashes when I
n> try to load any images (worked under 32 bit 2.8.10 XP). I get a window
n> stating:
n>
n> C:\MILXView-win32-depend\wxWidgets-2.9.1\include\wx/strvararg.h(449):
n> assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype"
n> failed in wxArgNormalizer<unsigned __int64>::wxArgNormalizer(): format
n> specifier doesn't match argument type
This is not a crash but an assert failure (the difference being that the
latter can be ignored and doesn't arise in release builds) but it still
needs to be fixed, of course.
n> GetViewNotebook()->AddPage(page, title, true); // < -- Crashes on this line
Could you please look at the stack after this call? You should see a call
to wxString::Printf() or Format() somewhere in it, can you please tell me
where is it exactly?
n> Under 2.8.10 I don't have m_convertedToChar value, Is this because
n> setup.h has wxUSE_UNICODE = 0 here and wxUSE_UNICODE = 1 in 2.9.1 by
n> default?
Roughly speaking yes. But you shouldn't care about wxString internals
anyhow (except m_impl for debugging purposes maybe). IOW it's normal for
m_str to be NULL and m_len to be -1.
n> > Do you use auto linking (i.e. include include/msvc/wx/setup.h) and really
n> > building in 64 bits?
n>
n> Not sure what you mean by this. The steps I use to build wxWidgets
n> 2.9.1 on visual Studio 9 2008 are;
n> 1. Download and untar from wxWidgets website
n> 2. Load C:\MILXView-win32-depend\wxWidgets-2.9.1\build\msw\wx_dll.dsw
n> 3. Go into the configuration manager and change "Active platform
n> solution" to X64 (copy settings from WIN32)
n> 4. Build Solution for "DLL Debug" and "DLL Release"
Well, the past about manually changing platform to x64 was unknown to me
which was why I couldn't understand how were you getting the x64 build.
n> > Could you please look at the stack after this call? You should see a call
n> > to wxString::Printf() or Format() somewhere in it, can you please tell me
n> > where is it exactly?
n>
n> It's a printf (see below)
Thanks, I think this was fixed by r65054 which happened after 2.9.1. So
you should just update to the latest svn or apply the patch from
http://trac.wxwidgets.org/changeset/65054 to your local tree.
n> The code at this point is...
n>
n> #ifndef wxNEEDS_WXSTRING_PRINTF_MIXIN
n> // formatted input/output
n> // as sprintf(), returns the number of characters written or < 0
n> on error
n> // (take 'this' into account in attribute parameter count)
n> // int Printf(const wxString& format, ...);
n> WX_DEFINE_VARARG_FUNC(int, Printf, 1, (const wxFormatString&),
n> DoPrintfWchar, DoPrintfUtf8)
This code is actually fine, it's in the caller that there was a bug.
> I checked out from the SVN repository (r65473) and that stopped the
> assert message box from appearing when loading these types of images.
> However, a similar message appears now when I load DICOM images.
[...]
> The line in my code which causes the assert is:
>
> wxString buffer;
>
> // Current Progress
> buffer.Printf(wxT("%d"), info[i].GetProgress()); <--- Asserts
> here.
>
Does your GetProgress maybe return a 64-bit integer? You should either
convert/cast to an int, change the return type of GetProgress, or
change the format specifier (%d). The assert you were seeing earlier
on (and probably now) contained a hint about this: "format specifier
doesn't match argument type". I get the exact same assert with the
above code if I let the function return a float or 64-bit int.
Regards,
Dimitri