Corrupted IrrINI-Project ... or somewhat like that.
Corrupted IrrINI-Project ... or somewhat like that.
I got this problem: I wanna use IrrINI, but the ... well, programer set the default project configurations to a static library. Every time I compile the source code of IrrINI it just creates a LIB, although I need a DLL.
But I am no fool, I know how to change the settings. But now, unfortunaly, it just creates the DLL, and I am missing the usual LIB-file. What is this?
But I am no fool, I know how to change the settings. But now, unfortunaly, it just creates the DLL, and I am missing the usual LIB-file. What is this?
Don't have access to the code right now but iirc the function createIniFile is not marked as an export. This is why you get a DLL without a library file.
Since this is just a small library I never thought anyone would actually want to have this as a DLL...
I'll take a look at this tonight.
Since this is just a small library I never thought anyone would actually want to have this as a DLL...
I'll take a look at this tonight.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Libraries I have not written myself I ALWAYS store in DLLs ... that allows me to update the procedures without updating the exe (except for the case that the interface has changed).Sylence wrote:Don't have access to the code right now but iirc the function createIniFile is not marked as an export. This is why you get a DLL without a library file.
Since this is just a small library I never thought anyone would actually want to have this as a DLL...
I'll take a look at this tonight.
However, how do I marked it as an export? Irrlicht does not seem to use __declspec(dllexport) ...
Yes it does. IRRLICHT_API is defined as dllexport or dllimport.TomTim wrote:However, how do I marked it as an export? Irrlicht does not seem to use __declspec(dllexport) ...
Basically you have to add a define to the library's preprocessor defines (e.g. IRRINI_EXPORTS) and then you define something (e.g. IRRINI_API) as dllexport if the IRRINI_EXPORTS exists or as dllimport if it doesn't.
This way you will have exports if the classes are used from outside the library and imports if used from within.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
So why is no class marked with IRRINI_API?Sylence wrote:Yes it does. IRRLICHT_API is defined as dllexport or dllimport.
Basically you have to add a define to the library's preprocessor defines (e.g. IRRINI_EXPORTS) and then you define something (e.g. IRRINI_API) as dllexport if the IRRINI_EXPORTS exists or as dllimport if it doesn't.
This way you will have exports if the classes are used from outside the library and imports if used from within.
It doesn't work, and I don't why. When I try to compile it, it shows me:
The header:
The code:
Code: Select all
1>IrrINI.cpp(12): error C2375: 'irr::io::createIniFile': re-definition; different linkage
1>IrrINI.cpp(17): error C2375: 'irr::io::createIniFile': re-definition; different linkage
1>IrrINI.cpp(22): error C2375: 'irr::io::createIniFileEmpty': re-definition; different linkage
Code: Select all
//! Creates an IrrIni object from a filename. You need to pass a valid pointer to the filesystem if you want to save the file to disk.
__declspec(dllexport)IrrIni* createIniFile(const c8* file, IFileSystem* fileSystem=0, bool saveOnDestroy=false);
//! Creates an IrrIni object from an already opend file. You need to pass a valid pointer to the filesystem if you want to save the file to disk.
__declspec(dllexport)IrrIni* createIniFile(IReadFile* file, IFileSystem* fileSystem=0, bool saveOnDestroy=false);
//! Creates an empty IrrIni object. If you pass 0 for a filesystem pointer you cannot save the file disk later.
__declspec(dllexport)IrrIni* createIniFileEmpty(IFileSystem* fileSystem=0);
Code: Select all
__declspec(dllexport)IrrIni* createIniFile(const c8* file, IFileSystem* fileSystem, bool saveOnDestroy/* =false */)
{
return new CIrrIniStub(fileSystem, file,saveOnDestroy);
}
__declspec(dllexport)IrrIni* createIniFile(io::IReadFile* file, IFileSystem* fileSystem, bool saveOnDestroy/* =false */)
{
return new CIrrIniIrr(fileSystem, file,saveOnDestroy);
}
__declspec(dllexport)IrrIni* createIniFileEmpty(IFileSystem* fileSystem)
{
return new CIrrIniStub(fileSystem,0,false);
}
Nope.
Same error occurs.
Code: Select all
extern "C"__declspec(dllexport)IrrIni* createIniFile(const c8* file, IFileSystem* fileSystem=0, bool saveOnDestroy=false);
extern "C"__declspec(dllexport)IrrIni* createIniFile(IReadFile* file, IFileSystem* fileSystem=0, bool saveOnDestroy=false);
extern "C"__declspec(dllexport)IrrIni* createIniFileEmpty(IFileSystem* fileSystem=0);
Well worked like a charm for me...
Here is the new download: http://www.btbsoft.org/downloads/?did=4
Here is the new download: http://www.btbsoft.org/downloads/?did=4
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
This is it. It's over, I re-install this stupid compiler. It does not change my project settings, it does not add existing files to my projects, it does not open files, I can't close the program normally ... die in hell, piece of junk, I am full with your incompetence, I will re-install you completly.Sylence wrote:Well worked like a charm for me...
Here is the new download: http://www.btbsoft.org/downloads/?did=4
I guess it has nothing to do with your advices or your project, I furthermore guess that scrappy compiler tries to drive me crazy.
EDIT: So, I re-installed my compiler completly. And now, finally, it works. Thanks.
OK, I wanted to implement some new functions into IrrINI, and was rather succesful (I needed them for some types IrrINI doesn't support yet). A very simple question: are the values of the keys just read to the next whitespace or to the end of the line (data)?
If there is this line:
, is just the word "SOFTWARE" saved by IrrINI or the whole "SOFTWARE DRIVER"? And no, I can't used the usual IrrINI::getValueDrv()-procedure, for this code is just a mere example, the real ini entry is much more complicated ...
If there is this line:
Code: Select all
[Window]
Driver=SOFTWARE DRIVER