Integrating zbar library
-
Hi Guys,
I was able to install the qt into my machine and now I have started to build my project which is the scanning of the barcode reader. I have decided to use 'zbar' library for this purpose and installed the same in my macOs.
This is how I verified the installation of 'zbar'.
apple@Apples-MacBook-Air barcode % pkg-config --cflags --libs zbar -I/usr/local/Cellar/zbar/0.23.90_4/include -L/usr/local/Cellar/zbar/0.23.90_4/lib -lzbar
Now, I would like to integrate this in my Qt6.4 system and I started with:
target_link_libraries(camera PUBLIC /usr/local/Cellar/zbar/0.23.90_4/lib/libzbar)
And this did not work.
How do I integrate 'zbar' and Qt 6.4 otherwise?
-
@JoeCFD I was able to find an answer to this question by doing this:
find_package(PkgConfig REQUIRED)
pkg_check_modules(ZBar REQUIRED IMPORTED_TARGET zbar)
target_link_libraries(camera PUBLIC PkgConfig::ZBar)
Since I anyway had pkg-config, I found that package and then zbar using that package and then linked it with the libraries. -
Hi,
Since you have pkg-config, something along the lines of:
find_package(PkgConfig REQUIRED) pkg_check_modules(ZBAR REQUIRED zbar) target_link_libraries(camera ${ZBAR_LINK_LIBRARIES})
Note that I haven't tested it.
-
@JoeCFD I was able to find an answer to this question by doing this:
find_package(PkgConfig REQUIRED)
pkg_check_modules(ZBar REQUIRED IMPORTED_TARGET zbar)
target_link_libraries(camera PUBLIC PkgConfig::ZBar)
Since I anyway had pkg-config, I found that package and then zbar using that package and then linked it with the libraries. -