Mac->vc6 VST issues

well i did my devel on MAC Xcode and juce 1.40 now i’m trying to compile this on windows.

The first error is that when doing a release build VC6 gives me an INTERNAL COMPILER ERROR on a line like that

panel[id]->setState (getFilter()->panels[x]);

where panel[id] is a Component (GUI) getFilter() is the method to get the base filter pointer, and the panels[x] is a array of stuctures defined as

struct _panel panels[16];

on MAC that code runs perfectly.

when i do a DEBUG build, it builds (weird?) but gives me all kinds of erros with that line, i tried doing

panels[id]->setStateGUI ();

since the panels component holds the pointer to the filer also, i made a method to acces it from there not from the parent component.

Is there like a problem with VC6, will VCExpress help ? perhaps i’m doing something terribly wrong (like accessing the fitler from GUI components like that).

Bizarre. Try leaving out the “struct” when you declare the array (that’s old C-style syntax, which might be confusing it), so try just “_panel panels[16]”.

VCExpress uses the same compiler, so that won’t help.

i’ll try to provide some more output

E:\DEV\PROJECTS\MYPLUG\src\FuckerEditor.cpp(136) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
E:\DEV\PROJECTS\MYPLUG\src\FuckerEditor.cpp(134) : fatal error C1001: INTERNAL COMPILER ERROR
  (compiler file 'E:\9044\vc98\p2\src\P2\main.c', line 181)
 Please choose the Technical Support command on the Visual C++
 Help menu, or open the Technical Support help file for more information

132: panels[id]	= new Panel(id);
133: panels[id]->filterPtr = getFilter();
134: panels[id]->setState (getFilter()->panels[id]);

panels defintion: Panel *panels[512];
from Panels.cpp

void Panel::setState (_panel panel);

now the filterBase defines

struct _panel
		struct FuckerController		ctrlrs[512];			/* all controllers */
		struct FuckerRectangle		rects[512];				/* rectums */
		int	hardwareid;
		char name[128];										/* panel name */
		char bgcolour[128];									/* background colour */
		char author[128];									/* the panels author */
		char filename[256];									/* last filename used */
		int id;												/* panel id and posiotion */
		bool valid;
		int nrects,nctrlrs;

#define MAX_PANELS 32

_panel			panels[MAX_PANELS];

this error is generated ONLY on Release build, howwver the Debug build when doing a addPanel() method witch calls the lines 132-134 (and adds the created panel as part of a tabbed component) gives me an error on MiniHost.exe

Debug Error!
Program: MiniHost.exe
blah blah

The value of ESP was not properly saved across a function call

the code is available (svn or web browser).

TBH it sounds more like a question for Microsoft support.

If I hit a bug like this, I’d try losing all the extra “struct” statements, and reducing the size of the arrays, because that’s a big old structure you’ve got there. Then maybe change the name “_panel” to “Panel” in case the underscore’s doing it… etc…

heh Microsoft support :slight_smile: good one.

anyway i lost all struct stuff across the code (no help). do you think that sizes might matter here, i redefined MAX_PANELS to just 8 that’s really tiny and no luck. somehow the compiler doesn’t like that call. and i wonder why Debug allows it anyway.

the code is available (svn or web browser) if you want to have a look.

also does any of the Visual series use a different compiler (.net perhaps), i know dev c++ is a bad idea (any other alternatives? something that uses gcc would be awesome as XCode uses that).

i got rid of the internal compiler error by disabling optimization flags.

but i still can’t access anything inside my Panel component that’s a component on a TabbedComponent, i set a pointer to the filter

panels[id]->filterPtr	= getFilter();

but when the panel tries to access getFilter() on it’s own it gives me Stack Overflow or the ESP error before (depends on where in code that happens).

If you’ve got that object on the stack, it’s probably so big that it’s causing a legitimate stack overflow…

you were right i minimized the sizes and it worked (very weird though if it doesn’t fit on the stack how come the plugin gets initialized, the structures are in the base of the plugin and the add panel is abutton that the user has to press after it’s ready).

instead of using static declaration of arrays, if I use dynamic allocation with malloc() ? will this help ?

It did look enormous. Maybe try to use Arrays or something instead of just allocated huge wodges of memory. Or malloc if you really need it to be so big.