Halp! I get an "invalid integer constant expression" error in "#if JUCE_USE_FLAC || defined (DOXYGEN)" in the VS2015 build


#1

I used Projucer to make a dll solution for VS 2015, then I copied all the files in “JUCE\examples\audio plugin host\source” to a subdirectory in my project’s directory, then I added those files to the “source” node in the solution tree in VS, then I uncommented some #define statements in Appconfig.h such as “#define JUCE_USE_FLAC”, then I loaded the solution in Projucer again and added the module “juice_audio_utils” because I discovered that something I enabled by uncommenting its “#define” statement needed it, then I loaded the solution in VS again and tried to build it and I got this error: “1>d:\juce\modules\juce_audio_formats\codecs\juce_flacaudioformat.h(25): fatal error C1017: invalid integer constant expression (compiling source file …\Source\GraphEditorPanel.cpp)” and three others like it in different .cpp files. Each error when I click on it highlights Line 25 in juce_FlacAudioFormat.h: “#if JUCE_USE_FLAC || defined (DOXYGEN)”

Am I doing something wrong?

Btw, my end goal is to create a Python DLL that can run VST3 files and to be able to control the flow of VST input/output audio signals and VST3 user parameter inputs from Python. I know nothing about how to make JUCE’s audio plugin host actually work or how to make DLL’s, just in case anyone wants to give me pointers in those directions too.


#2

I added those files to the “source” node in the solution tree in VS

You should always close VS add new files in the projucer then click Save Project and Open in IDE…, this will regenerate your VS project for you and overwrite any changes you have made to the VS project files!

I uncommented some #define statements in Appconfig.h such as “#define JUCE_USE_FLAC”

Don’t ever edit the AppConfig.h file directly as it is always regenerated when you save from the Projucer, there is an exception to this rule, to find out more read the comment at the very top of AppConfig.h.

Also JUCE_USE_FLAC needs to be defined as 1 defining it as nothing is probably whats causing the “invalid integer constant expression” error.

To define this value goto Projucer >> Config >> juce_audio_formats >> JUCE_USE_FLAC >> Enabled below is a screenshot of where you should go to change this.

I loaded the solution in Projucer again and added the module “juice_audio_utils” because I discovered that something I enabled by uncommenting its “#define” statement needed it

I suspect something has gone wrong here because if you saved from the Projucer it would have removed the work you had previously done as mentioned above.

Also each of the modules define which other modules they depend on in the module header, the Projucer helpfully reads this information, it will warn you if you are missing any dependencies and at a click of a button can add them for you. I wouldn’t suggest going around changing definitions inside of JUCE it’s just not designed to be used like that. Again see below for an example of the missing module dependencies.


#3

Ok, it works so far. Thanks!

By the way, you said that all files should be added with Projucer, and that when you save it it overwrites any changes one made in VS to the project files. That means I can’t make any changes in VS if I ever want to add another file! (or probably if I want to add another module or enable another feature of JUCE…). By project files, do you mean source code too, or are ‘project files’ only files that store project settings? Either way, this sounds problematic… what are we supposed to do if we want to change project configuration options that are only available in VS, and we may want to add a module or enable something or add a source file in Projucer in the future? (and if ‘project files’ includes source files too, what if we simply want to work on our project at all in VS…)


#5

Generally speaking there are two ways of working.

1.) Only save / commit / track the .jucer project file and limit yourself to what can be changed from there ONLY!

2.) Use the Projucer to create an initial project and save / commit / track the actual VS project files, and changes you make in the future including adding new modules / source file would all need to be done manually

You could also just do everything manually if you’re really hardcore :wink:

It’s rare that you hit issues which can’t be solved in the Projucer, most of the project settings you require are accessible. If you find there is something, you can always add a field to the Projucer and suggest the changes on here, some may be able to tell you where and what you can change to achieve the same result without making a change to the Projucer. On the other hand if the change in the Projucer is useful then the JUCE team may well consider adding it so we can all benefit from the change.

The only thing I can think of that I miss using with the first method is per file compiler flags.

It would be completely unreasonable and unpractical for the Projucer to somehow sync with the generated projects, there are waaay too many edge cases to consider in this scenario, it would get very hairy very quickly! trust me it’s not the right solution.

It’s also worth pointing out the benefits that using the Projucer gives you, such as easily generating other project files, new version of VS comes out no problem, need to do a build with older version of VS, no problem, want a make file, need an xcode project, etc.


#6

Ok, thanks for the clear responses.

Is editing source files something that has to be done in Projucer (i.e. something that Projucer will undo if it was done in VS and you use Projucer to make any changes), or only adding files and changing project settings?

Btw, I just noticed your last name. My last name is Nichols.


#7

On another note, I realized I may have been naive to think that I could just make this a .dll and modify it a little and export functions to load VST files, route signals, input things, etc. Probably all of its individual functions depend on the main program running, in which case I’d have to modify it to interact with Python via COM (Component Object Model) instead of direct function calls, which means there’s no point in making it a .dll instead of making it an .exe and just starting it up from within the Python program. Is this correct?


#8

Is editing source files something that has to be done in Projucer (i.e. something that Projucer will undo if it was done in VS and you use Projucer to make any changes), or only adding files and changing project settings?

No you can change the contents of any of your own source files just fine, AppConfig.h is the exception to the rule as mentioned above. Actually I find editing files in Projucer quite annoying compared to any other editors so I think that would put a lot of people off. The Projucer just holds references to the files on disk and uses those references when creating the VS project.


#9

It’s perfectly fine to just generate the project initially via Projucer then never touch it again in favor of just doing everything within VS. I personally find it really irritating to use the jucer for project settings and such. I just do everything natively in VS, then transfer it all back into Projucer when I’m done