I want to use Potrace for a C++ project on Windows in Visual Studio, but I have no clue of how to include Potrace into my project. I have tried to compile the C files using Cygwin, and that way create an .a file and then link to it in visual studio, but that didn’t work. Visual Studio were able to recognize the the functions from Potrace, but when running a test program with Potrace(Calling potrace_version() ), Visual Studio got the error “LNK2019 unresolved external symbol _potrace_version referenced in function_main”
I have gotten it to work on Ubuntu by using the technique mentioned above, and then compiling my code with: g++ main.cpp backenddxf.cpp ImageManipulation.cpp ./libubuntu/libpotrace.a -o test.out 'pkg-config --cflags --libs opencv
Do I have to compile the source code(Called “source distribution” on the website) to a lib file, and then link it to my project, in that case, how do I do so? Or is there something I have missed. I am using Visual Studio 2017 on Windows 10.
I am not to proficient in the workings of C++ so a detailed explanation is greatly appreciated.
I got it working using this answer by Yaakov to compile potrace to an .a file
./configure --prefix=/usr/x86_64-64-ming32/sys-root/mingw --host=x86_64-w64-mingw32 --with-libpotrace
and then
make
Afterwards I used this answer by Stuti Rastogi on how to link the .a file in Visual Studio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With