Author Topic: Howdy! Im a noob :)  (Read 20418 times)

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Howdy! Im a noob :)
« on: July 13, 2006, 03:34:11 pm »
Just saying hi - im a total noob to C++ and have been reading tons of tutorials - im starting to understand the basics i think.

anyway codeblocks is great! i downloaded the stable version, and followed the instructions on the wiki to set up MinGW - and have been compiling console apps to my hearts content.

So now i have a few questions :)

(1 - Am i better off getting the latest builds? It seems like the stable version is very old....

(2 - Are the versions of GCC files that the wiki instructions pointed to recent enough? should i get later versions of gcc, g++, mingw stuff?

(3 - I want to set up wxWidgets 2.6.3 - i believe thats possible from briefly browsing this forum? Am i right?

(4 - I want to make VST plugins. I dled the VST SDK - now i want to try to compile one of the example projects. I have no idea where to put the sdk, and how to set up the standard "dll" project template into a new user template that makes vsts - one that finds the right files when i try and compile. Anyone able to help me with where to put files/what files to put in the  vsts project directory etc? Especially people who have experience making VSTs in Code:Blocks.

Cheers. And thanks so much for Code:Blocks it rocks.... :D

Offline mdelfede

  • Multiple posting newcomer
  • *
  • Posts: 84
Re: Howdy! Im a noob :)
« Reply #1 on: July 13, 2006, 05:49:18 pm »
Just saying hi - im a total noob to C++ and have been reading tons of tutorials - im starting to understand the basics i think.

anyway codeblocks is great! i downloaded the stable version, and followed the instructions on the wiki to set up MinGW - and have been compiling console apps to my hearts content.

So now i have a few questions :)

(1 - Am i better off getting the latest builds? It seems like the stable version is very old....

(2 - Are the versions of GCC files that the wiki instructions pointed to recent enough? should i get later versions of gcc, g++, mingw stuff?

(3 - I want to set up wxWidgets 2.6.3 - i believe thats possible from briefly browsing this forum? Am i right?

(4 - I want to make VST plugins. I dled the VST SDK - now i want to try to compile one of the example projects. I have no idea where to put the sdk, and how to set up the standard "dll" project template into a new user template that makes vsts - one that finds the right files when i try and compile. Anyone able to help me with where to put files/what files to put in the  vsts project directory etc? Especially people who have experience making VSTs in Code:Blocks.

Cheers. And thanks so much for Code:Blocks it rocks.... :D

1) Latest builds are more feature-rich... much better to get them. In wiki there is an howto (updated yesterday) on getting and compiling latest sources from svn.

2) The GCC are ok... if you want you can get newer ones, but not over the 4.0.x series. The 4.1.x has a problem.

3) Yes, you must download the sources AND the patch 2 from http://wxWidgets.org. Don't forget the patch or you'll have troubles.

4) I have no idea about  :shock:

Ciao

Max

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #2 on: July 13, 2006, 10:07:34 pm »
Hi,
Quote from: mdelfede
3) Yes, you must download the sources AND the patch 2 from http://wxWidgets.org. Don't forget the patch or you'll have troubles.
What do you mean? What patch has to be applied?
Quote from: matthewjumpsoffbu
(4 - I want to make VST plugins.
I used VST plugins with Dev-Cpp, may be I can help you if you describe your problem!

A side note: I compiled a VST plugin also using Qt4 libraries and qmake, but there are troubles with the event loop.
« Last Edit: July 13, 2006, 10:10:19 pm by iw2nhl »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Howdy! Im a noob :)
« Reply #3 on: July 13, 2006, 10:22:48 pm »

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #4 on: July 13, 2006, 10:48:46 pm »
Patch 2 @ http://wxwidgets.org/downloads/patch.htm
Perfect! Thank you!
Now I understand also why there was a wxMSW-2.6.3.zip and a wxMSW-2.6.3-1.zip: the last one contained the Patch-1.
Google found for me a 'patch' executable for windows:
http://gnuwin32.sourceforge.net/packages/patch.htm

A question:
the patch-2 contains the patch-1, so it must be applied to the base 'wxMSW-2.6.3' or can be applied to the already patched (with patch-1) 'wxMSW-2.6.3-1' too?

[EDIT]
The patch ZIP is not a 'diff' file, but contains the already-patched source files.
No 'patch' executable is needed, just overwrite the files in the source dir!
« Last Edit: July 13, 2006, 10:52:41 pm by iw2nhl »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: Howdy! Im a noob :)
« Reply #5 on: July 13, 2006, 10:53:40 pm »
patch 2 contains patch 1, so can apply it wx263, and if you like also to wx263p1. The end result will be the same .

Offline mdelfede

  • Multiple posting newcomer
  • *
  • Posts: 84
Re: Howdy! Im a noob :)
« Reply #6 on: July 14, 2006, 12:09:50 am »

A question:
the patch-2 contains the patch-1, so it must be applied to the base 'wxMSW-2.6.3' or can be applied to the already patched (with patch-1) 'wxMSW-2.6.3-1' too?

[EDIT]
The patch ZIP is not a 'diff' file, but contains the already-patched source files.
No 'patch' executable is needed, just overwrite the files in the source dir!

Wiki updated !

Ciao

Max

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #7 on: July 14, 2006, 12:55:16 am »
With latest modifies of theese days to the wiki, now it is more clear what to do!
Thanks to Mdelfede who updated the wiki with the new infos and to Sethjackson that restyled them.

Another question:
I applied the patch and recompiled, but the resulting DLL has not been rebuilt, is this right?
DLL: wxWidgets\lib\gcc_dll\wxmsw26u_gcc_custom.dll
I tried also to give the "clean" command and then rebuild everything, but still the DLL did not change. Moreover I noticed that the 'clean' command did not remove the old DLL.
Is this a bug of the wxWidgets makefile or is this right?

[EDIT]
I noticed that there are 2 DLLs:
1) wxmsw26u_gcc_custom.dll
2) wxmsw26_gcc_custom.dll
The wiki says I need the first one (which has not been modified), while the second one has been modified (really I didn't notice it before!).
What's the difference between the 2 DLLs?
« Last Edit: July 14, 2006, 01:22:38 am by iw2nhl »

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #8 on: July 14, 2006, 01:45:26 am »
OK thanks guys - i will have to look into getting the latest build and gcc 4.0 and wxwidgets....

oh btw - what version packages should i get instead of the ones in the wiki? Whats the latest versions that are still stable? i used these versions
Quote
GCC 3.4.2 manual install

Installing MinGW can be quite intimidating the first time because it is not obvious what you have to do. Luckily, it is actually pretty simple.
To do a manual install, simply download the required files and extract them all into the same directory. For simplicity, I recommend C:\MinGW.

Base system with C++

    * http://prdownloads.sourceforge.net/mingw/gcc-core-3.4.2-20040916-1.tar.gz?download
    * http://prdownloads.sourceforge.net/mingw/gcc-g++-3.4.2-20040916-1.tar.gz?download
    * http://prdownloads.sf.net/mingw/mingw-runtime-3.9.tar.gz?download
    * http://prdownloads.sourceforge.net/mingw/mingw-utils-0.3.tar.gz?download
    * http://prdownloads.sf.net/mingw/w32api-3.5.tar.gz?download
    * http://prdownloads.sf.net/mingw/binutils-2.16.91-20050827-1.tar.gz?download
    * http://prdownloads.sourceforge.net/mingw/mingw32-make-3.80.0-3.tar.gz?download

Optionally:

gdb debugger

    * http://prdownloads.sf.net/mingw/gdb-6.3-2.exe?download

Cheers. And i do hope someone will come along who has made VSTs with the SDK with code:blocks :)

