Menu

build xlsLib - Windows 7

Help
Kai
2014-10-29
2015-04-20
  • Kai

    Kai - 2014-10-29

    Hi,
    I am using Windows 7 and MSVS2013 and I would love to use your library, but unfortunately when I try to build the MSVS2012 version I get an error message "The program '[4280] createDLL.exe' has exited with code 1 (0x1)." The reason here is that the xlslib_dll and xlslib_lib files both failed to load.
    I get the same error when using MSVS2012 and when using MSVS2010 with the MSVS2010 build project.

    If this is used often by people who also use Windows, how did this problem not come up earlier already? Does anybody have a fix for this?

    I tried building my own project to compile the library myself, but I failed. When implementing the library I got a bunch of "error LNK2019: unresolved external symbol" errors. But other people surely had the same issue, since I have tried building the library on two three different Desktops (windows) and one laptop (windows) of which all failed in the same manner.
    The only one that worked for me so far was a PC with Linux installed, that worked like a charm, but unfortunately doesn't help me since I have to work with Windows :/
    Any help is appreciated!

     
  • David Hoerl

    David Hoerl - 2014-10-29

    There is an OpenEXR folder under trunk (at the top level that is) that has material in it relative to Windows and dlls - I wonder if that is relevant here.

    If all that fails, did you try to first bootstrap the project - that is, run ./bootstrap, then ./configure, then make using mingw.

    If all that fails I'll add a note to the README asking for help to resolve this issue.

     

    Last edit: David Hoerl 2014-10-29
  • karlosmunjos

    karlosmunjos - 2015-04-17

    Hi,

    in order to open project in visual studio 2013 go to xlslib\build\msvc2012 and in all *.vcxproj files change <PlatformToolset>v110</PlatformToolset> to <PlatformToolset>v120</PlatformToolset>.

    After this is done, go to the OpenEXR\IlmBase\vc\vc11\IlmBase\createDLL and also edit createDLL.vcxproj and change <PlatformToolset>v110</PlatformToolset> to <PlatformToolset>v120</PlatformToolset>

    Now project will be converted to VS 2013, but it will fail to load. On order to fix this you go back to xlslib\build\msvc2012 and in xlslib_dll.vcxproj and xlslib_lib.vcxproj

    you will see that there is two lines of <ClCompile Include="..\..\\src\\xlslib\\formula.cpp"/> delete one.

    After this project will successfully loaded, but it will fail to build.

    http://pastebin.com/L8B5Xsst

     
  • David Hoerl

    David Hoerl - 2015-04-17

    Fine - I can remove the extra "formula.cpp" line, but I have no way to debug why the build is failing myself (I'm using a Mac). Since those MS Project files were first built, the formula class was broken into two files, and I added the "Note" feature, which I see has generated some of the errors. I wonder if the dependency list of headers to class files in the project is missing some headers. If you can help me out here, I'm glad to roll fixes back into the main project tree.

     
  • karlosmunjos

    karlosmunjos - 2015-04-20

    src\xlslib\note.h

    line 46 uint16_t sheet_notes; I renamed to sheet_notess (also renamed in other clases, after rebuild)

    // Used internally
    struct sheet_notes {
    uint16_t sheet_idx;
    uint16_t sheet_notess;// can be a total count, or an index less than that
    };

    src\xlslib\formula.cpp How I can see formula.cpp is now one file. I don't understand how 917 line work, but msvc2013 complains about this line.

    function_property p = (function_property) {CELLOP_AS_VALUE, A_UNKNOWN};

    {} were causing syntax error, so I commented it out, and leave function_property uninitialized, which is probably a bad idea.

    function_property p/ = (function_property) {CELLOP_AS_VALUE, A_UNKNOWN}/;

    Hola!!! After these changes xlslib (both static and dynamic) was finally built with only few warnings.

    Warning 1 warning C4512: 'xlslib_core::formula_t' : assignment operator could not be generated (....\src\xlslib\range.cpp) D:\Downloads\xlslib-package-2.5.0\xlslib\xlslib\src\xlslib\formula.h 103 1 xlslib_lib

    Warning 14 warning C4245: 'initializing' : conversion from 'int' to 'unsigned32_t', signed/unsigned mismatch D:\Downloads\xlslib-package-2.5.0\xlslib\xlslib\src\xlslib\formula.cpp 906 1 xlslib_dll

    Warning 17 warning C4700: uninitialized local variable 'p' used d:\downloads\xlslib-package-2.5.0\xlslib\xlslib\src\xlslib\formula.cpp 918 1 xlslib_dll

    The last warning is caused by me. (/ = (function_property) {CELLOP_AS_VALUE, A_UNKNOWN}/)

    The first warning can be fixed by adding this line to formula.h

    //formula_t& operator=(const formula_t&) = delete;//trick to make operator unusable but stops the compiler from generating warning

    or by overloading operator= which I think will be better solution, if operator= is needed

    and the second warning signed/unsigned mismatch, I think, that it can be ignored.

    Now the examples.

    I added
    <ClInclude Include="..\..\\src\\xlslib\\formula.h"/>

    in to the all test *.vcxproj files. Only the xlslib-testC was successfully built. After little investigation in

    xlslib\targets\test\md5.h

    I uncommented

    if defined(__cplusplus)

    extern "C"
    {

    endif

    and

    if defined(__cplusplus)

    }

    endif

    Hola, the test project was built successfully. But only test xlslib-testC.exe can be executed without any problem.

    other project fail at fclose(fp); I don know why.

    {
        FILE *fp = fopen(fileName, "r");
        for(int i=0; i<NUM_TESTS; ++i) {
            char *checkP = check[i];
            if(fp) {
                fscanf(fp, "%s", checkP);
            } else {
                strcpy(checkP, "00000000000000000000000000000000");
            }
            //printf("MD5 = %s\n", checkP);
        }
        fclose(fp); //Failure at this line
    }
    

    I hope that these info are helpful to you. It would be nice to finally use xlslib on windows.

    Regards.

     

Log in to post a comment.