Dev-C++ question

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

So I downloaded the Dev-C++ project pljones posted, but am having trouble getting it to build. (I use Visual Studio .NET at work and this is a completely different beast, heh...)

Got it down to one pesky error:

c++ C:\Dev-Cpp\vstsdk2.3\ADelay\c++
../common/common.a: No such file or directory.

Which is true, there's no common.a anywhere. Can't find anything on Google about "common.a" (and that's an annoying thing to have to search for :lol:)

Any clues? :)

Post

:-) The one thing I don't like about Dev-C++ is cross- and intra- project dependencies -- it doesn't support them. I forgot to ensure ADelay knew to build "common" first. Just go to the "common" subdirectory (right there next to the ADelay directory) and build that first.

Also, for gui ones, you need to get the vstgui directory built which either means changing where the source lives according to the makefile/project file or downloading the Sourceforge VSTGUI source (and then - in either case - searching the VSTGUI mailing list for my patches -- unless they've finally been incorporated).

Oh yes! READ THE MAKEFILE/PROJECT FILE first, if you haven't already -- it tells you where it expects the source to live. For the VSTSDK, it C:\Dev-Cpp\vstsdk2.3\.

I didn't include makedeps.mak either. This is "../../makedeps.mak", relative to common or ADelay:

Code: Select all

# makedeps
clean: deps-clean

%.dpp: %.cpp
	$(CPP) $(CPPFLAGS) $(CXXFLAGS) -MM -MT "$*.o $@" -MF $@ $<

%.d: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -MM -MT "$*.o $@" -MF $@ $<

DEPS=$(subst .o,.d,$(filter %.o,$(OBJ))) $(subst .o,.dpp,$(filter %.o,$(OBJ)))

-include $(DEPS)

deps-clean:
	rm -f $(DEPS)
I must get around to sorting the above out -- it should build a .d file for each .o file, not a .d/.dpp for each .c/.cpp file.

Post

Here are aome VST development mailing list references:

http://lists.steinberg.net:8100/Lists/v ... 10544.html
which supercedes the second half of this post:
http://lists.steinberg.net:8100/Lists/v ... 10455.html

The first post, regarding the Sourceforge VSTGUI code was here:
http://lists.steinberg.net:8100/Lists/v ... 10454.html


If you don't have access (registration is free!)...

In your "main" project source file, you need to make two small changes (e.g. ADelay.cpp).

The first is to export main and stop GCC moaning about redefining "main()" (the "#if BEOS" line is changed to include GCC on Windows):

Code: Select all

#if BEOS || (WIN32 && defined(__GNUC__))
#define main main_plugin
extern "C" __declspec(dllexport)

#elif MACX
#define main main_macho
extern "C"

#endif

AEffect *main (audioMasterCallback audioMaster)
{
A little further down, a similar change is needed for DllMain:

Code: Select all

#if WIN32
#include <windows.h>
void* hInstance;
#if defined(__GNUC__)
extern "C"
#endif
BOOL WINAPI DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpvReserved)
{
Because of the #define main main_plugin above, your project needs a plugin.def file containing:

Code: Select all

EXPORTS main=main_plugin
Now, you need some patches to VSTGUI, unless they've got around to incorporating them...

This is needed to compile at all (#pragma nightmare!):
aeffectx.h
-- insert two new lines before line 20:

Code: Select all

#elif defined(__GNUC__)
    #pragma pack(push,8)
#elif defined(WIN32) || defined(__FLAT__)
-- (perhaps the defined(__GNUC__) bit should be nested inside the WIN32 test? If so, the following is perhaps not needed...

-- amend line 998 (now line 1000):

Code: Select all

#elif defined(WIN32) || defined(__FLAT__) || defined(__GNUC__)
    #pragma pack(pop)
This next one is for an "unused variable" warning:
vstcontrols.cpp
-- wrap this definition at line 2639:

Code: Select all

#if MOTIF || BEOS
    bool multipleCheck = style & (kMultipleCheckStyle & ~kCheckStyle);
#endif
This next one is to remove another warning:
vstgui.cpp
-- change line 464 from this:

Code: Select all

 ,pBrush (0), pFont (0), pPen (0), pOldBrush (0), pOldPen (0), pOldFont (0)
-- to this:

Code: Select all

 ,pBrush (0), pPen (0), pFont (0), pOldBrush (0), pOldPen (0), pOldFont (0)
-- i.e. to match the order in the class

I assume line 1730 in vstgui.cpp ("DWORD err = GetLastError ();") has side effects? Why not cast to void, though, rather than allocate a local variable?

More platform-dependent variables:
vstgui.cpp
-- lines 4076 and 4077 want guarding:

Code: Select all

#if MAC || MOTIF
    // keep old values
    long oldWidth = size.width ();
    long oldHeight = size.height ();
#endif
-- line 6561 local variable "first" appears unused - I just commented it out.

-- line 7131 allocates a local pointer to lpon->lpOFN and then the full reference is used through the rest of the function :-)

-- line 7199 just looks odd to me - "... == ???)"; I added a space before the close bracket to stop GCC thinking ??) was a trigraph

-- line 8013 was:

Code: Select all

    if (ext && stricmp (ext, ".lnk") == NULL)
-- now:

Code: Select all

    if (ext && stricmp (ext, ".lnk") == 0)
-- because stricmp returns an int not a pointer


The VST code (rather than VSTGUI) has a few fixups. I'm not sure I'm allowed to post these (not open source)... but it's only four lines of their code). These are needed to compile at all (#pragma nightmare!):

AEffect.h
-- insert three new lines before line 34:

Code: Select all

#elif defined(__GNUC__)
    #pragma pack(push,8)
    #define VSTCALLBACK __cdecl
-- and amend line 190 (now line 193):

Code: Select all

#elif defined(WIN32) || defined(__FLAT__) || defined(__GNUC__)
aeffectx.h
-- similarly, insert two new lines before line 20:

Code: Select all

#elif defined(__GNUC__)
    #pragma pack(push,8)
#elif defined(WIN32) || defined(__FLAT__)
-- and amend line 998 (now line 1000):

Code: Select all

#elif defined(WIN32) || defined(__FLAT__) || defined(__GNUC__)
    #pragma pack(pop)

Post

Meh, now I'm getting "5 C:\Dev-Cpp\makedeps.mak
*** multiple target patterns. Stop."

I'm thinking I don't even want to mess with this and will just snag the Visual Studio CD from work, heh :)

Post

foosnark wrote:Meh, now I'm getting "5 C:\Dev-Cpp\makedeps.mak
*** multiple target patterns. Stop."

I'm thinking I don't even want to mess with this and will just snag the Visual Studio CD from work, heh :)
Just take out the extra makefile from the makefile tab of the project settings. I'm overfond of makefile hacks...

Post

That works. Thanks!

Post

I suspect the reason is that you c'n'p'd the makefile content from my earlier message... and the <TAB> characters at the start of the lines converted to spaces. That really screw make up. If you can be bothered, try replacing leading spaces on the $(CPP), $(CC) and rm lines with literal <TAB> (x09) characters.

Post Reply

Return to “DSP and Plugin Development”