Menu

Windows / QtCreator

Help
Sebastian
2012-11-13
2013-04-13
  • Sebastian

    Sebastian - 2012-11-13

    Hi,
    I want to be able to read/write simple excel spreadsheets (don't we all?) using **QtCreator ** for Windows.

    I've downloaded xlslib and put xlslib.h with subdirs in my application folder.
    In my .pro-file I've added:

    HEADERS  += mainwindow.h \
            xlslib.h
    

    and in my MainWindow constructor i've included it:

    #include "xlslib.h"
    

    (This is the first time ever I am adding a library - so I hope I'm not all too wrong already…)

    Trying to compile I get this error:

    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2010.05\qt\include\QtCore" -I"c:\Qt\2010.05\qt\include\QtGui" -I"c:\Qt\2010.05\qt\include" -I"c:\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\ExcelTest" -I"." -I"c:\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\mainwindow.o ..\ExcelTest\mainwindow.cpp

    In file included from ./xlslib.h:54,

                     from ..\ExcelTest\mainwindow.cpp:3:

    ./xlslib/workbook.h: In member function 'const char* xlslib_core::workbook::version() const':

    ./xlslib/workbook.h:68: error: 'PACKAGE_VERSION' was not declared in this scope

    mingw32-make: Leaving directory `D:/Eigene Dateien/C++/Testprojekte/ExcelTest-build-desktop'

    mingw32-make: Leaving directory `D:/Eigene Dateien/C++/Testprojekte/ExcelTest-build-desktop'

    mingw32-make: ***  Error 1

    mingw32-make: ***  Error 2

    I've read that I should have run a configure script - but this is not written for Window, is it?
    What can I do to use the library - can I manually set the constants (if that's the problem)? Is there any help/howto/readme for windows people out here?
    Excuse me for being a bit uninformed, this is not for lack of trying. Any help or hint is gratefully appreciated!

     
  • David Hoerl

    David Hoerl - 2012-11-13

    Most of the people using this library are Windows developers. I surprisingly are a Mac guy who needed this lib a long time ago. I suggest you read other questions and answers here for help, as I have no idea how to help you. But, this library is compiled daily on Windows platforms so it can be done easily if you know the magic incantation.

     
  • Sebastian

    Sebastian - 2012-11-13

    Thank you very much for the encouraging words - it's good to know that (with the right spells and flicks of the wand) this can and will be a solution for me.

    I hope that, even being a Mac guy you can help me - because what I think I lack is more basically knowledge about what the needs to be done than how to specifically do that in Windows environment.

    Please let me tell you what I did:
    1. I've copied the xlslib dir into my app folder
    2. I've opened a ksh, walked into the subdir that containes the scripts
    3. I've tried ./bootstrapper first, following an older post from you.

    Error message:

    **Error**: You must have 'autoconf' installed to compile XLSlib.
               Version 2.65 or newer is required.
    **Error**: You must have 'automake' installed to compile XLSlib.
               Version 1.11 or newer is required.

    I've tried ./configure, but to no avail. The config.log says:

    configure:2815: checking for a BSD-compatible install
    configure:2883: result: config/install-sh -c
    configure:2894: checking whether build environment is sane
    configure:2944: result: yes
    configure:3085: checking for a thread-safe mkdir -p
    configure:3124: result: config/install-sh -c -d
    configure:3137: checking for gawk
    configure:3167: result: no
    configure:3137: checking for mawk
    configure:3167: result: no

    …continuing with "no"….

    ./configure: eval: g++: not found
    configure:3485: $? = 127
    configure:3505: checking whether the C++ compiler works
    configure:3527: g++    conftest.cpp  >&5
    ./configure: eval: g++: not found
    configure:3531: $? = 127
    configure:3569: result: no
    configure: failed program was:

    I think I am missing something huge and basic here.

    to 1.:
    Copying is ok? No prior "installation" is needed?
    to 2:
    Is the scripts dir the right dir to start the scripts in? I thought so because of the ./ prefix.
    to 3: do bootstrap / configure etc. need any arguments that I didn't provide?

    My problem is apparently, that I quite conceptually don't know what I am doing… How can running those scripts in my system environment change the way the c++ compiler in my QtCreator handles the xlslib sources? What is there that has to be installed, predefined, set up?

     
  • Sebastian

    Sebastian - 2012-11-13

    Is there any place you can recommend me to get help (or even or a step-by-step howto)? I am lost between Linux and Windows. I've tried to update the autoconf and automake as in this link, but as a linux n00b I'm at a loss here. I've downloaded and extracted the binaries (because there isn't even a /usr/src folder on my Uwin, I struggle with the linux commands), but  at the moment I feel like a monkey throwing sticks against a computer terminal.
    I understand (probably I am wrong) that the main importance of the script is setting some environment variables correctly for the code to be able to be compiled. Is it possible to just set them manually and not use the scripts?
    Sorry to bother you.

     
  • David Hoerl

    David Hoerl - 2012-11-13

    I have never used this site, but odesk.com connects developers to clients. From what I've read you can negotiate a rate, and see a developers past reviews (by other clients). The other developer of xlslib is a windows guy, but he has had some serious medical problems and I'm not sure if he can do any consulting or developing now or not. I'll at least see if he can take a look at this.

     
  • Sebastian

    Sebastian - 2012-11-13

    David, please don't. It's not important enough to risk anyones health. I will try again and again (cygwin might work out better for me - i just ran bootstrap) or consult somebody and learn from what he's doing. That idea ain't bad at all. If i succeed I'll post it here. Thank you very much!

     
  • Sebastian

    Sebastian - 2012-11-13

    With Cygwin (I had to tick-include libtool, minGW, autoconf, automake, make in the setup) i can run the bootstrap and configure scripts, the only warning being

    configure: WARNING: Libtool does not cope well with whitespace in `pwd`

    in the latter. Make, though, doesn't succeed:

    In file included from ./xlslib/extformat.h:38,
                     from ./xlslib/cell.h:38,
                     from ./xlslib/blank.h:37,
                     from xlslib/blank.cpp:32:
    ./xlslib/format.h:148: error: expected unqualified-id before '&' token
    ./xlslib/format.h:148: error: expected `,' or `…' before '&' token
    ./xlslib/format.h:148: error: ISO C++ forbids declaration of `parameter' with no type
    Makefile:505: recipe for target `blank.lo' failed

    In the format.h there is a "ustring" before the & in that line. Does this mean that the compiler misses some library?

     
  • Sebastian

    Sebastian - 2012-11-14

    Following this chinese site I found out that it helps to start configure with
    ./configure CPPFLAGS="-D _GLIBCXX_USE_WSTRING"

    Calling that, "make" is running for quite a while, albeit with very frequent (>2200!) "undefined reference" messages even many referring to std:: elements (but by no means exclusively to those). I have made sure that I've installed libstdc++6 and libstdc++6-devel.

    Make ends with

    /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iostream:77: undefined reference to `std::ios_base::Init::~Init()'
    collect2: ld returned 1 exit status
    Makefile:350: recipe for target `testC.exe' failed
    make: ***  Error 1

    The configure options
    -no-undefined
    -win32-dll
    seem to have no effect.

    Are we still on the "windows" side of the problem or is there anything you can see that I do wrong?

     
  • Sebastian

    Sebastian - 2012-11-14

    I think I'm getting somewhere. After making a make clean and starting from the beginning I could finish make and 3 of 4 tests passed, some .XLS sheets were created! :-) Now I've got to find out how I can integrate this into the QtCreator projects.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.