Compile issue with latest GIT builds
I haven't been able to build the latest 2.0 git releases since yesterday (Oct 1/2012) under Windows 7 32-bit QT 4.8.0. I've tried various things and even did a clean checkout to a new folder. Here's the compile output:
D:\MS_TRUNK\mscore\/driver.h:49: warning: unused parameter 'name'
D:\MS_TRUNK\mscore\/driver.h:49: warning: unused parameter 'input'
D:\MS_TRUNK\mscore\/driver.h:49: warning: unused parameter 'midi'
In file included from D:/MS_TRUNK/libmscore/score.h:31,
from D:\MS_TRUNK\mscore\/musescore.h:25,
from D:\MS_TRUNK\mscore\pm.cpp:30:
D:/MS_TRUNK/libmscore/note.h:248: error: expected unqualified-id before ')' token
D:/MS_TRUNK/libmscore/note.h:256: error: ISO C++ forbids declaration of 'Chord' with no type
D:/MS_TRUNK/libmscore/note.h:256: error: expected ';' before '*' token
D:/MS_TRUNK/libmscore/note.h:257: error: expected ';' before 'void'
D:/MS_TRUNK/libmscore/note.h:257: error: 'Chord' is not a type
In file included from D:\MS_TRUNK\mscore\/musescore.h:25,
from D:\MS_TRUNK\mscore\pm.cpp:30:
D:/MS_TRUNK/libmscore/score.h:365: error: 'Chord' is not a type
D:/MS_TRUNK/libmscore/score.h:366: error: 'Chord' is not a type
D:/MS_TRUNK/libmscore/score.h:478: error: 'Chord' is not a type
D:/MS_TRUNK/libmscore/score.h:485: error: two or more data types in declaration of 'parameter'
D:/MS_TRUNK/libmscore/score.h:486: error: 'Chord' is not a type
D:/MS_TRUNK/libmscore/score.h:512: error: 'Chord' is not a type
D:/MS_TRUNK/libmscore/score.h:522: error: ISO C++ forbids declaration of 'Chord' with no type
D:/MS_TRUNK/libmscore/score.h:522: error: expected ';' before '*' token
D:/MS_TRUNK/libmscore/score.h:543: error: expected ';' before '(' token
D:/MS_TRUNK/libmscore/score.h:544: error: expected ';' before '(' token
D:\MS_TRUNK\mscore\pm.cpp: In member function 'virtual void PortMidiDriver::read()':
D:\MS_TRUNK\mscore\pm.cpp:223: warning: unused variable 'velo'
mingw32-make[3]: *** [mscore/CMakeFiles/mscore.dir/pm.cpp.obj] Error 1
mingw32-make[3]: Leaving directory `D:/MS_TRUNK/build.release'
mingw32-make[2]: *** [mscore/CMakeFiles/mscore.dir/all] Error 2
mingw32-make[2]: Leaving directory `D:/MS_TRUNK/build.release'
mingw32-make[1]: *** [all] Error 2
mingw32-make[1]: Leaving directory `D:/MS_TRUNK/build.release'
mingw32-make: *** [release] Error 2
Comments
I think it's the #include libmscore/score.h in musescore.h in this commit https://github.com/musescore/MuseScore/commit/4e54f49315f09e72cfe1ffa13… which make it fails. Weird thing is it works on both Mac and Linux...
Looking for a solution for windows, any help welcome.
In reply to I think it's the #include by [DELETED] 5
Looking further...
D:/MS_TRUNK/libmscore/note.h:248: error: expected unqualified-id before ')' token
shows that there is a problem with "small". Apparently the windows SDK does #define small char in an obscure file....
See http://stackoverflow.com/questions/5874215/what-is-rpcndr-h
or http://bruteforcex.blogspot.fr/2008/01/silly-microsoft.html
Question is why it pops up now...
With #undef small in note.h. This error goes away but we still a problem with Chord being undefined...
In reply to Looking by [DELETED] 5
"Question is why it pops up now...":
It clearly has to do with Windows stuff being included at the top of pm.cpp, possibly in combination with the mscore-specific .h files included right below: did anything change in this, recently?
Incidentally, pm.cpp as a whole does not seem to be part of the Linux project: at least it is not listed in the Qt Creator file list when run under Linux (Ubuntu 11.10 in my case).
M.
In reply to "Question is why it pops up by Miwarre
It's fixed right now. 2baa6615ef
The problem has been introduced like this. pm.cpp and jackaudio.cpp include musescore.h because they need access to the mscore object. The commit 4e54f49315 adds #include libmscore/score.h to musescore.h. Both pm.cpp and jackaudio.cpp also include directly or indirectly windows.h and this file includes
wingdi.h
with this line...
BOOL _attribute__((__stdcall_)) Chord(HDC,int,int,int,int,int,int,int,int);
and
rpcndr.h
with#define small char
score.h includes note.h, where there is reference to Chord and small... and so it breaks...
It has been fixed in 2baa6615ef by removing score.h from musescore.h and moving the declaration of the functions needing score.h to musescore.h. Thanks Werner!