Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6096689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:57:26+00:00 2026-05-23T12:57:26+00:00

I’m using Cygwin/Windows and I’m trying to build a native module for node.js. I

  • 0

I’m using Cygwin/Windows and I’m trying to build a native module for node.js. I intend to make use of the OpenSSL Library. I have installed openssl from the Cygwin package manager.

I have the following lines in my .cc file:

#include <openssl/dh.h>

and

 DH*    public_dh_key = DH_new();

But when I try to link/compile it with node-waf configure build, I get:

undefined reference to _DH_new

Edit:

Part of the build script:

def build(bld):
  ppp= bld.new_task_gen('cxx', 'shlib', 'node_addon')
  ppp.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall", "-L/usr/lib", "-lssl"]
...

(I have tried adding -lcrypto but still get the same result. I have also tried various combinations of “-lssl32″,”-lssleay32″,”-llibeay32″.)

Edit

Output of the build script:

$ node-waf configure build
Checking for program g++ or c++          : /usr/bin/g++
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for g++                         : ok
Checking for node path                   : not found
Checking for node prefix                 : ok /usr/local
'configure' finished successfully (0.330s)
Waf: Entering directory `/usr/src/build'
[1/2] cxx: ppp.cc -> build/default/ppp_1.o
[2/2] cxx_link: build/default/ppp_1.o -> build/default/ppp.node build/default/libppp.dll.a
Creating library file: default/libppp.dll.a
default/ppp_1.o:/usr/src/build/../ppp.cc:289: undefined reference to `_HMAC'
collect2: ld returned 1 exit status
Waf: Leaving directory `/usr/src/build'
Build failed:  -> task failed (err #1):
        {task: cxx_link ppp_1.o -> ppp.node,libppp.dll.a}

Edit

I have the header file dh.h in usr/include/openssl

And I have the required files (libssl32.dll, libeay32.dll and ssleay32.dll) in /usr/lib/

The answer

jHackTheRipper answered this and got the credit for it, but the final answer is buried in the comments beneath his answer. So to summarise, the waf mantra is

obj.lib='crypto'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:57:27+00:00Added an answer on May 23, 2026 at 12:57 pm

    Adding -lcrypto should do the trick.
    According to the nm output on my system _DH_new and _HMAC seem to be in the libcrypto (part of OpenSSL) dynamic library :

    jhacktheripper@macbook-prolocal:~$ nm /usr/lib/libcrypto.dylib | grep _DH_new
    0000000000036360 T _DH_new
    0000000000036120 T _DH_new_method
    
    
    jhacktheripper@macbook-prolocal:~$ nm /usr/lib/libcrypto.dylib | grep HMAC
    0000000000090d40 T _HMAC
    0000000000090c80 T _HMAC_CTX_cleanup
    0000000000090910 T _HMAC_CTX_init
    00000000000908c0 T _HMAC_CTX_set_flags
    0000000000090940 T _HMAC_Final
    0000000000090cc0 T _HMAC_Init
    0000000000090a10 T _HMAC_Init_ex
    0000000000090a00 T _HMAC_Update
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to loop through a bunch of documents I have to put
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.