# ProjectInfo

**URL:** <https://forum.juce.com/t/projectinfo/22960>\
**Category:** General JUCE discussion\
**Created:** [June 17, 2017, 8:49am UTC](https://forum.juce.com/t/projectinfo/22960 "2017-06-17T08:49:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [June 17, 2017, 8:49am UTC](https://forum.juce.com/t/projectinfo/22960/1 "2017-06-17T08:49:13Z")

</div>

Couild ProjectInfo be moved to the top of the AppConfig.h flie so it can be used by modules?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 19, 2017, 9:59am UTC](https://forum.juce.com/t/projectinfo/22960/2 "2017-06-19T09:59:12Z")

</div>

It could… though it may not exist, depending on the user’s settings.

You could actually use it without needing it to be moved though, if you declare it as extern inside your module, e.g.

```
namespace ProjectInfo
{
    extern const char* const ProjectInfo::projectName;

```

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [June 19, 2017, 10:01am UTC](https://forum.juce.com/t/projectinfo/22960/3 "2017-06-19T10:01:16Z")

</div>

Of course. Nice one.

Why might it not exist? It’d be handy to be able to get a project name and version in some kind of generic way. (It’s for an error reporting and analytics module I use in different projects).

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 19, 2017, 10:05am UTC](https://forum.juce.com/t/projectinfo/22960/4 "2017-06-19T10:05:46Z")

</div>

It may not exist if the user is just including modules in their non-projucer-generated project, which is a totally valid thing to do, and there’s no obligation for them to provide that header file at all.

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [June 19, 2017, 10:47am UTC](https://forum.juce.com/t/projectinfo/22960/5 "2017-06-19T10:47:14Z")

</div>

Oh that’s ok … I can ignore that case!

---

<div class="post-metadata">

**Author:** ![bayu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bayu/32/10757_2.png) [@bayu](https://forum.juce.com/u/bayu)\
**Post date:** [February 16, 2022, 1:08pm UTC](https://forum.juce.com/t/projectinfo/22960/6 "2022-02-16T13:08:30Z")

</div>

I tried to add the following in one of my juce module header

```auto
namespace ProjectInfo
{
    extern const char* const ProjectInfo::projectName;
    extern const char* const ProjectInfo::companyName;
    extern const char* const ProjectInfo::versionString;
    extern const int ProjectInfo::versionNumber;
}

```

But got this warning and error on XCode 13.2.1 with Projucer 6.1.5

> [@](#):
>
> Warning : Extra qualification on member ‘projectName’  
> Error : No member named ‘projectName’ in namespace ‘ProjectInfo’

It doesn’t compiled.

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [February 16, 2022, 1:36pm UTC](https://forum.juce.com/t/projectinfo/22960/7 "2022-02-16T13:36:46Z")

</div>

Probably doesn’t need those ProjectInfo:: inside the namespace curly braces

---

<div class="post-metadata">

**Author:** ![bayu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bayu/32/10757_2.png) [@bayu](https://forum.juce.com/u/bayu)\
**Post date:** [February 16, 2022, 1:44pm UTC](https://forum.juce.com/t/projectinfo/22960/8 "2022-02-16T13:44:49Z")

</div>

without those `ProjectInfo::` got this error

> [@](#):
>
> 8 duplicate symbols for architecture x86\_64

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [February 16, 2022, 3:18pm UTC](https://forum.juce.com/t/projectinfo/22960/9 "2022-02-16T15:18:46Z")

</div>

I dont’ think extern things should cause a duplicate symbol… should cause it to point to one that exists somewhere 😕

---

<div class="post-metadata">

**Author:** ![bayu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bayu/32/10757_2.png) [@bayu](https://forum.juce.com/u/bayu)\
**Post date:** [February 16, 2022, 4:10pm UTC](https://forum.juce.com/t/projectinfo/22960/10 "2022-02-16T16:10:30Z")

</div>

I also have tried to move

```auto
namespace ProjectInfo
{
    const char* const projectName = "Application Name";
    const char* const companyName = "";
    const char* const versionString = "1.0.0";
    const int versionNumber = 0x10000;
}

```

to the top of JuceHeader.h, before the modules `#include` lines, but no cigar.

The only way to make it compiled is, rebuilding the project with Global AppConfig header (previously disabled). And move the `ProjectInfo` namespace to the top of AppConfig header user section.

Now, my modules could access those variables even without `extern` as @jules suggested.

So yes please,

> [@jimc](#):
>
> Couild ProjectInfo be moved to the top of the AppConfig.h flie so it can be used by modules?

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [February 16, 2022, 5:21pm UTC](https://forum.juce.com/t/projectinfo/22960/11 "2022-02-16T17:21:15Z")

</div>

I think better practice would be to hand the information down in class constructors, that way the user is free to supply the information from ProjectInfo::projectName or any other string in the calling code.

---

<div class="post-metadata">

**Author:** ![bayu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bayu/32/10757_2.png) [@bayu](https://forum.juce.com/u/bayu)\
**Post date:** [February 16, 2022, 7:14pm UTC](https://forum.juce.com/t/projectinfo/22960/12 "2022-02-16T19:14:28Z")

</div>

I have modules which provide helpers for calling NativeMessageBox, FileChooser (for saving and loading presets), etc. which need those information on ProjectInfo, which should be consistent either it was audio plug-ins or standalone outside its class scope.
