Welcome to %s forums

BrainModular Users Forum

Login Register

error LNK2019: on new SDK

Create your own modules in C++
Post Reply
User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 27 Jun 2013, 01:05

I have a go with the SDK
I am totally newbie in C++ and VSE2012 !

I have this error with VSE 1012 while trying to compile the template module:

1>UserModule.obj : error LNK2019: symbole externe non résolu "void __cdecl CreateModule(void * &,char *,int,struct MasterInfo *,char *)" (?CreateModule@@YAXAEAPEAXPEADHPEAUMasterInfo@@1@Z) référencé dans la fonction Create
1>....buildsVisualStudio2012DebugTemplateModuleTemplateModule.usr-win64 : fatal error LNK1120: 1 externes non résolus

that would be great to have a tiny module with one datafield input and one output for the newbies to tinker...

compare to the script module, the SDK is way to difficult to play without a strong knowledge of C++ !

cheers.

Olivar

details of the VSE install :
Microsoft Visual Studio Express 2012 pour Windows Desktop
Version 11.0.60315.01 Update 2
Microsoft .NET Framework
Version 4.5.50709

Version installée : Desktop Express

Team Explorer pour Visual Studio 2012 05695-004-0030004-02486
Microsoft Team Explorer pour Visual Studio 2012

Visual Basic 2012 05695-004-0030004-02486
Microsoft Visual Basic 2012

Visual C++ 2012 05695-004-0030004-02486
Microsoft Visual C++ 2012

Visual C# 2012 05695-004-0030004-02486
Microsoft Visual C# 2012

Gestionnaire de package NuGet 2.0.30717.9005
Gestionnaire de packages NuGet dans Visual Studio. Pour plus d'informations sur NuGet, consultez http://docs.nuget.org/.

SQL Server Data Tools 11.1.20828.01
Microsoft SQL Server Data Tools
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 27 Jun 2013, 10:38

oups, seems like i forgot to update a function in the template module project :|

in TemplateModule.cpp file, line 59, the CreateModule function miss a parameter at the end :

Code: Select all

void CreateModule (void* &pModule, AinsiCharPtr optionalString, LongBool Flag, MasterInfo* pMasterInfo)
should be

Code: Select all

void CreateModule (void* &pModule, AinsiCharPtr optionalString, LongBool Flag, MasterInfo* pMasterInfo, AinsiCharPtr optionalContent)
for some simple example module, you can look at DelayArray or RollArray, how have only three params.

but yes, a complete "hello world" template module with only 1 parameter is a good idea, in fact it's what i have planned, but time is....short !

i'll finish it, but you can do it as an exercise ;) there are just three simple modifs to do in the TemplateModule.cpp file :

line 97 : change the param number to 1

Code: Select all

pModuleInfo->NumberOfParams     = 1;
line 113 to 125 : replace the commented block by this

Code: Select all

        // Add all parameters declared in the module class, example :

        // m_txtfExample
        case 0:
	        pParamInfo->ParamType		= ptTextField;
	        pParamInfo->Caption			= "text";
	        pParamInfo->TextValue              = "hello world";
	        pParamInfo->IsInput			= TRUE;
	        pParamInfo->IsOutput		= TRUE;
	        break;
and line 133 to 139: replace the commented block by this (the m_txtfExample is a parameter pointer allready declared in the include file)

Code: Select all

        // Initialyse all events adress declared in your module class, Example :
	
        // m_txtfExample
        case 0:
	        m_txtfExample = pEvent;
	        break;
with that, you should have a one textfield param module with caption set to "text" and text value set to "hello world"
from here, you can look in other module code to see how to replace the textfield by a datafield or a datafader

anyway, i'll post a corrected package today (where i'll replace the texfield by a datafield)
hope it help
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 27 Jun 2013, 11:46

Thanx a lot,
I know what I'll do tonight until late !

cheers
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 27 Jun 2013, 11:49

could'nt wait tonight ! its working fine now : the pandora's box is open !
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 27 Jun 2013, 12:37

cool,

one important thing when trying to survive with all this c++ crap :
remember than apart from the language syntax and all the glue code, the sdk structure is very similar to what you do in an usine script


the 'essential' stuff

Code: Select all

moduleInfos : 
description and infos about the module content and behavior

paramInfo : 
some infos to define each params (paramIndex go from 0 to moduleInfo->NumberOfParams - 1)

setEventAdress :
for each params usine create, we store his handle for future use (paramIndex same as above)

callback : 
when an action is performed to the param, we are informed here (paramIndex same as above)
possibly use some param handle to do some stuff

process : 
executed in sync withe usine audio block (only if moduleInfo->DontProcess isn't set to FALSE)
possibly use some param handle to do some stuff
happy coding
Martin FLEURENT - Usine Developer - SDK maintainer

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 27 Jun 2013, 13:29

Would it be a good idea to add a very simple example where all the stuff concerning graphics, mouse, chunks etc is removed?

Since the new script engine (so far) is rather slow, I reckon a lot of users would like to go the SDK route, but opening the template with all it's new stuff can be rather intimidating and confusing.
Bjørn S

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 27 Jun 2013, 13:46

yes, good idea, i know we have to make the transition from script as easy as possible

but the purpose of the template module is actually to prepare all these methods for the user.

so, maybe the solution is a hello world module, with the minimum to make a functional module able to replace a script module
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 27 Jun 2013, 19:02

yes, I vote for a ScriptDK !
an easy entry point to SDK for simple tasks !
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 28 Jun 2013, 08:31

BTW, while we're on the subject of simplifying things, I think it would be a good idea to split the header files up, moving all the stuff concerning device drivers and plugsins to separate files.
Bjørn S

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 28 Jun 2013, 10:09

bsork wrote:BTW, while we're on the subject of simplifying things, I think it would be a good idea to split the header files up, moving all the stuff concerning device drivers and plugsins to separate files.
can you elaborate please. i can't figure it

i vaguely see about separating the basic stuff from the very specific one, but what do you mean by 'split the header files up' ?
is it to split the UsineDefinitions.h into more than one file ?
or the UserModule.h ?
Martin FLEURENT - Usine Developer - SDK maintainer

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 28 Jun 2013, 11:26

I'm at work and I don't remember what is where. I'll be more specific when I've had the time to look through the files.
Bjørn S

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 28 Jun 2013, 11:46

Tada !
I think I understood few things thru trial and error, mostly errors...
here is my first user module :
incrementor
I plan to use it to interface manual square generators (aka rotary encoders) with Usine.
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 28 Jun 2013, 18:21

@martignasse:
I was thinking of separating out the stuff I guess is only of use for the special kinds of ModuleTypes like mtDeviceAudio and mtPluginLister, but maybe I've misunderstood what parts of the SDK can be used where and when.
Bjørn S

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 02 Jul 2013, 14:25

bsork wrote:I was thinking of separating out the stuff I guess is only of use for the special kinds of ModuleTypes like mtDeviceAudio and mtPluginLister, but maybe I've misunderstood what parts of the SDK can be used where and when.
ok, i see what you mean, but it's not really applicable (nightmare to maintain, consistency problems...)

the strong idea with the Hollyhock SDK is that the UserModuleBase object wrap all you need to make any kind of module and you pick what you need for your use case.
it's clearly a C++ object oriented approach and differ from what is done in plain C

but we have room for simplification and improvement :)
the next SDK release will have a basic template ready for simple modules (TemplateModuleSimple) in addition of the current one.
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 03 Jul 2013, 15:43

Oh ! I've done my assignment :
Hello World !


Cheers

olivar
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 03 Jul 2013, 16:35

Congratulations :cool:

welcome in the SDK world
but be careful, if you love it, you'll see the "tentacular" side of it ;)
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 05 Jul 2013, 13:27

@Oli_lab:
there's an old user module ( DisplayNumber.usr-win32) in the hollyhock version of your Incrementor add-on

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 06 Jul 2013, 00:42

fuzzy logic
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 06 Jul 2013, 21:32

@Nay : I updated the file.
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 06 Jul 2013, 22:17

ok, thanks Oli_Lab, i will test it

Post Reply

Who is online

Users browsing this forum: No registered users and 127 guests