comp.lang.ada
 help / color / mirror / Atom feed
* GNAT CE 2019 C++ Link Failure With Mojave
@ 2019-07-14  4:27 Roger
  2019-07-14 10:17 ` Jeffrey R. Carter
  2019-07-19  2:55 ` Roger
  0 siblings, 2 replies; 4+ messages in thread
From: Roger @ 2019-07-14  4:27 UTC (permalink / raw)


Mac-Mini 2018
OSX 10.14.5 Mojave
GPRBUILD Community 2019 (20190517) (x86_64-apple-darwin17.7.0)
ImageMagick-7.0.8-35

The C++ code below fails to link on my Mac-Mini under Mojave:

#include <Magick++.h>
#include <iostream>
#include <string>

using namespace std;
using namespace Magick;

int main(int argc, char **argv)
  {
  string  Logo_File = "../images/logo.jpg";
  Image   logo_image;

  Magick::InitializeMagick(*argv);
  logo_image.read(Logo_File);
  return 0;
}

Failure message:
Undefined symbols for architecture x86_64:
  "Magick::Image::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      _main in display_logo.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
gprbuild: link of display_logo.cpp failed
gprbuild: failed command was: /opt/gnat/2019/bin/g++ display_logo.o libshow_logo.a -L/opt/lib -lMagickCore-7.Q16HDRI -lMagick++-7.Q16HDRI -g -Wl,-rpath,/opt/lib -o /Ada_Source/OglAda_Examples/imagemagick/logo//display_logo

This code works with GNAT CE 2019 on my MacBook under High Sierra.
It also works using XCode on my Mac-Mini.
Failure occurs for both brew imagemagick and locally built imagemegick.

I use Magick::Image::read and related imagemagick routines in C++ interface code for a number of Ada projects which all build without error on my MacBook under High Sierra.

Any assistance will be greatly appreciated.
Thanks,
Roger 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GNAT CE 2019 C++ Link Failure With Mojave
  2019-07-14  4:27 GNAT CE 2019 C++ Link Failure With Mojave Roger
@ 2019-07-14 10:17 ` Jeffrey R. Carter
  2019-07-14 11:53   ` Roger
  2019-07-19  2:55 ` Roger
  1 sibling, 1 reply; 4+ messages in thread
From: Jeffrey R. Carter @ 2019-07-14 10:17 UTC (permalink / raw)


On 7/14/19 6:27 AM, Roger wrote:
> 
> I use Magick::Image::read and related imagemagick routines in C++ interface code for a number of Ada projects which all build without error on my MacBook under High Sierra.

Why not use the all-Ada Generic Image Decoder?

https://sourceforge.net/projects/gen-img-dec/

-- 
Jeff Carter
"I have a very small head and I had
better learn to live with it ..."
Edsger Dijkstra
158

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GNAT CE 2019 C++ Link Failure With Mojave
  2019-07-14 10:17 ` Jeffrey R. Carter
@ 2019-07-14 11:53   ` Roger
  0 siblings, 0 replies; 4+ messages in thread
From: Roger @ 2019-07-14 11:53 UTC (permalink / raw)


On Sunday, July 14, 2019 at 8:17:12 PM UTC+10, Jeffrey R. Carter wrote:
> On 7/14/19 6:27 AM, Roger wrote:
> > 
> > I use Magick::Image::read and related imagemagick routines in C++ interface code for a number of Ada projects which all build without error on my MacBook under High Sierra.
> 
> Why not use the all-Ada Generic Image Decoder?
> 
> https://sourceforge.net/projects/gen-img-dec/
> 
> -- 
> Jeff Carter
> "I have a very small head and I had
> better learn to live with it ..."
> Edsger Dijkstra
> 158

Thanks for the suggestion which I will investigate.
However, there are other functions of imagemagick that I use.
The code using the read function that I posted is just one example.
In any case, I would still like to know why this problem occurs.
Best regards,
Roger

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GNAT CE 2019 C++ Link Failure With Mojave
  2019-07-14  4:27 GNAT CE 2019 C++ Link Failure With Mojave Roger
  2019-07-14 10:17 ` Jeffrey R. Carter
@ 2019-07-19  2:55 ` Roger
  1 sibling, 0 replies; 4+ messages in thread
From: Roger @ 2019-07-19  2:55 UTC (permalink / raw)



Problem solved.
The failure seems to have been caused by the C++ compiler (G++) supplied with GNAT 2019.
Changing to the llvm compiler (/usr/bin/clang++) solved the problem.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-19  2:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-14  4:27 GNAT CE 2019 C++ Link Failure With Mojave Roger
2019-07-14 10:17 ` Jeffrey R. Carter
2019-07-14 11:53   ` Roger
2019-07-19  2:55 ` Roger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox