30880

Trouble with header file

Question:

I got the following error on compiling a c code I wrote. I understand that the problem is in the header file. Can anyone please tell me which all header files are needed to define these functions.

sign.c: In function ‘main’: sign.c:78: warning: assignment makes pointer from integer without a cast /tmp/ccnsSeHy.o: In function `sign_data_evp': sign.c:(.text+0x68): undefined reference to `check_ssl_rv' sign.c:(.text+0xd5): undefined reference to `check_ssl_rv' sign.c:(.text+0x13e): undefined reference to `check_ssl_rv' /tmp/ccnsSeHy.o: In function `main': sign.c:(.text+0x1ca): undefined reference to `initialize' sign.c:(.text+0x1d6): undefined reference to `select_engine' sign.c:(.text+0x20a): undefined reference to `sign_data' sign.c:(.text+0x216): undefined reference to `clean_engine' sign.c:(.text+0x21b): undefined reference to `clean_up' collect2: ld returned 1 exit status

The header files that I have used so far is:

#include <stdio.h> #include <string.h> #include <errno.h> #include <netdb.h> #include <unistd.h> #ifdef __VMS #include <socket.h> #include <inet.h> #include <in.h> #else #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #endif #include <openssl/crypto.h> #include <openssl/ssl.h> #include <openssl/err.h>

Operating platform: Linux Thanks in advance.

Answer1:

You understand it wrong. It does not complain about unknown function prototype, it complains during the linking. So you probably forgot to link with some library or some object file.

Answer2:

try with this gcc sslprogname.c -o sslprogname -Wl,-Bstatic -lssl -Wl,-Bdynamic -lssl3 -lcrypto.It worked for me

Recommend

  • Loading main XIB makes app crash on iOS 3.0
  • Arduino Sensor 10DOF MPU9255 cannot fetch magnetometer data
  • JMP unexpected behavior in Shellcode when next(skipped) instruction is a variable definition
  • How to find a word in a string using a pattern in python
  • Sending Multicast with RAW Socket in C on Linux
  • Can cPickle save reshaped numpy object reference?
  • where is chrome CSS Reference
  • Linked tables and Slicer in excel
  • closing WCF proxy
  • Enterprise Architect Synchronize with Code
  • Cannot run the macro
  • Aspect advising other aspects
  • Avoid Rendering “No Data Available in the table” in Datatables
  • How to implement arriving behavior with time delta?
  • Upload a video to Youtube using the python API and set it as unlisted
  • Python object matching using string
  • What is the right syntax for “timeframe” in MailChimp API 3.0
  • What is the best way to include a style sheet for a specific page?
  • Lua string.gsub() by '%s' or '\\n' pattern
  • Firebase, only get new children
  • In java, how do you retrieve images from a jar file?
  • Access Google Maps from outside
  • NHibernate proxyexception
  • Pointer vs Reference difference when passing Eigen objects as arguments
  • Get UILabel out of UIButton
  • c++ search a vector for element first seen position
  • Using an STL Iterator without initialising it
  • Unix Network Programming Clarification
  • Opaque reference instead of PImpl. Is it possible?
  • Google map in top corner left
  • c++ regex_replace not doing intended substitution
  • using System.Speech.Synthesis with Windows10 universal app (XAML-C#)
  • GAE: Way to get reference to an HttpSession from its ID?
  • Spring boot 2.0.0.M4 required a bean named 'entityManagerFactory' that could not be found
  • What is the purpose of TaskExecutor in spring?
  • Android activity accessing service's static reference before the service is ready
  • MySQL WHERE-condition in procedure ignored
  • Web-crawler for facebook in python
  • trying to dynamically update Highchart column chart but series undefined
  • java string with new operator and a literal