Trying to build a project with VIPS Lib. Connected the following .lib.

win32: LIBS += -L$$PWD/../../../../vips-dev-8.4/lib/ -llibvips INCLUDEPATH += $$PWD/../../../../vips-dev-8.4/include DEPENDPATH += $$PWD/../../../../vips-dev-8.4/include win32: LIBS += -L$$PWD/../../../../vips-dev-8.4/lib/ -llibglib-2.0 INCLUDEPATH += $$PWD/../../../../vips-dev-8.4/include/glib-2.0 DEPENDPATH += $$PWD/../../../../vips-dev-8.4/include/glib-2.0 win32: LIBS += -L$$PWD/../../../../vips-dev-8.4/lib/ -llibvips-cpp INCLUDEPATH += $$PWD/../../../../vips-dev-8.4/include DEPENDPATH += $$PWD/../../../../vips-dev-8.4/include win32: LIBS += -L$$PWD/../../../../vips-dev-8.4/lib/ -llibvipsCC INCLUDEPATH += $$PWD/../../../../vips-dev-8.4/include DEPENDPATH += $$PWD/../../../../vips-dev-8.4/include 

I am trying to compile examples from the official site (here is C ++ code, but I tried C example):

 #include <QCoreApplication> #include <vips/vips.h> #include <vips/vips8> using namespace vips; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); GOptionContext *context; GOptionGroup *main_group; GError *error = NULL; if( VIPS_INIT( argv[0] ) ) vips_error_exit( NULL ); context = g_option_context_new( "" ); main_group = g_option_group_new( NULL, NULL, NULL, NULL, NULL ); g_option_context_set_main_group( context, main_group ); g_option_context_add_group( context, vips_get_option_group() ); if( !g_option_context_parse( context, &argc, &argv, &error ) ) { if( error ) { fprintf( stderr, "%s\n", error->message ); g_error_free( error ); } vips_error_exit( NULL ); } VImage in = VImage::new_from_file( argv[1], VImage::option()-> set( "access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED ) ); double avg = in.avg(); printf( "avg = %g\n", avg ); printf( "width = %d\n", in.width() ); VImage out = in.embed( 10, 10, 1000, 1000, VImage::option()-> set( "extend", "background" )-> set( "background", 128 ) ); out.write_to_file( argv[2] ); vips_shutdown(); return a.exec(); } 

It produces the following errors: enter image description here

Apparently some dll were not picked up. Maybe I forgot to connect some more .lib to the project? Compiler: mingw32, OS: win7 32

UPD: I did exactly as written in the example on the official website:

  win32: LIBS += -L$$PWD/../../../../vips-dev-8.4/lib \ -lvipsCC -lvips-cpp -lvips -lgsf-1 -lz -ljpeg -lxml2 -lfftw3 -lm \ -lMagickWand-6.Q16 -llcms2 \ -lopenslide -lpangowin32-1.0 -ltiff -lpng16 -lexif \ -lMagickCore-6.Q16 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 \ -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl \ INCLUDEPATH += $$PWD/../../../../vips-dev-8.4/include INCLUDEPATH += $$PWD/../../../../vips-dev-8.4/include/glib-2.0 INCLUDEPATH += $$PWD/../../../../vips-dev-8.4/include/glib-2.0/include 

However, the error does not disappear ...

  • Lay out the assembly log. I think DEPENDPATH is superfluous - JK_Action

1 answer 1

Do not pick up the dll, and the lib-files. Exclude "lib" from the directive:

 win32: LIBS += -L$$PWD/../../../../vips-dev-8.4/lib/ -lvips 

In the directives that connect the lib-files, the name of which contains the version, it is possible that the version will also need to be discarded.

ps Adding a directory of header files to the DEPENDPATH variable DEPENDPATH redundant. This variable is deprecated.

  • something does not help, updated the question - bronstein87
  • @ bronstein87, the digits of your program, library, compiler match? - maestro
  • in the example on the site vips.ecs.soton.ac.uk/index.php?title=Supported the library compiles mingw32, so everything seems to be the same - bronstein87
  • @ bronstein87, Try to view the list of exported libvips.lib functions using dumpbin or nm utility. - maestro
  • If the nm utility, which is part of mingw, does not find these functions in the lib file, then most likely the problem is bit depth. - maestro