edit: oh sorry i missed ur post iw2nhl - my 'problem' is i dont know what to do :) I put the vstsdk2.4 folder in C:/ and then i copied the sample project "adelay" over into a folder that i use to store my codeblocks proejects. then i made a new dll project in codeblocks and added all the cpp and h files in the folder to it...i believe thats a way to do it? when i went to compile i tried adding the vstsdk dir to the directories settings - maybe i need to add specific folders? currently i cant compile it - i keep getting lots of errors.

so yea - if someone could walk me thru setting up a project and compiling it - using the adelay example that comes with the vst sdk 2.4 i would be very appreciative :D

PS the wiki main page seems to be missing links? like under the "Installing code:blocks" and "documentation" there used to be a bunch of sub-links their all gone now???
« Last Edit: July 14, 2006, 01:53:37 am by matthewjumpsoffbuildings »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Howdy! Im a noob :)
« Reply #9 on: July 15, 2006, 12:59:49 am »
OK thanks guys - i will have to look into getting the latest build and gcc 4.0 and wxwidgets....

oh btw - what version packages should i get instead of the ones in the wiki? Whats the latest versions that are still stable? i used these versions
Quote
GCC 3.4.2 manual install

Installing MinGW can be quite intimidating the first time because it is not obvious what you have to do. Luckily, it is actually pretty simple.
To do a manual install, simply download the required files and extract them all into the same directory. For simplicity, I recommend C:\MinGW.

Base system with C++

    * http://prdownloads.sourceforge.net/mingw/gcc-core-3.4.2-20040916-1.tar.gz?download
    * http://prdownloads.sourceforge.net/mingw/gcc-g++-3.4.2-20040916-1.tar.gz?download
    * http://prdownloads.sf.net/mingw/mingw-runtime-3.9.tar.gz?download
    * http://prdownloads.sourceforge.net/mingw/mingw-utils-0.3.tar.gz?download
    * http://prdownloads.sf.net/mingw/w32api-3.5.tar.gz?download
    * http://prdownloads.sf.net/mingw/binutils-2.16.91-20050827-1.tar.gz?download
    * http://prdownloads.sourceforge.net/mingw/mingw32-make-3.80.0-3.tar.gz?download

Optionally:

gdb debugger

    * http://prdownloads.sf.net/mingw/gdb-6.3-2.exe?download

Hello,

I would advice to use the MinGW 5.0.3 installer and chose candidate. This will install the latest packages (those of yours list are a bit out of date :)). And also the gdb debugger is not optional if you would like to debug your code :).

Best wishes,
Michael

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #10 on: July 15, 2006, 04:34:07 am »
oh so the 5.03 installer is good and uses stable packages?

also - anyone with VST SDK experience in Code:Blocks? I really need a hand :)

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #11 on: July 15, 2006, 02:42:11 pm »
Someone has an answer to my question about the wxWidgets DLL?
Another question:
I applied the patch and recompiled, but the resulting DLL has not been rebuilt, is this right?
DLL: wxWidgets\lib\gcc_dll\wxmsw26u_gcc_custom.dll
I tried also to give the "clean" command and then rebuild everything, but still the DLL did not change. Moreover I noticed that the 'clean' command did not remove the old DLL.
Is this a bug of the wxWidgets makefile or is this right?
[EDIT]
I noticed that there are 2 DLLs:
1) wxmsw26u_gcc_custom.dll
2) wxmsw26_gcc_custom.dll
The wiki says I need the first one (which has not been modified), while the second one has been modified (really I didn't notice it before!).
What's the difference between the 2 DLLs?

VST SDK:
edit: oh sorry i missed ur post iw2nhl - my 'problem' is i dont know what to do :) I put the vstsdk2.4 folder in C:/ and then i copied the sample project "adelay" over into a folder that i use to store my codeblocks proejects. then i made a new dll project in codeblocks and added all the cpp and h files in the folder to it...i believe thats a way to do it? when i went to compile i tried adding the vstsdk dir to the directories settings - maybe i need to add specific folders? currently i cant compile it - i keep getting lots of errors.
Hi,
this is quite correct, but you missed the SDK files: you need .cpp files in the 'common' directory, so add them to the project.
Moreover you need (only if you use it) the .RC file and the .DEF file.
Remember also that the linker needs some windows libraries to compile the GUI!
Here is the list of things you need in qmake language, but is easy to understand:
Code: [Select]
VST_SDK_PATH = C:\vstsdk2.3
VST_SDK_COMMON = $${VST_SDK_PATH}\source\common
SOURCES += \
$${VST_SDK_COMMON}\AudioEffect.cpp \
$${VST_SDK_COMMON}\audioeffectx.cpp \
$${VST_SDK_COMMON}\aeffguieditor.cpp \
$${VST_SDK_COMMON}\vstgui.cpp \
$${VST_SDK_COMMON}\vstcontrols.cpp
RC_FILE += resource\ADelayEditGUI.rc
DEF_FILE += ADelayEditGUI.def
LIBS += -luuid -lole32 -lgdi32 -lcomdlg32 -lvfw32
I included all 5 .cpp files, but you do not need all them if you don't use GUI.
There other things to know, so it is better if we open a new thread for this subject, may be useful for other too!

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #12 on: July 15, 2006, 02:48:41 pm »
thankyou for that info - i will work on it and get back to you - thanks again :D

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #13 on: July 15, 2006, 04:07:53 pm »
If I have time, I try to make a template for VST plugins.

I created an how-to (step by step) for Dev-Cpp, may be you need it for other informations (you have to make 2 little modifies to SDK source files to make them compile with MinGW (not needed for VisualStudio6).

Here the modifies needed (but it's better if you read all the file!):
Quote
Modify vstgui.cpp file as follows:
- in function 'checkResolveLink', cast 'wsz' using '(WCHAR *)' in line 7338 and line 7340
Modify the VSTnameEditMain.cpp file as follows:
- '#if BEOS'… becomes '#if __GNUC__ && (WIN32 || BEOS)'
- add 'asm("main")' to the end of the *main_plugin(…) definition line
- add 'extern "C"' to the beginning of the DllMain(…) definition (to get GUI to work)

Atteched there is the file.

Let me know if you find other useful infos and if can make it work!

The troubles I had with QT, may be are the same for wxWidgets (if you want ot use wxWidgets, else don't care about this!)
More infos on VST+wxWidgets here:
http://www.achitophelconsulting.com/index.php?option=com_content&task=view&id=31&Itemid=78&troozers=33534ca2cab90f665685b30330c6f70c

[attachment deleted by admin]
« Last Edit: July 17, 2006, 09:58:56 pm by iw2nhl »

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #14 on: July 16, 2006, 08:10:33 am »
Umm I dont have a "common" folder :( I am using VST SDK v 2.4 not 2.3 like you.

so what should i do? and how/where do i enter all that stuff into C++ once ive changed it to point to the right place?
Code: [Select]
VST_SDK_PATH = C:\vstsdk2.3
VST_SDK_COMMON = $${VST_SDK_PATH}\source\common
SOURCES += \
$${VST_SDK_COMMON}\AudioEffect.cpp \
$${VST_SDK_COMMON}\audioeffectx.cpp \
$${VST_SDK_COMMON}\aeffguieditor.cpp \
$${VST_SDK_COMMON}\vstgui.cpp \
$${VST_SDK_COMMON}\vstcontrols.cpp
RC_FILE += resource\ADelayEditGUI.rc
DEF_FILE += ADelayEditGUI.def
LIBS += -luuid -lole32 -lgdi32 -lcomdlg32 -lvfw32

thanks :)

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #15 on: July 16, 2006, 08:20:47 am »
i jst read that text file - it is very very detailed. Is there any chance you could make a walktrhough like this for using VST SDK plus codeblocks?

Offline mdelfede

  • Multiple posting newcomer
  • *
  • Posts: 84
Re: Howdy! Im a noob :)
« Reply #16 on: July 16, 2006, 02:13:11 pm »
.....
I noticed that there are 2 DLLs:
1) wxmsw26u_gcc_custom.dll
2) wxmsw26_gcc_custom.dll
The wiki says I need the first one (which has not been modified), while the second one has been modified (really I didn't notice it before!).
What's the difference between the 2 DLLs?

The firs one with 'u' should be the unicode version, used if you build C::B in unicode mode (default) the second one the ansi version, used if you build C::B in ansi mode... You must change something in project to do it, I've never done.

BTW, if the first one don't get modified compiling wxWidgets, you're doing that in Ansi mode.
Read the wiki for the compilation in unicode mode.

Ciao

Max

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #17 on: July 17, 2006, 03:33:03 pm »
Umm I dont have a "common" folder :( I am using VST SDK v 2.4 not 2.3 like you.

so what should i do? and how/where do i enter all that stuff into C++ once ive changed it to point to the right place?
Code: [Select]
VST_SDK_PATH = C:\vstsdk2.3
VST_SDK_COMMON = $${VST_SDK_PATH}\source\common
SOURCES += \
$${VST_SDK_COMMON}\AudioEffect.cpp \
$${VST_SDK_COMMON}\audioeffectx.cpp \
$${VST_SDK_COMMON}\aeffguieditor.cpp \
$${VST_SDK_COMMON}\vstgui.cpp \
$${VST_SDK_COMMON}\vstcontrols.cpp
RC_FILE += resource\ADelayEditGUI.rc
DEF_FILE += ADelayEditGUI.def
LIBS += -luuid -lole32 -lgdi32 -lcomdlg32 -lvfw32

thanks :)

1) VST 2.4 has changed completely the directory structure and I never used it, so I cannot help you with it.
If I'll find some time, I'll try to adapt the how-to to the new version.
Try to find the same files in 2.4 or use 2.3.

2) That code is NOT for C++, but are informations for the IDE (codeblocks).
eg. (this is the main thing to be done to make it compile):
LIBS += -luuid -lole32 -lgdi32 -lcomdlg32 -lvfw32
means that you have to add libraries to the linker (menu Project -> Build Options -> Linker):
click on the "Add" button for each library (uuid, ole32, gdi32, comdlg32, vfw32)

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #18 on: July 17, 2006, 03:38:38 pm »
BTW, if the first one don't get modified compiling wxWidgets, you're doing that in Ansi mode.
Read the wiki for the compilation in unicode mode.
You are right! I made a little mistake: I copied the wrong line to compile wxWidgets
(I used the one with UNICODE=0 instead of that with UNICODE=1)

Thank you very much!

Grazie e ciao!

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #19 on: July 18, 2006, 10:41:39 am »
1) VST 2.4 has changed completely the directory structure and I never used it, so I cannot help you with it.
If I'll find some time, I'll try to adapt the how-to to the new version.
Try to find the same files in 2.4 or use 2.3.

OK thanks....a walkthru using Code:blocks + VST SDK 2.4 would be much appreciated :)

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #20 on: July 19, 2006, 01:50:18 am »
Hi,
I just finished to make a VST project with C::B and VST 2.4.
It compiles and the DLL has the right exported functions (this was much trouble).
I have only 1 VST host installed in my system: it sees the plugin, read name/channels/... informations correctly, but does not give me the possibility to use it and I don't know why. (May be incompatibilities with 2.4 version???)
If you give me an email, I can send you the project and the DLL, so you can try it and say me if it works for you.

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #21 on: July 19, 2006, 06:11:30 am »
ok sent....ps why dont u try some various free hosts - like VSTHost, Reaper Beta, CMusic of a computer music CD, or even a demo of FL Studio or something?

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #22 on: July 22, 2006, 12:53:30 am »
OK that VST works totally fine in FL Studio 6.08 (I believe thats cause it supports VST 2.4).

Thats awesome - I know now it can be done - i now just gotta get it to compile on my pc :D

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #23 on: July 22, 2006, 01:01:48 am »
It should be very easy, only remeber to modify the variables in the CBP file (see the email) or put your VST SDK in the same dir as mine!
Remember to tell me if your DLL works as mine or not, this is important!

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #24 on: July 22, 2006, 03:41:20 pm »
OK it compiled ok with only some "malformed pragma" warnings, whatever that means....i ran it in FL Studio and it seems to work - it has no gui, no controls/knobs - but it definately does the delay effect....

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #25 on: July 23, 2006, 03:01:22 pm »
is there supposed to be a gui? i noticed vstgui files included in the project.

one question - i notice that you actually have added a bunch of files from the VST SDK directly into your project....is there a way i can set it up so that i dont see all those files in the project tree cause i dont want to open/edit them - i see the projects compile options is set up to point to the right folders, so why doesnt it compile unless the vst source files are literally added to the project?

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #26 on: July 23, 2006, 03:20:55 pm »
GUI
Definetly yes, it should have a GUI. I choose that sample because it seemed an almost complete plug-in.
You cannot see the GUI with neither my DLL nor your?

SDK source files
That files must be added because you can only specify directories for "include" files, generally header ".h" files.
This is to compile, but to have an executable, you need the object files to make the linker work.
To have object files, you must compile the SDK files.
This can be done only including the source files in the project (so they are compiled).
At least this is what I know.

I don't like this, but it is needed, as far as I know.
Anyway VisualStudio projects (bundled in the SDK) include SDK source files in the project too, so I think they are really needed.

If someone knows how to avoid including SDK source files in each project, please let us know!

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #27 on: July 23, 2006, 03:23:29 pm »
ok thanks for the explanation youve been so helpful man :) - and your dll has a gui, but when i compile it myself it didnt - ill try again tho....

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #28 on: July 23, 2006, 03:48:38 pm »
Perfect, this is exactly what I wanted to know, then 2.4 version has the same bug as the 2.3 version.
Here is how to make GUI work for you too:
- go to VST SDK and open this file (you can do this also from you project, the file is included):
public.sdk\source\vst2.x\vstplugmain.cpp
- add
Code: [Select]
extern "C" at the beginning of the lines 46, 48, 59
- done!

Here are the lines:
original
Code: [Select]
VST_EXPORT AEffect* main_macho (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); }
VST_EXPORT AEffect* MAIN (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); }
BOOL WINAPI DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpvReserved)
modified
Code: [Select]
extern "C" VST_EXPORT AEffect* main_macho (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); }
extern "C" VST_EXPORT AEffect* MAIN (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); }
extern "C" BOOL WINAPI DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpvReserved)

This change need to be done only once: you make it to the SDK source files!

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #29 on: July 23, 2006, 03:58:55 pm »
thankyou - i will try this as soon as i can :D

Offline matthewjumpsoffbuildings

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Howdy! Im a noob :)
« Reply #30 on: July 24, 2006, 11:17:58 am »
yep it has a gui now

aquila

  • Guest
Re: Howdy! Im a noob :)
« Reply #31 on: September 17, 2006, 06:09:52 pm »
I just finished to make a VST project with C::B and VST 2.4.
It compiles and the DLL has the right exported functions (this was much trouble).
I have only 1 VST host installed in my system: it sees the plugin, read name/channels/... informations correctly, but does not give me the possibility to use it and I don't know why. (May be incompatibilities with 2.4 version???)
If you give me an email, I can send you the project and the DLL, so you can try it and say me if it works for you.

Could you please send that project to me, too? I've been wrestling with C::B, VC++2003 Toolkit and the VST2.4 SDK since yesterday. While I finally got everything to compile okay, the plugins aren't recognized by my VST hosts (most likely a problem with the symbol exports).
And could you make that project available for download? I'm sure it would help a few other people over the initial problems with setting up a VST coding environment.


SDK source files
That files must be added because you can only specify directories for "include" files, generally header ".h" files.
This is to compile, but to have an executable, you need the object files to make the linker work.
To have object files, you must compile the SDK files.
This can be done only including the source files in the project (so they are compiled).
At least this is what I know.

I don't like this, but it is needed, as far as I know.
Anyway VisualStudio projects (bundled in the SDK) include SDK source files in the project too, so I think they are really needed.

If someone knows how to avoid including SDK source files in each project, please let us know!

I think this can be done, but the solution requires some manual work.

The key to the solution: you can pass object files manually to the linker; just add the filename (with complete path, absolute or relative) to the "Build Options"-"Linker/Other linker options" list. This gets treated like just any other argument, and is passed directly to the linker argument list when the linker is called. So you can add any object file to the linking stage without it being part of the current C::B project.

Applying this to VST projects: you need a precompiled .obj file for each of the VST SDK .cpp's you want to use, so that you can pass it to the linker in your other VST projects. I'd recommend setting up a special project which just compiles all the .cpp files in the VST SDK without linking anything.
If you want to build both release and debug versions, create separate object dirs for both variants, one for normal object files, the other compiled with debug settings.

To make a "clean" VST project, add all the required VST SDK object files from our "object-only" project to the linker options and remove each of the corresponding .cpp files from the project. This is important! If you don't remove the .cpp, the linker will compile the file and try to link both the project-internal .obj and the external one, which gives linking errors ("symbol XXX already defined in file XXX").
If you do both release and debug builds, you have to add the appropriate object files to both build targets.

If you compile now, the DLL should be built just as before - all external symbol references are resolved by the object files we are passing directly to the linker.
This results not only in a cleaner project view in the Management pane, but also avoids that the SDK sources are being recompiled each time you do a full rebuild.

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #32 on: October 03, 2006, 03:19:45 am »
Sure I can send you the project!
I'd like also to upload it here, but the last time I tried there was no free space left in the forum for the upload  :(.
I like your ideas about the include of object files, but unfortunately I have very little time now!
I can send you the project and you could try to modify it :). Then let me know if it works!
In the future I'd like to build a template or a wizard to create projects with CodeBlocks + VST (as I tried with Dev-C++), but until CB is stable it does not worthwhile.
Another solution (only graphical, not a full solution as your one) could be to use a new feature of CB: virtual directories (but I have not tried it yet). This is what VC++ does (AFAIK).
You could also mix the 2 ideas: make virtual folders with SDK source files (you may need to read them) and prepare 2 project, one for SDK compile and the other with your VST plug-in (then you need only one additional project for each new plug-in).

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Howdy! Im a noob :)
« Reply #33 on: October 03, 2006, 03:26:36 am »
Here is the project!

I write here the note I sent by email to matthewjumpsoffbu because you need it to use this project.
This is another problem to be solved!

Quote
I created a little project based on the 'adelay' sample. Then I noticed that in the 'adelay' dir, there are 2 projects: 'adelay' and 'surrounddelay'.
The first is without GUI, while the second has a GUI, so I opted for the second one.
My VST SDK is in C:\VST\vstsdk2.4 and you must adapt the project file 'VST.cbp' to you dir (another way is to install your SDK in the same dir as mine).
To adapt the project, modify it with a text editor before opening it with C::B!
line 33 (internal variable, used for headers and def file):
                <Variable name="VST_SDK_PATH" value="C:\VST\vstsdk2.4" />
line 53, 58, 63, 68, 73, 78:
        <Unit filename="C:\VST\vstsdk2.4\public.sdk\source\vst2.x\[...].cpp">

In order to have a working GUI in your plug-ins, you need to modify the VST source files (I think it is a little incompatibility between MS VC++ compiler and MinGW). For the modify, see my previous post (always in this thread): http://forums.codeblocks.org/index.php?topic=3541.msg28706#msg28706

Another thing: I compiled VST also with Dev-C++ and I made a VST plug-in with GUI using the Trolltech toolkit Qt instead of the GUI libraries bundled with the VST SDK.
If you need info about any of the two, let me know.

[attachment deleted by admin]
« Last Edit: November 17, 2006, 04:50:18 pm by iw2nhl »