Aspose.Words for C++

Error LNK1104 cannot open file Aspose.Words.Cpp_vc14x64.lib. What chould i do?

@AlexZOw Could you please describe the scenario how we can reproduce this problem? We will check the issue and provide you more information.

https://docs.aspose.com/words/cpp/configure-aspose-words-for-cpp-in-visual-studio/
I did everything described here. Also added to the project via Nuget Aspose.words.cpp.

@AlexZOw Thank you for additional information. The mentioned article has been outdated. We will update the manual soon. For now you can either simply add reference to Aspose.Words for C++ from Nuget or by importing targets in the project like this:

<Import Project="<path-to>\CodePorting.Translator.Cs2Cpp.Framework_22.6\CodePorting.Translator.Cs2Cpp.Framework.targets" Condition="Exists('<path-to>\CodePorting.Translator.Cs2Cpp.Framework_22.6\CodePorting.Translator.Cs2Cpp.Framework.targets')" />
<Import Project="<path-to>\Aspose.Words.Cpp\aspose.words.cpp.targets" Condition="Exists('<path-to>\Aspose.Words.Cpp\aspose.words.cpp.targets')" />

Where <path-to> is path to the downloaded Aspose.Words for C++ package.

How i can add reference to Aspose.Words for C++ from Nuget?

@AlexZOw Just right click of references in your C++ project:

Then in search field type Aspose.Words and select Aspose.Words.Cpp package and press Install.

The problem has not disappeared.

@AlexZOw Unfortunately, I cannot reproduce the problem on my side. I created a C++ Console Application in Visual Studio 2019, added Nuget reference to Aspose.Words.Cpp package, added a simple Aspose.Words code for testing and everything works fine on my side. Could you please try the same on your side and let us know if the problem still occurs even with a simple console application?

I made a console program and added Aspose Words, no errors are noticed when compiling, but I can’t add the Aspose :: Words namespace (I only added Aspose via Nuget). When I followed the instructions on the site (https://docs.aspose.com/words/cpp/configure-aspose-words-for-cpp-in-visual-studio/), taking into account what you said to me to make, such error appears, also to the .lib file in an error the wrong way to a file is specified.
Maybe I need to specify the correct path to the file somewhere?

@AlexZOw Here is code I used for testing on my side:

#include <iostream>

#include <Aspose.Words.Cpp/Document.h>
#include <Aspose.Words.Cpp/DocumentBuilder.h>
#include <Aspose.Words.Cpp/License.h>

using namespace Aspose::Words;

int main()
{
    // Set the license.
    System::SharedPtr<License> lic = System::MakeObject<License>();
    lic->SetLicense(u"<path to the license file>\\Aspose.Words.Cpp.lic");

    // Generate a simple document.
    auto doc = System::MakeObject<Document>();
    auto builder = System::MakeObject<DocumentBuilder>(doc);
    builder->Write(u"Hello from Aspose.Words!");
    doc->Save(u"C:\\Temp\\out.docx");

    std::cout << "Document is generated successfully\n";
}

The code works correct and output document is generated properly.

As I noticed you from Ukraine, therefore
image.png (277.9 KB)
If I comment on those two lines, the code works.

@AlexZOw This is path to the license file. You can use Aspose.Words without license in evaluation mode. Please see Aspose.Words documentation to learn more about licensing.
If you would like to test Aspose.Words without evaluation version limitations, you can request a temporary 30-days license.

PS: Yes, I am from Ukraine.

Got it, thank you for your help.

1 Like