Notes for GCC users - Rudolf Lindner

An email from Rudolf Lindner to the SE SDK group....I have updated this a little to incorporate changes to the SDK....

As promised, I was busy working on the GCC issues and now I have a working SE
plugin built with the free GCC / MINGW compiler using the free Dev-cpp IDE. I
have taken the se_delay plugin as an example and thus built the files in the
se_delay and the se_sdk folders.

Below is a list of incompatibilities between MSVC / GCC and some changes to the
se_sdk so that the sources compile either with MSVC and GCC.
I have crosschecked the changes with MSVC 5 to ensure that the whole thing still
works with MSVC.

My suggestions is that Jeff includes these changes to the SynthEdit SDK. If
anybody is interested I could also provide example makefiles and howtos.


To build a SE plugin using GCC and Dev-cpp you have to set up a dev-cpp project
to build the se_delay plugin.
It needs just a couple of simple steps:
- run Dev-cpp,
- create a project (Project Type DLL),
- remove the automatically generated header file and source file from the project,
- add the files from your module and the se_sdk base files from the se_sdk
directory to the project.
- It is also possible to provide a small post-build makefile that copies the dll
as a sep file to the SE modules/ folder (see below).



Now comes the hard part (compiling and linking):

----------
Here is a small postbuild makefile. add it to dev-cpp (Project Options ->
Makefiles -> Add)

post-build.mak:
-- %< ----- cut here -----
# set INSTALLDIR to your target folder where the .sep module should be installed
INSTALLDIR=d:/bin/audio/SynthEdit/modules/test\ plugins

all-after:                          ${INSTALLDIR}/se_delay-gcc.sep



${INSTALLDIR}/se_delay-gcc.sep:     se_delay-gcc.dll
     cp se_delay-gcc.dll ${INSTALLDIR}/se_delay-gcc.sep

-- >% --- cut here -----

This is my project-file for  Dev-cpp. Add it to your se_delay folder and make
some changes to suit your personal environment:

se_delay-gcc.dev:
-- %< ----- cut here -----
[Project]
FileName=se_delay-gcc.dev
Name=se_delay-gcc
UnitCount=10
Type=3
Ver=1
ObjFiles=
Includes=D:\bin\audio\synthedit-sdk\se_sdk
Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=post-build.mak
Resources=
Compiler=-DBUILDING_DLL=1
Linker=--no-export-all-symbols --add-stdcall-alias
IsCpp=1
Icon=
ExeOutput=
ObjectOutput=
OverrideOutput=0
OverrideOutputName=se_delay-gcc.dll
Folders=
CommandLine=
Focused=0
Order=0,1,2

[Unit2]
FileName=Module.cpp
Open=1
Folder=
Top=0
CursorCol=1
CursorRow=142
TopLine=120
LeftChar=1

[Views]
ProjectView=1

[Unit1]
FileName=SEModuleMain.cpp
Open=1
Folder=
Top=1
CursorCol=1
CursorRow=16
TopLine=10
LeftChar=1

[Unit3]
FileName=Module.h
Open=1
Folder=
Top=0
CursorCol=1
CursorRow=27
TopLine=1
LeftChar=1

[Unit4]
FileName=..\se_sdk\SEPin.h
Open=0
Folder=
Top=0
CursorCol=7
CursorRow=33
TopLine=1
LeftChar=1

[Unit5]
FileName=..\se_sdk\SEMod_struct.h
Open=0
Folder=
Top=0
CursorCol=1
CursorRow=3
TopLine=1
LeftChar=1

[Unit6]
FileName=..\se_sdk\SEMod_struct_base.h
Open=0
Folder=
Top=0
CursorCol=23
CursorRow=59
TopLine=34
LeftChar=1

[Unit7]
FileName=..\se_sdk\SEModule_base.cpp
Open=0
Folder=
Top=0
CursorCol=19
CursorRow=2
TopLine=1
LeftChar=1

[Unit8]
FileName=..\se_sdk\SEModule_base.h
Open=0
Folder=
Top=0
CursorCol=1
CursorRow=34
TopLine=34
LeftChar=1

[Unit9]
FileName=..\se_sdk\SEPin.cpp
Open=0
Folder=
Top=0

[Unit10]
FileName=..\se_sdk\se_datatypes.h
Open=0
Folder=
Top=0
CursorCol=2
CursorRow=34
TopLine=1
LeftChar=1

-- %< ----- cut here -----


Happy new year to everybody from Germany (still waiting for the snow...),

Rudolf

Notes for Dev CPP users - Peter Jones

I thought Jeff might like to consider including a couple of files for
Dev-C++ users, if they prove to be useful.

Here's a little makefile insert I use to ease installation.  I've put
this in the se_sdk directory as it's common to all my builds.  I'm
not sure the "INSTDIRDOS" and "INSTDIR" are strictly necessary but
they make me feel safer.

_____ CUT HERE _____ ..\se_sdk\synthedit_devcpp.mak
# set to your target folder where the .sep module should be installed
INSTDIRDOS=C:\Program Files\SynthEdit\modules\MyModules
INSTDIR=C:/Program\ Files/SynthEdit/modules/MyModules

PLUGNAME=$(BIN:.dll=.sep)

all-after: ${INSTDIR}/${PLUGNAME}

${INSTDIR}/${PLUGNAME}: ${BIN}
      copy ${BIN} "${INSTDIRDOS}\${PLUGNAME}"

clean-custom:
      rm -f ${INSTDIR}/${PLUGNAME}
_____ CUT HERE _____


Next, here's a .dev file for se_delay (edited to the smallest working
size).  Note that I reference the SEPin and SEModule_base components
in place.  This references the above makefile text.

_____ CUT HERE _____ se_delay.dev
[Project]
FileName=se_delay.dev
Name=se_delay
UnitCount=5
Type=3
Ver=1
Includes="..\se_sdk"
MakeIncludes=..\se_sdk\synthedit_devcpp.mak
Compiler=-DBUILDING_DLL=1_@@_
Linker=--no-export-all-symbols --add-stdcall-alias_@@_
IsCpp=1

[Unit1]
FileName=Module.h

[Unit2]
FileName=Module.cpp

[Unit3]
FileName=SEModuleMain.cpp

[Unit4]
FileName=..\se_sdk\SEPin.cpp

[Unit5]
FileName=..\se_sdk\SEModule_base.cpp
_____ CUT HERE _____

On the subject of the makefile, there doesn't appear to be a way to
get Dev-C++ to use the .def files provided: it wants "lib" on the
front of them.  Anyone know how to get around this (and still build
a .dll)?  (It's a problem with Dev-C++, really, that you can't
configure everything it puts into the makefile.win in someway.)

Oh, and GNU Make gets confused by targets containing spaces, even if
they're quoted or escaped - again, anyone got any way around that one?