LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2013, 02:55 PM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,291

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Drawtiming-0.7.1 missing a define?


I'm getting a build error on drawtiming-0.7.1 (an Electronics thing) af follows. "strcasecmp" seems to be undefined to me, although I'm no coder.

Code:
then mv -f ".deps/timing.Tpo" ".deps/timing.Po"; else rm -f ".deps/timing.Tpo"; exit 1; fi
timing.cc: In member function 'void timing::postscript_gc::print(const string&) const':
timing.cc:944:39: error: 'strcasecmp' was not declared in this scope
timing.cc: In static member function 'static bool timing::postscript_gc::has_ps_ext(const string&)':
timing.cc:962:42: error: 'strcasecmp' was not declared in this scope
make[3]: *** [timing.o] Error 1
{Snip}
And the offending code with lines marked

Code:
void postscript_gc::print (const std::string& filename) const {
  std::ofstream out;

  out.exceptions (ofstream::failbit | ofstream::badbit);
  out.open (filename.c_str());

  std::string ext = filename_ext (filename);

  if (!strcasecmp (ext.c_str (), "eps")) {           ***Line 944********
    out << "%!PS-Adobe-3.0 EPSF-3.0\n";
    out << "%%BoundingBox: 0 0 " << width << ' ' << height << '\n';
    print (out);
  } else {
    out << "%!PS-Adobe-3.0\n";
    print (out);
    out << "showpage\n";
  }

  out << "%%EOF\n";
}

// ------------------------------------------------------------
bool postscript_gc::has_ps_ext (const std::string &filename) {
  std::string ext = filename_ext (filename);

  return !(strcasecmp (ext.c_str (), "ps") &&       ***Line 962****
           strcasecmp (ext.c_str (), "eps"));
}
The usual option of emailing the authors doesn't seem to be open - no emails that I can find. Is there a line I could throw in to define "strcasecmp" and just get going?
 
Old 03-15-2013, 05:52 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Code:
#include <strings.h>
near the top of that file should do it, although someone may provide a real C++ include -I think that '#include <string>' will not fix it. I recently had the same error and seem to remember including the C header to fix.
 
Old 03-15-2013, 06:03 AM   #3
klam
LQ Newbie
 
Registered: Aug 2009
Location: Canada
Posts: 4

Rep: Reputation: 0
Where are the definition includes?
I would have expected to see
Code:
#include <strings.h>
plus possibly
Code:
#include <string/strcasecmp.c>
near the top of the file.
 
Old 03-15-2013, 09:41 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,291

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
#include "strings.h"

did it nicely. Thanks guys.
 
Old 03-15-2013, 12:15 PM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
There are man-pages for such things, 'man strcasecmp', etc... You can also grep for the function under /usr/include.
 
Old 03-15-2013, 03:14 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,291

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I hadn't the least idea that 'strcasecmp' actually meant anything, and wasn't some variable the guy dreamed up :-/. But I am due a C module in 2013/14 so I won't have to ask as much then.
 
Old 03-16-2013, 04:30 AM   #7
klam
LQ Newbie
 
Registered: Aug 2009
Location: Canada
Posts: 4

Rep: Reputation: 0
as someone told me once "google is your friend".
 
Old 03-21-2013, 01:17 PM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,291

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Sorry, but I'm pulling this one back into the 'Undecided' Corner.

It makes, error free one binary and one man page. It installs. I make up a file to run on it, debug it, and get this
Code:
bash-4.2$ /usr/bin/drawtiming -o rc.png receive.txt
*** glibc detected *** /usr/bin/drawtiming: free(): invalid next size (fast): 0x0000000001939740 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7e4a6)[0x7f68d0afa4a6]
/usr/lib64/libMagickCore.so.5(RelinquishMagickMemory+0xf)[0x7f68d179debf]
/usr/lib64/libMagickCore.so.5(+0xeb003)[0x7f68d1739003]
/usr/lib64/libMagickCore.so.5(DrawPrimitive+0x1169)[0x7f68d1741f19]
/usr/lib64/libMagickCore.so.5(DrawImage+0x196b)[0x7f68d174486b]
/usr/lib64/libMagickCore.so.5(+0x7aead)[0x7f68d16c8ead]
/usr/lib64/libMagickCore.so.5(+0x7b902)[0x7f68d16c9902]
/usr/lib64/libMagickCore.so.5(AnnotateImage+0x34e)[0x7f68d16cad8e]
/usr/lib64/libMagickCore.so.5(DrawPrimitive+0x4af)[0x7f68d174125f]
/usr/lib64/libMagickCore.so.5(DrawImage+0x196b)[0x7f68d174486b]
/usr/lib64/../lib64/libMagickWand.so.5(DrawRender+0x74)[0x7f68d05c3864]
/usr/lib64/libMagick++.so.5(_ZN6Magick5Image4drawERKSt4listINS_8DrawableESaIS2_EE+0xb0)[0x7f68d1d1ca70]
/usr/bin/drawtiming[0x404743]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f68d0a9da95]
/usr/bin/drawtiming[0x404b69]
======= Memory map: ========
00400000-00412000 r-xp 00000000 08:03 48650                              /usr/bin/drawtiming
00611000-00613000 rw-p 00011000 08:03 48650                              /usr/bin/drawtiming
00613000-00623000 rw-p 00000000 00:00 0 
01924000-01a53000 rw-p 00000000 00:00 0                                  [heap]
7f68c9400000-7f68c9837000 rw-p 00000000 00:00 0 
7f68c9837000-7f68c986e000 r-xp 00000000 08:03 163726                     /usr/lib64/libcroco-0.6.so.3.0.1
7f68c986e000-7f68c9a6d000 ---p 00037000 08:03 163726                     /usr/lib64/libcroco-0.6.so.3.0.1
7f68c9a6d000-7f68c9a70000 rw-p 00036000 08:03 163726                     /usr/lib64/libcroco-0.6.so.3.0.1
7f68c9a70000-7f68c9a77000 r-xp 00000000 08:03 166309                     /usr/lib64/libffi.so.6.0.0
7f68c9a77000-7f68c9c77000 ---p 00007000 08:03 166309                     /usr/lib64/libffi.so.6.0.0
7f68c9c77000-7f68c9c78000 rw-p 00007000 08:03 166309                     /usr/lib64/libffi.so.6.0.0
7f68c9c78000-7f68c9c7b000 r-xp 00000000 08:03 131325                     /lib64/libdl-2.15.so
7f68c9c7b000-7f68c9e7a000 ---p 00003000 08:03 131325                     /lib64/libdl-2.15.so
7f68c9e7a000-7f68c9e7b000 r--p 00002000 08:03 131325                     /lib64/libdl-2.15.so
7f68c9e7b000-7f68c9e7c000 rw-p 00003000 08:03 131325                     /lib64/libdl-2.15.so
7f68c9e7c000-7f68c9e81000 r-xp 00000000 08:03 162360                     /usr/lib64/libXdmcp.so.6.0.0
7f68c9e81000-7f68ca080000 ---p 00005000 08:03 162360                     /usr/lib64/libXdmcp.so.6.0.0
7f68ca080000-7f68ca081000 rw-p 00004000 08:03 162360                     /usr/lib64/libXdmcp.so.6.0.0
7f68ca081000-7f68ca083000 r-xp 00000000 08:03 163853                     /usr/lib64/libXau.so.6.0.0
7f68ca083000-7f68ca283000 ---p 00002000 08:03 163853                     /usr/lib64/libXau.so.6.0.0
7f68ca283000-7f68ca284000 rw-p 00002000 08:03 163853                     /usr/lib64/libXau.so.6.0.0
7f68ca284000-7f68ca2a1000 r-xp 00000000 08:03 167810                     /usr/lib64/libxcb.so.1.1.0
7f68ca2a1000-7f68ca4a1000 ---p 0001d000 08:03 167810                     /usr/lib64/libxcb.so.1.1.0
7f68ca4a1000-7f68ca4a2000 rw-p 0001d000 08:03 167810                     /usr/lib64/libxcb.so.1.1.0
7f68ca4a2000-7f68ca5d4000 r-xp 00000000 08:03 167871                     /usr/lib64/libX11.so.6.3.0
7f68ca5d4000-7f68ca7d4000 ---p 00132000 08:03 167871                     /usr/lib64/libX11.so.6.3.0
7f68ca7d4000-7f68ca7da000 rw-p 00132000 08:03 167871                     /usr/lib64/libX11.so.6.3.0
7f68ca7da000-7f68ca7f0000 r-xp 00000000 08:03 166345                     /usr/lib64/libICE.so.6.3.0
7f68ca7f0000-7f68ca9f0000 ---p 00016000 08:03 166345                     /usr/lib64/libICE.so.6.3.0
7f68ca9f0000-7f68ca9f1000 rw-p 00016000 08:03 166345                     /usr/lib64/libICE.so.6.3.0
7f68ca9f1000-7f68ca9f5000 rw-p 00000000 00:00 0 
7f68ca9f5000-7f68ca9f8000 r-xp 00000000 08:03 131328                     /lib64/libuuid.so.1.3.0
7f68ca9f8000-7f68cabf7000 ---p 00003000 08:03 131328                     /lib64/libuuid.so.1.3.0
7f68cabf7000-7f68cabf8000 rw-p 00002000 08:03 131328                     /lib64/libuuid.so.1.3.0
7f68cabf8000-7f68cabff000 r-xp 00000000 08:03 166228                     /usr/lib64/libSM.so.6.0.1
7f68cabff000-7f68cadfe000 ---p 00007000 08:03 166228                     /usr/lib64/libSM.so.6.0.1
7f68cadfe000-7f68cadff000 rw-p 00006000 08:03 166228                     /usr/lib64/libSM.so.6.0.1
7f68cadff000-7f68cae08000 r-xp 00000000 08:03 164241                     /usr/lib64/libltdl.so.7.3.0
7f68cae08000-7f68cb007000 ---p 00009000 08:03 164241                     /usr/lib64/libltdl.so.7.3.0
7f68cb007000-7f68cb008000 rw-p 00008000 08:03 164241                     /usr/lib64/libltdl.so.7.3.0
7f68cb008000-7f68cb01c000 r-xp 00000000 08:03 131291                     /lib64/libz.so.1.2.6
7f68cb01c000-7f68cb21c000 ---p 00014000 08:03 131291                     /lib64/libz.so.1.2.6
7f68cb21c000-7f68cb21d000 rw-p 00014000 08:03 131291                     /lib64/libz.so.1.2.6
7f68cb21d000-7f68cb23e000 r-xp 00000000 08:03 131364                     /lib64/liblzma.so.5.0.4
7f68cb23e000-7f68cb43e000 ---p 00021000 08:03 131364                     /lib64/liblzma.so.5.0.4
7f68cb43e000-7f68cb43f000 rw-p 00021000 08:03 131364                     /lib64/liblzma.so.5.0.4
7f68cb43f000-7f68cb58f000 r-xp 00000000 08:03 163132                     /usr/lib64/libxml2.so.2.8.0
7f68cb58f000-7f68cb78e000 ---p 00150000 08:03 163132                     /usr/lib64/libxml2.so.2.8.0
7f68cb78e000-7f68cb798000 rw-p 0014f000 08:03 163132                     /usr/lib64/libxml2.so.2.8.0
7f68cb798000-7f68cb799000 rw-p 00000000 00:00 0 
7f68cb799000-7f68cb7a0000 r-xp 00000000 08:03 131388                     /lib64/librt-2.15.so
7f68cb7a0000-7f68cb99f000 ---p 00007000 08:03 131388                     /lib64/librt-2.15.so
7f68cb99f000-7f68cb9a0000 r--p 00006000 08:03 131388                     /lib64/librt-2.15.so
7f68cb9a0000-7f68cb9a1000 rw-p 00007000 08:03 131388                     /lib64/librt-2.15.so
7f68cb9a1000-7f68cbabd000 r-xp 00000000 08:03 166049                     /usr/lib64/libglib-2.0.so.0.3200.4
7f68cbabd000-7f68cbcbd000 ---p 0011c000 08:03 166049                     /usr/lib64/libglib-2.0.so.0.3200.4
7f68cbcbd000-7f68cbcbf000 rw-p 0011c000 08:03 166049                     /usr/lib64/libglib-2.0.so.0.3200.4
7f68cbcbf000-7f68cbcc0000 r-xp 00000000 08:03 164317                     /usr/lib64/libgthread-2.0.so.0.3200.4
7f68cbcc0000-7f68cbebf000 ---p 00001000 08:03 164317                     /usr/lib64/libgthread-2.0.so.0.3200.4
7f68cbebf000-7f68cbec0000 rw-p 00000000 08:03 164317                     /usr/lib64/libgthread-2.0.so.0.3200.4
7f68cbec0000-7f68cbf0b000 r-xp 00000000 08:03 166651                     /usr/lib64/libgobject-2.0.so.0.3200.4
7f68cbf0b000-7f68cc10b000 ---p 0004b000 08:03 166651                     /usr/lib64/libgobject-2.0.so.0.3200.4
7f68cc10b000-7f68cc10d000 rw-p 0004b000 08:03 166651                     /usr/lib64/libgobject-2.0.so.0.3200.4
7f68cc10d000-7f68cc110000 r-xp 00000000 08:03 164245                     /usr/lib64/libgmodule-2.0.so.0.3200.4
7f68cc110000-7f68cc30f000 ---p 00003000 08:03 164245                     /usr/lib64/libgmodule-2.0.so.0.3200.4
7f68cc30f000-7f68cc310000 rw-p 00002000 08:03 164245                     /usr/lib64/libgmodule-2.0.so.0.3200.4
7f68cc310000-7f68cc319000 r-xp 00000000 08:03 163405                     /usr/lib64/libXrender.so.1.3.0
7f68cc319000-7f68cc518000 ---p 00009000 08:03 163405                     /usr/lib64/libXrender.so.1.3.0
7f68cc518000-7f68cc519000 rw-p 00008000 08:03 163405                     /usr/lib64/libXrender.so.1.3.0
7f68cc519000-7f68cc53e000 r-xp 00000000 08:03 164204                     /usr/lib64/libpng14.so.14.12.0
7f68cc53e000-7f68cc73d000 ---p 00025000 08:03 164204                     /usr/lib64/libpng14.so.14.12.0
7f68cc73d000-7f68cc73e000 rw-p 00024000 08:03 164204                     /usr/lib64/libpng14.so.14.12.0
7f68cc73e000-7f68cc74d000 r-xp 00000000 08:03 131348                     /lib64/libbz2.so.1.0.6
7f68cc74d000-7f68cc94c000 ---p 0000f000 08:03 131348                     /lib64/libbz2.so.1.0.6
7f68cc94c000-7f68cc94e000 rw-p 0000e000 08:03 131348                     /lib64/libbz2.so.1.0.6
7f68cc94e000-7f68cc9d4000 r-xp 00000000 08:03 166567                     /usr/lib64/libfreetype.so.6.9.0
7f68cc9d4000-7f68ccbd4000 ---p 00086000 08:03 166567                     /usr/lib64/libfreetype.so.6.9.0
7f68ccbd4000-7f68ccbda000 rw-p 00086000 08:03 166567                     /usr/lib64/libfreetype.so.6.9.0
7f68ccbda000-7f68ccc01000 r-xp 00000000 08:03 164355                     /usr/lib64/libexpat.so.1.5.2
7f68ccc01000-7f68cce00000 ---p 00027000 08:03 164355                     /usr/lib64/libexpat.so.1.5.2
7f68cce00000-7f68cce03000 rw-p 00026000 08:03 164355                     /usr/lib64/libexpat.so.1.5.2
7f68cce03000-7f68cce37000 r-xp 00000000 08:03 166489                     /usr/lib64/libfontconfig.so.1.5.0
7f68cce37000-7f68cd037000 ---p 00034000 08:03 166489                     /usr/lib64/libfontconfig.so.1.5.0
7f68cd037000-7f68cd039000 rw-p 00034000 08:03 166489                     /usr/lib64/libfontconfig.so.1.5.0
7f68cd039000-7f68cd0b9000 r-xp 00000000 08:03 164363                     /usr/lib64/libpixman-1.so.0.26.2
7f68cd0b9000-7f68cd2b8000 ---p 00080000 08:03 164363                     /usr/lib64/libpixman-1.so.0.26.2
7f68cd2b8000-7f68cd2be000 rw-p 0007f000 08:03 164363                     /usr/lib64/libpixman-1.so.0.26.2
7f68cd2be000-7f68cd367000 r-xp 00000000 08:03 168017                     /usr/lib64/libcairo.so.2.11000.2
7f68cd367000-7f68cd567000 ---p 000a9000 08:03 168017                     /usr/lib64/libcairo.so.2.11000.2
7f68cd567000-7f68cd569000 rw-p 000a9000 08:03 168017                     /usr/lib64/libcairo.so.2.11000.2
7f68cd569000-7f68cd56c000 rw-p 00000000 00:00 0 
7f68cd56c000-7f68cd582000 r-xp 00000000 08:03 131386                     /lib64/libresolv-2.15.so
7f68cd582000-7f68cd782000 ---p 00016000 08:03 131386                     /lib64/libresolv-2.15.so
7f68cd782000-7f68cd783000 r--p 00016000 08:03 131386                     /lib64/libresolv-2.15.so
7f68cd783000-7f68cd784000 rw-p 00017000 08:03 131386                     /lib64/libresolv-2.15.so
7f68cd784000-7f68cd786000 rw-p 00000000 00:00 0 
7f68cd786000-7f68cd8cc000 r-xp 00000000 08:03 164482                     /usr/lib64/libgio-2.0.so.0.3200.4
7f68cd8cc000-7f68cdacb000 ---p 00146000 08:03 164482                     /usr/lib64/libgio-2.0.so.0.3200.4
7f68cdacb000-7f68cdad1000 rw-p 00145000 08:03 164482                     /usr/lib64/libgio-2.0.so.0.3200.4
7f68cdad1000-7f68cdad2000 rw-p 00000000 00:00 0 
7f68cdad2000-7f68cdaf0000 r-xp 00000000 08:03 166320                     /usr/lib64/libgdk_pixbuf-2.0.so.0.2600.1
7f68cdaf0000-7f68cdcf0000 ---p 0001e000 08:03 166320                     /usr/lib64/libgdk_pixbuf-2.0.so.0.2600.1
7f68cdcf0000-7f68cdcf1000 rw-p 0001e000 08:03 166320                     /usr/lib64/libgdk_pixbuf-2.0.so.0.2600.1
7f68cdcf1000-7f68cdd39000 r-xp 00000000 08:03 166914                     /usr/lib64/libpango-1.0.so.0.3000.1
7f68cdd39000-7f68cdf39000 ---p 00048000 08:03 166914                     /usr/lib64/libpango-1.0.so.0.3000.1
7f68cdf39000-7f68cdf3c000 rw-p 00048000 08:03 166914                     /usr/lib64/libpango-1.0.so.0.3000.1
7f68cdf3c000-7f68cdf67000 r-xp 00000000 08:03 166624                     /usr/lib64/libpangoft2-1.0.so.0.3000.1
7f68cdf67000-7f68ce167000 ---p 0002b000 08:03 166624                     /usr/lib64/libpangoft2-1.0.so.0.3000.1
7f68ce167000-7f68ce168000 rw-p 0002b000 08:03 166624                     /usr/lib64/libpangoft2-1.0.so.0.3000.1
7f68ce168000-7f68ce174000 r-xp 00000000 08:03 166563                     /usr/lib64/libpangocairo-1.0.so.0.3000.1
7f68ce174000-7f68ce373000 ---p 0000c000 08:03 166563                     /usr/lib64/libpangocairo-1.0.so.0.3000.1
7f68ce373000-7f68ce374000 rw-p 0000b000 08:03 166563                     /usr/lib64/libpangocairo-1.0.so.0.3000.1
7f68ce374000-7f68ce3a8000 r-xp 00000000 08:03 168567                     /usr/lib64/librsvg-2.so.2.36.1
7f68ce3a8000-7f68ce5a7000 ---p 00034000 08:03 168567                     /usr/lib64/librsvg-2.so.2.36.1
7f68ce5a7000-7f68ce5a9000 rw-p 00033000 08:03 168567                     /usr/lib64/librsvg-2.so.2.36.1
7f68ce5a9000-7f68ce5c2000 r-xp 00000000 08:03 166515                     /usr/lib64/libIex.so.6.0.0
7f68ce5c2000-7f68ce7c2000 ---p 00019000 08:03 166515                     /usr/lib64/libIex.so.6.0.0
7f68ce7c2000-7f68ce7c6000 rw-p 00019000 08:03 166515                     /usr/lib64/libIex.so.6.0.0
7f68ce7c6000-7f68ce7cc000 r-xp 00000000 08:03 168327                     /usr/lib64/libIlmThread.so.6.0.0
7f68ce7cc000-7f68ce9cb000 ---p 00006000 08:03 168327                     /usr/lib64/libIlmThread.so.6.0.0
7f68ce9cb000-7f68ce9cc000 rw-p 00005000 08:03 168327                     /usr/lib64/libIlmThread.so.6.0.0
7f68ce9cc000-7f68cea0e000 r-xp 00000000 08:03 168133                     /usr/lib64/libHalf.so.6.0.0
7f68cea0e000-7f68cec0d000 ---p 00042000 08:03 168133                     /usr/lib64/libHalf.so.6.0.0
7f68cec0d000-7f68cec0e000 rw-p 00041000 08:03 168133                     /usr/lib64/libHalf.so.6.0.0
7f68cec0e000-7f68cec13000 r-xp 00000000 08:03 164314                     /usr/lib64/libImath.so.6.0.0
7f68cec13000-7f68cee12000 ---p 00005000 08:03 164314                     /usr/lib64/libImath.so.6.0.0
7f68cee12000-7f68cee13000 rw-p 00004000 08:03 164314                     /usr/lib64/libImath.so.6.0.0
7f68cee13000-7f68ceee3000 r-xp 00000000 08:03 168337                     /usr/lib64/libIlmImf.so.6.0.0
7f68ceee3000-7f68cf0e2000 ---p 000d0000 08:03 168337                     /usr/lib64/libIlmImf.so.6.0.0
7f68cf0e2000-7f68cf0e6000 rw-p 000cf000 08:03 168337                     /usr/lib64/libIlmImf.so.6.0.0
7f68cf0e6000-7f68cf0e7000 rw-p 00000000 00:00 0 
7f68cf0e7000-7f68cf146000 r-xp 00000000 08:03 167700                     /usr/lib64/libXt.so.6.0.0
7f68cf146000-7f68cf345000 ---p 0005f000 08:03 167700                     /usr/lib64/libXt.so.6.0.0
7f68cf345000-7f68cf34b000 rw-p 0005e000 08:03 167700                     /usr/lib64/libXt.so.6.0.0
7f68cf34b000-7f68cf34c000 rw-p 00000000 00:00 0 
7f68cf34c000-7f68cf35c000 r-xp 00000000 08:03 166128                     /usr/lib64/libXext.so.6.4.0
7f68cf35c000-7f68cf55c000 ---p 00010000 08:03 166128                     /usr/lib64/libXext.so.6.4.0
7f68cf55c000-7f68cf55d000 rw-p 00010000 08:03 166128                     /usr/lib64/libXext.so.6.4.0
7f68cf55d000-7f68cf659000 r-xp 00000000 08:03 164326                     /usr/lib64/libfftw3.so.3.2.4Aborted
My favourite test
bash-4.2$ ldd /usr/bin/drawtiming |grep found

