wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
5.77k stars 1.7k forks source link

VC++ .NET miscompilation (was: Unstable library) #20198

Closed wxtrac closed 2 years ago

wxtrac commented 21 years ago

Issue migrated from trac ticket # 833

component: wxMSW | priority: normal

2003-02-28 23:58:10: lostdata created the issue


It seems as though the wxXRC library must have some very bad issues. It doesn't seem to handle mistakes very well. Every little thing seems to crash the application without giving a certain error to what the problem may be. I have yet to be able to make my own wxXRC application because nothing seems to work, even after looking at examples and redoing my project over and over, using other XRC files and other source code and whatnot. Sometimes, my program ONLY works when built in debug mode, but when ran in release mode it crashes.

wxtrac commented 21 years ago

2003-03-01 01:13:50: @vslavik commented


Do you seriously consider this a bug report?! If there's a bug somewhere, then please file a detailed,informative bug report (have a look at our database, there are lots of good and useful reports).

I don't know about any situation when XRC crashes -- the only one I know about is when the application forgets to verify that resources were correctly loaded from XRC. Of course, you don't provide any information, so it is hard to tell if this is the case or not.

wxtrac commented 21 years ago

2003-03-01 06:04:18: lostdata commented


After doing much more testing, I figured out it was the Microsoft VC++ 7 (.NET) complier that was having some kind of conflict with wxXRC. I recompiled wxMSW and wxXRC with VC++ 6, and now everything works in both Release builds and Debug builds. When I had the libraries compiled in VC++ 7, it would only work in Debug builds, and would error in Release builds. You might want to look into this situation.

wxtrac commented 21 years ago

2003-03-02 00:35:40: @vslavik commented


It seems VC7 is a bit over-optimizing compiler (see bellow a message from wx-dev@lists.wxwindows.org). Turning optimalizations off should help. I can't look into it because I don't have VC7 w/ optimizing compiler, but you do and your help with finding the reason and some fix or workaround would be most welcome!


Hi,

I know it's off topic, but I was wondering if any of you have the idea, that the vc.net compiler is a little buggy.

Examples:

wx2.2.9: When compiling in debug mode, the IsKindOf function doesn't work like it should. All user derived classes aren't recognisable with IsKindOf. I tracked this problem down to the virtual tables. these aren't constructed correctly. When compiling in release mode, it still doesn't work. When I turn off all optimisations, it works fine.

wx2.2.9: The wxMAXIMIZE style only works when I run my app from the developer environment. When it's standalone, it doesn't maximize.

wx2.4.0: SetBackgroundColour doesn't work correctly. Setting the background color of a panel to white results in a dark grey background. But all components on the panel have a white background. Except for CheckBoxes. These have a light grey background.

wx2.4.0: My app starts without a frame, so to prevent it from shutting down, I call SetExitOnFrameDelete(false). In Release this doesn't do the trick anymore (works fine in 2.2.9). When I turn off optimizations it works fine again.

Further more, I can't compile wx2.4.0 apps in debug mode, because of some unresolved references: __timezone, _timezone and CrtSetDbgFlag. I know, this isn't a compiler problem, this is just me not wanting to waste much time in finding the right libs to link. ;)

So if anyone knows why vc.net acts so weird, any help would be greatly appreciated.

Yours,

Jean-Paul Kogelman

wxtrac commented 20 years ago

2004-02-12 19:19:35: @vadz commented


this bug was fixed in 2.4.1