dbzhang800 / QtXlsxWriter

.xlsx file reader and writer for Qt5
http://qtxlsx.debao.me
Other
1.24k stars 632 forks source link

Use source code directly mast "make install" first? #42

Closed Jumes closed 10 years ago

Jumes commented 10 years ago

I followed he document "Usage(2): Use source code directly", but the code below has compile error. The qt creator cannot find file "xlsxdocument.h".

include "xlsxdocument.h"

int main()
{
    QXlsx::Document xlsx;
    xlsx.write("A1", "Hello Qt!");
    xlsx.saveAs("Test.xlsx");
    return 0;
}
JohnGreek commented 10 years ago

Did you try to copy the header/source files in your project folder? From the error it seems it's missing. I recommend compiling the library to a dll, it's quite straightforward and will save you from the hassle of including the source every time you want to create a new project.

Tell me if you need any help.

Jumes commented 10 years ago

Yes, I use the source code directly.Then I add "include(../xlsx/qtxlsx.pri)" to *.pro file.But I don't know how to make the "xlsxdocument.h" appears in header files searching path not include "../xlsx/xlsxdocument.h".

JohnGreek commented 10 years ago

are you using QtCreator? If yes go to your .pro file and add the line: INCLUDEPATH += C:/Qt/Qt5.2.1/Tools/mingw48_32/include

but replace the path with the path in your computer where the header files are located.

luckyhacky commented 10 years ago

Did you run "qmake" before compiling?

dbzhang800 commented 10 years ago

Hi, you can add following line to your project's .pro file, then run qmake to see what happened.

message($$INCLUDEPATH)

And there is no need to call make install.