throws up nothing, but if I drop the found, it is linked against an _awful_lot_ of stuff - 60 libs at at least. I have highlighted the only thing that looks like an error, but what does it mean? I tried specifying the default font size, but then it throws a segmentation fault. I do not suspect memory. Any thoughts welcome.
 
Old 03-23-2013, 06:56 AM   #9
klam
LQ Newbie
 
Registered: Aug 2009
Location: Canada
Posts: 4

Rep: Reputation: 0
What are you trying to do?
The ldd command just lists the shared library dependencies! you are then pipeline the output of ldd to grep which looks for the string "found". How does this help solve the glitch in your code?

My (somewhat rusty) understanding of the problem is that somewhere in your code you invoke the function with invalid parameters or state, which causes glibc to throw an exception.
Following the backtrace it looks as though you called libMagick++ to draw/render something.

So take a look at your code for point were your are drawing or rendering something and make sure that the call is valid.

As it looks as though you are trying to learn C++, my suggestion would be for you to get a book on elementary C++.

Last edited by klam; 03-23-2013 at 06:59 AM.
 
Old 03-23-2013, 07:10 AM   #10
klam
LQ Newbie
 
Registered: Aug 2009
Location: Canada
Posts: 4

Rep: Reputation: 0
It might also be a good idea to visit the ImageMagick web site and take a look at their "gentle introduction to imageMagick".
 
Old 03-23-2013, 10:17 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,291

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
What are you trying to do?
The ldd command just lists the shared library dependencies! you are then pipeline the output of ldd to grep which looks for the string "found". How does this help solve the glitch in your code?
I have found missing libs at the bottom of some crazy crashes. ldd |grep found checks that.
I can boot a ressurect a 32 bit box here and it has a working version of drawtiming, that doesn't work on this box because of version issues. I will do that, and forget this. The code appears unmaintained. The program reads in a text file and draws a timing diagram (used in designing digital electronics) using ImageMagick. I've attached an example of the output. I'm not going to try and fix the code - I'm not there yet.
Attached Thumbnails
Click image for larger version

Name:	startup.png
Views:	20
Size:	12.3 KB
ID:	12118  
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] drawtiming error - Programming, gcc version or what? business_kid Programming 9 11-27-2011 11:48 AM
[SOLVED] #define in C++ ravishekhar.82 Programming 12 04-06-2010 07:03 AM
Help with a #define Wynd Programming 4 04-22-2007 03:30 PM
m4 define in a define Four Programming 0 03-04-2007 09:41 PM
using #define Jo_Nak Programming 4 06-11-2003 01:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration