Hello lyubomir,
Sorry for the inconvenience this upgrade has caused you. Yes, Spire.Doc 14.9.11 was a significant structural adjustment on our side. Beyond adapting to more platforms, we restructured the product to fully align with the complete .NET feature set.
"Spire.Doc.o.h" has indeed been removed, existing #include "Spire.Doc.o.h" lines need to be replaced with the specific headers shown below.
- Code: Select all
#include <iostream>
#include "Spire/Doc/Document.h"
#include "Spire/Doc/Section.h"
#include "Spire/Doc/Documents/Paragraph.h"
#include "Spire/Doc/Fields/TextRange.h"
using namespace std;
using namespace Spire::Doc;
using namespace Spire::Doc::Documents;
int main()
{
std::string outputFile = "HelloWorld.docx";
// Create a Word document
intrusive_ptr<Document> document = new Document();
// Add a new section
intrusive_ptr<Section> section = document->AddSection();
// Add a new paragraph
intrusive_ptr<Paragraph> paragraph = section->AddParagraph();
// Append text
paragraph->AppendText("Hello World!");
// Save the document file.
document->SaveToFile(outputFile.c_str(), FileFormat::Docx);
// Release resources
document->Close();
return 0;
}
For the non-wide-string change: LPCWSTR_S changed from const wchar_t* to const char* (UTF-8), and APIs such as AppendText and LoadFromFile/SaveToFile now take const std::string&. This was part of the broader structural adjustment in 14.9.11.
We've added a detailed update log comparing against previous versions. Please refer to it here:
https://www.e-iceblue.com/news/Spire.Doc-for-CPP/spiredoc-for-cpp-14-9-11.html If your project has any other issues, please feel free to contact us.
Sincerely,
Lisa
E-iceblue support team