Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined symbol: png_create_write_struct #20

Open
alexbeletsky opened this issue Nov 25, 2012 · 7 comments
Open

undefined symbol: png_create_write_struct #20

alexbeletsky opened this issue Nov 25, 2012 · 7 comments

Comments

@alexbeletsky
Copy link

node: 0.8.14
libpng: 1.4.12

Package installed successfully, but if I try one of examples, I got:

 node: symbol lookup error: /vagrant/app/node_modules/png/build/Release/png.node: undefined symbol:    png_create_write_struct
@darkyen
Copy link

darkyen commented Dec 15, 2012

try ldd on the png.node and kindly send the reply here , if its still relevant :-)

@victor73
Copy link

I get this issue too on Ubuntu 12.10 x86_64:

node 0.8.4
libpng: 1.2.49-1ubuntu1

ldd ~/node_modules/png/build/Release/png.node
    linux-vdso.so.1 =>  (0x00007fffb21ff000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa11c362000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa11c14c000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa11bd8c000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa11ba90000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fa11c8a7000)

@darkyen
Copy link

darkyen commented Dec 27, 2012

@victor73 its not linking libpng "clearly"

Make sure your libpng is in your link paths , defined in the .gyp or re-configure it and build it as per your computer's filesystem statistics

@samccone
Copy link
Contributor

samccone commented May 3, 2013

similar issue

per @darkyen request

otool -l build/Release/png.node

build/Release/png.node:
Load command 0
      cmd LC_SEGMENT_64
  cmdsize 632
  segname __TEXT
   vmaddr 0x0000000000000000
   vmsize 0x0000000000007000
  fileoff 0
 filesize 28672
  maxprot 0x00000007
 initprot 0x00000005
   nsects 7
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x00000000000008a0
      size 0x00000000000038a3
    offset 2208
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __stubs
   segname __TEXT
      addr 0x0000000000004144
      size 0x0000000000000216
    offset 16708
     align 2^1 (2)
    reloff 0
    nreloc 0
     flags 0x80000408
 reserved1 0 (index into indirect symbol table)
 reserved2 6 (size of stubs)
Section
  sectname __stub_helper
   segname __TEXT
      addr 0x000000000000435c
      size 0x000000000000042c
    offset 17244
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __gcc_except_tab
   segname __TEXT
      addr 0x0000000000004788
      size 0x0000000000000e70
    offset 18312
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __cstring
   segname __TEXT
      addr 0x00000000000055f8
      size 0x0000000000000964
    offset 22008
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __unwind_info
   segname __TEXT
      addr 0x0000000000005f5c
      size 0x000000000000029c
    offset 24412
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __eh_frame
   segname __TEXT
      addr 0x00000000000061f8
      size 0x0000000000000e08
    offset 25080
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 1
      cmd LC_SEGMENT_64
  cmdsize 472
  segname __DATA
   vmaddr 0x0000000000007000
   vmsize 0x0000000000001000
  fileoff 28672
 filesize 4096
  maxprot 0x00000007
 initprot 0x00000003
   nsects 5
    flags 0x0
Section
  sectname __dyld
   segname __DATA
      addr 0x0000000000007000
      size 0x0000000000000010
    offset 28672
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __got
   segname __DATA
      addr 0x0000000000007010
      size 0x0000000000000030
    offset 28688
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 89 (index into indirect symbol table)
 reserved2 0
Section
  sectname __la_symbol_ptr
   segname __DATA
      addr 0x0000000000007040
      size 0x00000000000002c8
    offset 28736
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000007
 reserved1 95 (index into indirect symbol table)
 reserved2 0
Section
  sectname __data
   segname __DATA
      addr 0x0000000000007310
      size 0x0000000000000090
    offset 29456
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __const
   segname __DATA
      addr 0x00000000000073a0
      size 0x0000000000000060
    offset 29600
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __LINKEDIT
   vmaddr 0x0000000000008000
   vmsize 0x0000000000006000
  fileoff 32768
 filesize 22088
  maxprot 0x00000007
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 3
          cmd LC_ID_DYLIB
      cmdsize 40
         name @rpath/png.node (offset 24)
   time stamp 1 Wed Dec 31 19:00:01 1969
      current version 0.0.0
compatibility version 0.0.0
Load command 4
     cmd LC_SYMTAB
 cmdsize 24
  symoff 33648
   nsyms 574
  stroff 43664
 strsize 11192
Load command 5
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 413
     iextdefsym 413
     nextdefsym 76
      iundefsym 489
      nundefsym 85
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 42928
  nindirectsyms 184
      extreloff 42832
        nextrel 12
      locreloff 32768
        nlocrel 96
Load command 6
     cmd LC_UUID
 cmdsize 24
    uuid D5B9D537-D05D-3B87-99E3-0B6EF5B3EF25
Load command 7
      cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.5
      sdk 10.8
Load command 8
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libstdc++.6.dylib (offset 24)
   time stamp 2 Wed Dec 31 19:00:02 1969
      current version 56.0.0
compatibility version 7.0.0
Load command 9
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Wed Dec 31 19:00:02 1969
      current version 169.3.0
compatibility version 1.0.0
Load command 10
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libgcc_s.1.dylib (offset 24)
   time stamp 2 Wed Dec 31 19:00:02 1969
      current version 1669.0.0
compatibility version 1.0.0
Load command 11
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 33536
 datasize 112
Load command 12
      cmd LC_DATA_IN_CODE
  cmdsize 16
  dataoff 33648
 datasize 0

@samccone
Copy link
Contributor

samccone commented May 3, 2013

fixed in #29

@pkrumins
Copy link
Owner

I've merged all @samccone's patches. It should be working now!

@pkrumins
Copy link
Owner

I've published it as version 3.0.1 on npm! Try it out. If it works, I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants