Getting #error “No global header file was included!” and not using projucer

I have an old project created many years ago with the introjucer. I originally built it on windows and unix. After creating the project, I never used the introjucer, only worked from VS. (very large project). I am now trying to build if to run in a raspberry pi. I put all the code in the pi, and started building the the old Makefile. I am hitting the error:
#error “No global header file was included!”
I don’t think there is a way to pull this project in to the projucer at this point. Since I can’t have the projucer “magically” fix this problem, how do I manually fix it?

Are you using the same version of JUCE as you were for the original project? If not then you’re bound to have issues since a lot of breaking changes happen between major versions.

no, but it does all build and run with windows.

I would try to port the project settings you did. in VS back then back to the Projucer/Introjucer. While that might take you e.g. an hour of work it might save you quite a lot trouble in the long run, also when considering to update your project to a newer JUCE version

I have the mixer.jucer used originally, but the project was the managed completely in vs. I dont think I have an introjucer binary anymore and I have not used the projucer to create a project.

How do I build a projucer project from scratch using already create .cpp and .h files?

I tried creating an audio project, and then replaced the Main.cpp and MainComponent.* files. Copied all cpp and h files to the source directory. Then clicked add existing files and included all the rest.
Tried building the result in windows. Got 'millions of errors, overwelming. Is this the right approach?

I didn’t try it so far. Still using the projucer here, but i would try to use the new CMake features by JUCE 6 to setup the project instead of trying to make it run with the projucer.
This way you are prepared for the future and you may build it on every platform.

First of all, I never did something similar, so this is pure theory, but I think there are chances it works…

So first of all how do your manage your project and all its dependencies? Do you use a git-based workflow or did you download a copy of JUCE back then and use that sources to build the project?

A well structured git controlled project should have JUCE as a submodule so that you know exactly on which JUCE commit your old project is built. If not, do you have a rough estimate which version of JUCE you used? Looking at the release tags of the official JUCE repository hosted on GitHub I can see that they date back until Version 1.51

My approach would be to check out the release of JUCE that your project is built on and try to build the Introjucer coming with it (although I have to admit that I started with JUCE 4 so I don’t exactly know how the old stuff was managed – but I guess you can build the old Introducer yourself just as you normally build the current Projucer yourself). You might need an old version of VS for that, but I assume you use one anyway as you are able to build that old project

Depends a bit on the type of project you are doing, so I’d either chose the basic command line or GUI application template (although again I don’t exactly know how the old tools looked like but I assume a basic structure that can be compared). Then, as you said add all source files, select the modules you use in your project and adjust VS specific settings you might have applied in your VS project to the according VS exporter fields.

I guess that’s because a lot changed in JUCE in between and you tried to build your project with the current JUCE dev/master tip?

If everything I wrote above worked and you are able to build the project with an old version of JUCE and you want to port it to the latest JUCE version, I would now start to use Git for your project if you don’t do it already, add JUCE as a submodule and then start stepping up JUCE releases a bit. Try building and see when you hit breaking changes. Update your code, update the .jucer file with a projucer matching the release you checked out and iterate. This might be a lot of work but probably a lot easier to handle than jumping between e.g. JUCE 2 and JUCE 6 immediately :grin:

Once you aligned your project code to the current JUCE 6 tip, thinking about a switch to CMake could be a good idea. I recently ported a previously Projucer based project from JUCE 5 to JUCE 6 and after that switched to CMake which worked very well.

1 Like

I don’t use git. I’m old school cvs. But My cvs history only goes back to 2016, and I started the project long before that. I started it by taking a demo project and building on it. I later got it to the introjucer to create the make file and that is all I did with it. All other work was outside of introjucer.
This was probably 2010-2012.
The problems I see with projucers output makes me think I am simply working to fix the “global header” and modifing my makefile as needed. It appears I have all my source are files building but the juce library files are failing. Since windows builds I should be able to get unix to build if the make file is right.

So what does this error tell me?