OS : Ubuntu 14.04
SDK : Qt 5.5
library : "ion.h" [ I have built ion-dtn 3rd party library from source and it has ion.h file which I am using in my 2 projects ]
I am using ion.h in my 2 projects in same development system. Both projects are based on Qt. On including ion.h One project runs without any compilation error , other complains about MAXPATHLEN.
/usr/local/include/ion.h:60: error: 'MAXPATHLEN' was not declared in this scope
char pathName[MAXPATHLEN + 1];.
On project where it's running fine , I can click on ion.h and found MAXPATHLEN is highlighted with blue, obviously means qt can find it and on clicking "follow under symbol" I found its declared in param.h under sys directory.
I cant do the same in my other project. On clicking ion.h MAXPATHLEN is in black colour and couldnt able to find param.h when I click follow under symbol.
I have compared and my .pro files are same in both projects. Can soemone please guide me what I am doing wrong. Thanks
MAXPATHLENis declared in<sys/param.h>. One project must include it (or another header file including it...like<QDir>for instance, it's hard to tell) while the other does not.Simply include
<sys/param.h>before you includeion.hyourself to solve the problem.If you really want to figure out who's including this file and then identify why
MAXPATHLENis defined in one project, there are compiler options for that (like/showIncludesfor g++).