dborth / libwiigui

UI Framework for Wii Applications

Home Page:http://wiibrew.org/wiki/Libwiigui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'MAXPATHLEN' was not declared in this scope

Kaher19 opened this issue · comments

I can't compile the example, because I got this issue
filebrowser.cpp
In file included from c:/libwiigui/source/filebrowser.cpp:18:0:
c:/libwiigui/source/filebrowser.h:21:11: error: 'MAXPATHLEN' was not declared in this scope
char dir[MAXPATHLEN]; // directory path of browserList

Then of this, a lot of errors are displayed:
c:/libwiigui/source/filebrowser.cpp: In function 'int UpdateDirName()':
c:/libwiigui/source/filebrowser.cpp:66:29: error: 'struct BROWSERINFO' has no member named 'dir'
sprintf(temp,"%s",browser.dir);
^~~
c:/libwiigui/source/filebrowser.cpp:75:25: error: 'struct BROWSERINFO' has no member named 'dir'
size = strlen(browser.dir) - size - 1;
^~~
c:/libwiigui/source/filebrowser.cpp:76:11: error: 'struct BROWSERINFO' has no member named 'dir'
browser.dir[size] = 0;
^~~
c:/libwiigui/source/filebrowser.cpp:84:23: error: 'struct BROWSERINFO' has no member named 'dir'
if ((strlen(browser.dir)+1+strlen(browserList[browser.selIndex].filename)) < MAXPATHLEN)
^~~
c:/libwiigui/source/filebrowser.cpp:84:80: error: 'MAXPATHLEN' was not declared in this scope
if ((strlen(browser.dir)+1+strlen(browserList[browser.selIndex].filename)) < MAXPATHLEN)
^~~~~~~~~~
c:/libwiigui/source/filebrowser.cpp:87:20: error: 'struct BROWSERINFO' has no member named 'dir'
sprintf(browser.dir, "%s/%s",browser.dir, browserList[browser.selIndex].filename);
^~~
c:/libwiigui/source/filebrowser.cpp:87:41: error: 'struct BROWSERINFO' has no member named 'dir'
sprintf(browser.dir, "%s/%s",browser.dir, browserList[browser.selIndex].filename);
^~~
c:/libwiigui/source/filebrowser.cpp: In function 'int FileSortCallback(const void*, const void*)':
c:/libwiigui/source/filebrowser.cpp:121:79: error: 'stricmp' was not declared in this scope
return stricmp(((BROWSERENTRY *)f1)->filename, ((BROWSERENTRY *)f2)->filename);
^
c:/libwiigui/source/filebrowser.cpp: In function 'int ParseDirectory()':
c:/libwiigui/source/filebrowser.cpp:131:15: error: 'MAXPATHLEN' was not declared in this scope
char fulldir[MAXPATHLEN];
^~~~~~~~~~
c:/libwiigui/source/filebrowser.cpp:138:10: error: 'fulldir' was not declared in this scope
sprintf(fulldir, "%s%s", rootdir, browser.dir); // add currentDevice to path
^~~~~~~
c:/libwiigui/source/filebrowser.cpp:138:44: error: 'struct BROWSERINFO' has no member named 'dir'
sprintf(fulldir, "%s%s", rootdir, browser.dir); // add currentDevice to path
^~~
c:/libwiigui/source/filebrowser.cpp:144:19: error: 'struct BROWSERINFO' has no member named 'dir'
sprintf(browser.dir,"/");
^~~
c:/libwiigui/source/filebrowser.cpp: In function 'int BrowseDevice()':
c:/libwiigui/source/filebrowser.cpp:223:18: error: 'struct BROWSERINFO' has no member named 'dir'
sprintf(browser.dir, "/");
^~~
c:/libwiigui/source/filebrowser.cpp: In function 'int UpdateDirName()':
c:/libwiigui/source/filebrowser.cpp:95:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make[1]: *** [filebrowser.o] Error 1
"make": *** [build] Error 2

Try adding this in filebrowser.h, as the constant is defined there:

#include <sys/param.h>