1

I am highly allergic to using the Visual Studio / C++ IDE.

Instead, I would like to be able to code with my usual text editor (Sublime Text for instance), and to build the project with a make.bat file.

Here is an example package (mdaDX10 is an audio VSTi, available open-source) and here is the make.bat file I made:

call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
cl mdaDX10.cpp

Unfortunately, this doesn't work: it tries to build a .exe whereas the output should be a .dll (VST audio plugins are DLLs).

How to make a clean IDE-independant make.bat for such a project?


Here is a part of the error:

[...]
/out:mdaDX10.exe
mdaDX10.obj
mdaDX10.obj : error LNK2019: unresolved external symbol "public: virtual void __
thiscall AudioEffectX::isSynth(bool)" (?isSynth@AudioEffectX@@UAEX_N@Z) referenc
ed in function "public: __thiscall mdaDX10::mdaDX10(int (__cdecl*)(struct AEffec
t *,int,int,int,void *,float))" (??0mdaDX10@@QAE@P6AHPAUAEffect@@HHHPAXM@Z@Z)
mdaDX10.obj : error LNK2019: unresolved external symbol "public: virtual void __
thiscall AudioEffect::canProcessReplacing(bool)" (?canProcessReplacing@AudioEffe
ct@@UAEX_N@Z) referenced in function "public: __thiscall mdaDX10::mdaDX10(int (_
_cdecl*)(struct AEffect *,int,int,int,void *,float))" (??0mdaDX10@@QAE@P6AHPAUAE
ffect@@HHHPAXM@Z@Z)
[...]
Basj
  • 41,386
  • 99
  • 383
  • 673

1 Answers1

1

Calling

cl /? 

will give you a list of options. /LD is the flag to create a dll

cl's options are also documented online https://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx

However, I'd recommend moving away from creating these files yourself, and towards a more general, more powerful solution, like cmake or you might find your scripts become quickly less clean and harder to maintain to meet your needs.