cppfw / svgren

:camera: SVG rendering library in C++
MIT License
206 stars 41 forks source link

Unresolved external symbol #87

Closed edqx closed 3 years ago

edqx commented 3 years ago

Hi I'm having trouble building my project installing libsvgren through Nuget. I also had to change some of the internal code which is not ideal. I also had to install r4 separately. Shouldn't this be a dependency?

Line 48 of render.hpp expected me to have svgdom::SvgElement instead of svgdom::svg_element.

I've uploaded an image for the first issue I was having, I've set my runtime library in both configuration places to Multi-threaded Debug DLL (/MDd) image image image

Thanks.

edqx commented 3 years ago

Here was a quick reproduction I made for the external symbol error, if it's needed.

auto dom = svgdom::load(papki::FSFile("rifle.svg"));
auto result = svgren::render(*dom);

if (!sprite)
    D3DXCreateSprite(device, &sprite);
if (!sprite)
    D3DXCreateTexture(device, dom->width.value, dom->height.value, 0, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture);

RECT r{0, 0, dom->width.value, dom->height.value};
sprite->Begin(D3DXSPRITE_ALPHABLEND);
sprite->Draw(texture, &r, NULL, NULL, D3DCOLOR_RGBA(0, 0, 0, 255));
sprite->Flush();
sprite->End();

Although I don't think this code will actually run as expected, and I can't know since it doesn't build.

igagis commented 3 years ago

@edqx after you have installed the NuGet packages, did you update those to all latest versions?

The svgren is still in active development phase, so strict dependencies versions are not updated regularly, so one has to always install latest versions of packages.

The r4 is a dependency in latest version of packages.

edqx commented 3 years ago

The latest version on NuGet is 0.5.6 which as far as I understand is the latest one, judging by GitHub tags. image

igagis commented 3 years ago

@edqx how about all the other dependency packages? I meant those have to be latest version also.

edqx commented 3 years ago

Okay so my packages were indeed outdated, downloading the latest ones worked great. After a few std version errors, and switching my C++ standard to latest in my VS project settings, all build errors were fixed. Thanks for the quick reply and the work on this library.

igagis commented 3 years ago

Yes, it needs at least C++17. Great that it worked for you!