0

I have an issue when trying to use Zbar library in visual studios 2015. I have installed the library using the ZBar 0.10 Windows installer from the link: http://zbar.sourceforge.net/download.htm.

Then i link the source folder of Zbar into my project by going to:

"Project -> Properties -> C/C++" and added installed zbar folder to "Additional Include Directories".

Apperently it finds the zbar when i include with "#include "zbar.h"" but, when i run i get the errors:

"1>------ Build started: Project: test, Configuration: Release Win32 ------

1>main.obj : error LNK2001: unresolved external symbol _zbar_image_set_data
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_symbol_get_loc_y
1>main.obj : error LNK2001: unresolved external symbol _zbar_image_ref
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_image_get_symbols
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_symbol_set_first_symbol
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_get_data
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_image_set_userdata
1>main.obj : error LNK2001: unresolved external symbol _zbar_image_create
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_image_scanner_set_config
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_image_scanner_create
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_get_type
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_image_scanner_destroy
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_next
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_symbol_get_loc_size
1>main.obj : error LNK2001: unresolved external symbol _zbar_get_symbol_name
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_image_set_format
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_symbol_set_get_size
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_image_get_userdata
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_symbol_get_loc_x
1>main.obj : error LNK2001: unresolved external symbol 
_zbar_symbol_get_data_length
1>main.obj : error LNK2001: unresolved external symbol _zbar_image_set_size
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_ref
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_set_ref
1>main.obj : error LNK2001: unresolved external symbol _zbar_scan_image
1>..\..\bin\vs2015\test.exe : fatal error LNK1120: 24 unresolved externals

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========="

When i press "Local windows debuggger" aka run the code, it is set to "win32".

I've looked online for help, but nothing i found fixed the problem..

Any help is appreciated!

Varyag
  • 676
  • 12
  • 29

1 Answers1

0

When you add #include <some_header_file.h> in your source code then you don't actually add the implementation to your program as long as the header file contains only inline functions.

Usually the header files contain an interface description, but little or no implementation.

Your need to add the library/libraries that contain the implementation. Then you link actually the code.

harper
  • 13,345
  • 8
  • 56
  • 105