So first I tried compiling the Irrlicht11.0 solution - this didn't work, it kept wanting me to install the Windows 7.1SDK which I don't have and don't want [or need, I'm not building the d3d renderers]
Since it didn't let me upgrade the solution within the IDE I instead did it manually, it's now up to date and the platform toolset is defined as v120 (the VS2013 C++ compiler), all fine and dandy - compilation works reasonably well, until we hit irrXML.cpp [every other file built, this is verified by the fact that it didn't abort on
Configuration(s) tested: Debug (DLL) - Win32, Debug (DLL) - x64
Errors:
Code: Select all
1>Irrlicht.cpp(52): error C2491: 'irr::createDevice' : definition of dllimport function not allowed
1>Irrlicht.cpp(66): error C2491: 'irr::createDeviceEx' : definition of dllimport function not allowed
1>irrXML.cpp(85): error C2491: 'irr::io::createIrrXMLReader' : definition of dllimport function not allowed
1>irrXML.cpp(92): error C2491: 'irr::io::createIrrXMLReader' : definition of dllimport function not allowed
1>irrXML.cpp(100): error C2491: 'irr::io::createIrrXMLReader' : definition of dllimport function not allowed
1>irrXML.cpp(117): error C2491: 'irr::io::createIrrXMLReaderUTF16' : definition of dllimport function not allowed
1>irrXML.cpp(124): error C2491: 'irr::io::createIrrXMLReaderUTF16' : definition of dllimport function not allowed
1>irrXML.cpp(132): error C2491: 'irr::io::createIrrXMLReaderUTF16' : definition of dllimport function not allowed
1>irrXML.cpp(149): error C2491: 'irr::io::createIrrXMLReaderUTF32' : definition of dllimport function not allowed
1>irrXML.cpp(156): error C2491: 'irr::io::createIrrXMLReaderUTF32' : definition of dllimport function not allowed
1>irrXML.cpp(164): error C2491: 'irr::io::createIrrXMLReaderUTF32' : definition of dllimport function not allowed
Code: Select all
IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(const char* filename)
{
return createIrrXMLReader(new CFileReadCallBack(filename), true);
}
Code: Select all
#ifndef _IRR_STATIC_LIB_
#ifdef IRRLICHT_EXPORTS
#define IRRLICHT_API __declspec(dllexport)
#else
#define IRRLICHT_API __declspec(dllimport)
#endif // IRRLICHT_EXPORT
#else
#define IRRLICHT_API
#endif // _IRR_STATIC_LIB_
Except to my understanding it should be the dllexport option - since using dllimport on a definition is illegal.
I wonder why.
In any case, I suppose I could hack it by defining IRRLICHT_EXPORTS but that sounds really dodgy, I'm mostly posting to see if anyone has had this happen to them and why - it's rather perplexing [most likely due to my own lack of programming skills, but that's why I'm [planning on] messing around with irrlicht's internals in the first place - haven't done much aside from define NO_IRR_COMPILE_WITH_DIRECT3D_8_ and NO_IRR_COMPILE_WITH_DIRECT3D_9_ thus far, and nuking the d3d9 renderer files from the project since they're not used anyway (which doesn't make a difference because it happens even with them still there - the problem stems from irrXML)]
presumably the exact same would happen even without the NO_IRR_COMPILE_WITH_DIRECT3D_x_ defines.
So... maybe I do need the Windows 7.1SDK after all? Although it doesn't seem to be related to that in any way, it seems to be due to a missing IRRLICHT_EXPORTS definition (because after batch searching every file in the solution there's no #define IRRLICHT_EXPORTS anywhere to be found).
After hacking it in it it compiles just fine. (well mostly, there's a linking error due to me removing the software driver without instructing the compiler to not compile it in - but that's my fault, after adding NO_IRR_COMPILE_WITH_SOFTWARE_ it compiles just fine)
I suppose this should actually be a bug report?
Given that it fails to compile under MSVC2013 Community unless one manually hacks in a #define IRRLICHT_EXPORTS
Specifically because the IrrCompileConfig header contains a bug that tells the compiler to generate imports where syntactically illegal.
Yes, this is a fresh download of 1.8.3 right from http://irrlicht.sourceforge.net/?page_id=10
After downloading it again there are still no definitions of IRRLICHT_EXPORTS in IrrCompileConfig.h and this version causes the same error on my end [when built with VC120 - after the Windows SDK7.1 defines have been changed, naturally - it won't compile at all with them intact]
Well, it's in off-topic for a reason. (I have no idea where to put it!) Besides, I am more curious as to the reasons of it not working without hacking in a solution myself rather
Well, I suppose my root point of all this is: I don't enjoy building under windows, something always gets in my way.
But for now I found a hack to solve it with.
Question: how would irrlicht ever compile without IRRLICHT_EXPORTS being defined?
you can't make mark a function as __declspec(dllimport) if it has a definition so without it defined every function in irrXML.cpp should rightly err out, no? (there's a good reason why this is in off-topic, aside from not knowing where it goes, and that is that I'm not familiar enough with Irrlicht to call this a bug. Merely an unusual experience!)
P.S Sorry for this being so ranty, I couldn't figure out a good way to edit it after proofreading.