Login / Register  0 items | $0.00 NewWhat is KVR? Submit News Advertise
tunca
KVRist
 
390 posts since 26 Mar, 2015

Postby tunca; Tue Sep 12, 2017 12:17 pm Calling variable from inl to cpp (WDL-OL)

I'm trying to call my variable (double) from inl file to cpp file.But i can't...

Any idea?

Thanks.
http://analogobsession.com/ VST,AU for WIN & MAC
Mayae
KVRian
 
515 posts since 1 Jan, 2013, from Denmark

Postby Mayae; Tue Sep 12, 2017 4:43 pm Re: Calling variable from inl to cpp (WDL-OL)

Your question doesn't really make much sense. It sounds like you have some linkage problems, and also be sure to post any errors you get - you would probably also get more help on a dedicated programming forum like stackoverflow
tunca
KVRist
 
390 posts since 26 Mar, 2015

Postby tunca; Tue Sep 12, 2017 11:49 pm Re: Calling variable from inl to cpp (WDL-OL)

Mayae wrote:Your question doesn't really make much sense. It sounds like you have some linkage problems, and also be sure to post any errors you get - you would probably also get more help on a dedicated programming forum like stackoverflow


Already asked but didn't get any answer...

I just need to call a variable from .inl file.

"inl" files are combination of .h and .cpp files but i can figure it out...
http://analogobsession.com/ VST,AU for WIN & MAC
resynthesis
KVRist
 
262 posts since 17 Sep, 2007, from Planet Thanet

Postby resynthesis; Wed Sep 13, 2017 12:26 am Re: Calling variable from inl to cpp (WDL-OL)

The usual one I've seen is multiple definition errors when using inl variables in multiple files. Is that the problem here?
tunca
KVRist
 
390 posts since 26 Mar, 2015

Postby tunca; Wed Sep 13, 2017 12:57 am Re: Calling variable from inl to cpp (WDL-OL)

resynthesis wrote:The usual one I've seen is multiple definition errors when using inl variables in multiple files. Is that the problem here?


I'm calling my variable with "extern".

Trying to call my gain reduction from .inl file to main.cpp.

In .inl file;

Code: Select all
extern double GaRe;


And then i'm writing "GaRe" to where i want...

But getting error like this;

Code: Select all
Undefined symbols for architecture i386:
  "_GaRe", referenced from:
http://analogobsession.com/ VST,AU for WIN & MAC
resynthesis
KVRist
 
262 posts since 17 Sep, 2007, from Planet Thanet

Postby resynthesis; Wed Sep 13, 2017 1:12 am Re: Calling variable from inl to cpp (WDL-OL)

My C++ is pretty rusty so beware...

Do you declare the double GaRe in a cpp / h file as well? I think you have to declare double GaRe one cpp/h file and use extern elsewhere
tunca
KVRist
 
390 posts since 26 Mar, 2015

Postby tunca; Wed Sep 13, 2017 1:18 am Re: Calling variable from inl to cpp (WDL-OL)

resynthesis wrote:My C++ is pretty rusty so beware...

Do you declare the double GaRe in a cpp / h file as well? I think you have to declare double GaRe one cpp/h file and use extern elsewhere


GaRe declared in .inl file.

"inl" is combination of cpp and h.So declared in one cpp/h.But no luck to call it.Compiler can't found it,i guess...
http://analogobsession.com/ VST,AU for WIN & MAC
User avatar
Rockatansky
KVRist
 
71 posts since 3 Jun, 2017, from the Thunderdome

Postby Rockatansky; Wed Sep 13, 2017 1:23 am Re: Calling variable from inl to cpp (WDL-OL)

To the best of my knowledge, an .inl file is just a .h file that contains not just the declaration but also the implementation, basically an inline declaration. So far, I've never met or used anything that uses the .inl extension, I guess it's just for convenience, to signal that in this case there's no related .cpp file.

I don't know if different compilers handle things differently, but I just use .h files and inline declare & implement everything all at once inside those, and that works just fine in Visual Studio and XCode. I do something similar to what I think you're trying to do, where I write version variables into a .h file. I just include the .h file into the correct namespace and that's that, variable becomes available everywhere. Doesn't require an .inl file or anything special.

The only thing to look out for really is that you include the .h file at the beginning of the .cpp file, or that it is included before the .cpp file.

Update: whoops, just had a look and I don't really use variables for that, I use #define statements.
Confucamus.
tunca
KVRist
 
390 posts since 26 Mar, 2015

Postby tunca; Wed Sep 13, 2017 1:40 am Re: Calling variable from inl to cpp (WDL-OL)

Rockatansky wrote:To the best of my knowledge, an .inl file is just a .h file that contains not just the declaration but also the implementation, basically an inline declaration. So far, I've never met or used anything that uses the .inl extension, I guess it's just for convenience, to signal that in this case there's no related .cpp file.

I don't know if different compilers handle things differently, but I just use .h files and inline declare & implement everything all at once inside those, and that works just fine in Visual Studio and XCode. I do something similar to what I think you're trying to do, where I write version variables into a .h file. I just include the .h file into the correct namespace and that's that, variable becomes available everywhere. Doesn't require an .inl file or anything special.

The only thing to look out for really is that you include the .h file at the beginning of the .cpp file, or that it is included before the .cpp file.

Update: whoops, just had a look and I don't really use variables for that, I use #define statements.


Oh thanks!

Now i made .h file and removed .inl.And everything working as it should be.

And now how to call my variable?

Tried extern but still same...
http://analogobsession.com/ VST,AU for WIN & MAC
tunca
KVRist
 
390 posts since 26 Mar, 2015

Postby tunca; Wed Sep 13, 2017 2:01 am Re: Calling variable from inl to cpp (WDL-OL)

Now i called my GaRe!

Thanks for all your helps!
http://analogobsession.com/ VST,AU for WIN & MAC
stratum
KVRian
 
1262 posts since 29 May, 2012

Postby stratum; Wed Sep 13, 2017 4:29 am Re: Calling variable from inl to cpp (WDL-OL)

That GaRe variable looks like a global. Are you sure you want to do that?
~stratum~
tunca
KVRist
 
390 posts since 26 Mar, 2015

Postby tunca; Wed Sep 13, 2017 5:28 am Re: Calling variable from inl to cpp (WDL-OL)

stratum wrote:That GaRe variable looks like a global. Are you sure you want to do that?


Actually i'm trying to call my gain reduction of compressor to trigger vu meter but no luck.

When input peak around -3/0dB,meter show correct values.But under -3dB,meter shows really low gain reduction value.For example if exact gr about 8dB,meter show max 2dB...

Is there any way to make input normalized? Cause if i send normalized input to meter,it will show correct value every time...
http://analogobsession.com/ VST,AU for WIN & MAC
stratum
KVRian
 
1262 posts since 29 May, 2012

Postby stratum; Wed Sep 13, 2017 8:22 am Re: Calling variable from inl to cpp (WDL-OL)

Actually i'm trying to call my gain reduction of compressor to trigger vu meter but no luck.


What's wrong with just calling it? Aren't they parts of the same plugin?
~stratum~
tunca
KVRist
 
390 posts since 26 Mar, 2015

Postby tunca; Wed Sep 13, 2017 8:27 am Re: Calling variable from inl to cpp (WDL-OL)

stratum wrote:
Actually i'm trying to call my gain reduction of compressor to trigger vu meter but no luck.


What's wrong with just calling it? Aren't they parts of the same plugin?


I'm calling it.No problem about it anymore.

But my gain reduction working really weird.Meter shows reduction with no reduction.

It can't show exact values while compressing...
http://analogobsession.com/ VST,AU for WIN & MAC
stratum
KVRian
 
1262 posts since 29 May, 2012

Postby stratum; Wed Sep 13, 2017 8:36 am Re: Calling variable from inl to cpp (WDL-OL)

But my gain reduction working really weird.Meter shows reduction with no reduction.

It can't show exact values while compressing...


Looks like a design problem only you can know.

I'd try to measure the input level average and the output level average and show the difference in between in decibels, but that would be my design, and I don't know what might be wrong with yours.
~stratum~
Next

Moderator: Moderators (Main)

Return to DSP and Plug-in Development

Who is online

Users browsing this forum: Architeuthis, CCBot (commoncrawl), Google Feedfetcher