Lib symbols could not be resolved [message #1821076] |
Wed, 05 February 2020 09:16 |
Leo Subirana Messages: 2 Registered: February 2020 |
Junior Member |
|
|
I'm trying to use Magick++ lib, code works as expcected but IDE does not
Issue:
IDE marks Symbol "Magick" could not be resolved
(Also other items from the same lib)
I can navigate to declaration of the lib header file, also it has no warning / error:
#include <Magick++.h>
And continue navigationg through all of it without issues or any warning on their files.
But on my cpp file, the lib Symbols are marked as errors.
Tryed to search about this kind of issues, but usually they are solved after adding the include to the header files witch is already done:
Also tried to restart eclipse, reboot, refresh project.
The lib installation, compilation and run of sample demo works properly.
Sample:
Now the info:
Eclipse IDE for C/C++ Developers
Version: 2019-09 R (4.13.0)
Build id: 20190917-1200
Eclipse C/C++ Development Tools
Version: 9.9.0.201909091956
Lib Installation made through this steps:
Sorry, can't post links due low amount of messages
//============================================================================
// Name : MagickTest.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick; // <-- Symbol not found
int main(int argc,char **argv)
{
InitializeMagick(*argv); // <-- Functionnot found
Image image; // Not found ...
try {
// Read a file into image object
image.read( "logo:" );
// Crop the image to specified size (width, height, xOffset, yOffset)
image.crop( Geometry(100,100, 100, 100) );
// Write the image to a file
image.write( "logo.gif" );
}
catch( Exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
return 1;
}
return 0;
}
I was able to make eclipse to compile it properly with the following project properties:
Project properties -> C/C++ Build / Settings / Tool Settings (tab):
- GCC C++ Compiler / Includes:
Include path (-l):
/usr/local/include/ImageMagick-7
- GCC C++ Compiler / Miscelaneous
On Other flags, add:
`Magick++-config --cxxflags --cppflags` `Magick++-config --ldflags --libs`
Which creates an options convination of:
-I/usr/local/include/ImageMagick-7 -O0 -g3 -Wall -c -fmessage-length=0 `Magick++-config --cxxflags --cppflags` `Magick++-config --ldflags --libs`
- GCC C++ Linker/ Libraries:
Magick++-7.Q16HDRI
MagickWand-7.Q16HDRI
MagickCore-7.Q16HDRI
Could find the libs after searching them with:
find /usr -name "*Magick++*"
Also, i think this happened automatically:
Project properties -> C/C++ General / Preprocessor Include Paths, Macros, etc.
GNU C++:
CDT Managed Build Setting Entries has an entry to (not editable):
/usr/local/include/ImageMagick-7
|
|
|
|
|
|
Re: Lib symbols could not be resolved [message #1821646 is a reply to message #1821641] |
Tue, 18 February 2020 07:44 |
Leo Subirana Messages: 2 Registered: February 2020 |
Junior Member |
|
|
Yes, the main issue was indexer not indexing even after build or reboot.
I had to run it manually as David Vavra stated: Project --> C/C++ Index --> Rebuild, from then It worked fine.
Thank you very much.
As I had hard time making Magick++ work, I will just leave here some steps I followed in case anyone can benefit from that:
This is some good install tutorial:
https://imagemagick.org/script/install-source.php
You can find the installed lib on /usr/local/lib, at least given my current enviroment:
Debian 4.19.67-2+deb10u2
Furthermore, the linker lib names are the files in there without the "lib" at the start of the name.
Last but not least, to fully use Magick++, you will need "delegates", which are libraries for specific formats and/or tasks. Running:
$ convert -version
will give you info of the currently installed delegates:
Version: ImageMagick 7.0.9-21 Q16 x86_64 2020-02-18 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(4.5)
Delegates (built-in): jng jpeg png x zlib
A good way to find the ones you are looking for and to install them manually:
$ sudo apt -s build-dep imagemagick | grep -i png
Note the grep of file format I was looking support for. Then you will need to run the configure, make and make install again on the source.
Sorry for extra offtopic info but could not find all this together anywhere, so some people can benefit from it
[Updated on: Tue, 18 February 2020 13:15] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03069 seconds