So I'm developing my project in Eclipse in Ubuntu 10.04. I have the following lines of code:
#include <pty.h>
pid_t pid;
int master;
pid = forkpty(&master, NULL, NULL, NULL);
But when I try to build it within Eclipse, I get the error:
undefined reference to 'forkpty'
Any idea how to solve this problem?
You need -lutil command line argument (to use libutil shared library).
For Eclipse:
http://zetcode.com/articles/eclipsecdevelopment/
Select Project Properties. Expand the C/C++ Build tab. Select settings. From the Tool Settings tab, expand the GCC C Linker option. Click on libraries. Add the /usr/lib/libutil.so to the Libraries window. Notice, that this path may be different on your system.
That's a linking error; you're missing the util library. Do this to build on the command line:
g++ myprogram.cpp -lutil
Eclipse should have project-level settings for listing the libraries to link against.
I came upon this issue when I was trying to install delegate
So if you are trying to make delegate and getting error
undefined reference to `forkpty'
so edit _-forkpty.c file inside maker folder
vim maker/_-forkpty.c and add
#include <util.h>
make clean
make
Related
I want to set up ROOT from CERN in my Xcode IDE but I'm having problems linking the libraries. I'm using root 6.04.14 and xcode 7.3.
I created a mock up project where I simply have a .cpp where I include a basic class from root (#include "TFile.h"). This I can compile from command line by:
clang++ -std=c++11 -I/opt/root/root-6.04.14/include/root -L/opt/root/root-6.04.14/lib/root -lCore main.cpp
Now it comes to setting up everything in the Xcode IDE. I included "/opt/root/root-6.04.14/include/root" in the header search path and Xcode is not complaining, so I guess it finds the header files. I tried adding "/opt/root/root-6.04.14/lib/root -lCore" to the library search path but I get errors:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:301:
/opt/root/root-6.04.14/include/root/Math/math.h:65:11: error: no member named 'log1p' in the global namespace; did you mean simply 'log1p'?
return ::log1p(x);
^~
/opt/root/root-6.04.14/include/root/Math/math.h:63:15: note: 'log1p' declared here
inline double log1p( double x) {
^
/opt/root/root-6.04.14/include/root/Math/math.h:76:11: error: no member named 'expm1' in the global namespace; did you mean simply 'expm1'?
return ::expm1(x);
^~
/opt/root/root-6.04.14/include/root/Math/math.h:74:15: note: 'expm1' declared here
inline double expm1( double x) {
and so on...
Furthermore when I look at the terminal command Xcode is running(at least that is what I think it does) there is no "-L/opt/root/root-6.04.14/lib/root -lCore" included. I then tried to put "-L/opt/root/root-6.04.14/lib/root -lCore" into other linker flags. Now it is included in the terminal command but still giving me the same error.
Question1:
I noticed Xcode is running "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" while I have been using clang++, where is the difference and how can I change it?
Question2:
What is the difference between adding the directory to the library search path and putting it in via the linker flag?
Question3:
The big one, where do I mess up?
You've probably already figured this out, but just in case someone else stumbles on this issue here's how I've setup my ROOT (v6.06.04) in xcode. To demonstrate, lets start from scratch with a fresh xcode project.
Say we want to run the following program in xcode (note that it uses ROOT classes)
#include <iostream>
#include "TApplication.h"
#include "TCanvas.h"
#include "TGraph.h"
#include <vector>
int main(int argc, const char * argv[]) {
// Create a TApplication so that we can get plot the histogram
TApplication* myApp = new TApplication("myApp", 0, 0) ;
// Create some vector information
std::vector<double> x(100), y(100) ;
for (int i=0; i<x.size(); i++) {
x[i] = i * (10.0/x.size()) ;
y[i] = std::cos(x[i]) ;
}
// Create a TGraph
TGraph* graph = new TGraph(x.size(), &x[0], &y[0]) ;
// Create a canvas and draw the graph
TCanvas* canvas = new TCanvas("canvas","canvas") ;
graph->Draw("ap0") ;
canvas->Update() ;
// Run the TApplication to produce all of the plots
myApp->Run() ;
return 0;
}
If you just copy and paste this program into xcode you'll see that the ROOT headers arent recognized by xcode and you get the error 'XXX.h' file not found. This is obviously because we need to tell xcode where to find the headers.
Click on your project in the left-side menu
Under "Build Settings" click the "+" -> "Add User-Defined Settings".
This will add a parameter under the "User-Defined" section. Call the new parameter "ROOTSYS" and point it to the top directory of your ROOT installation. For me this is /Users/user/root_cern/root_v6.06.04/. (Note: This step isnt absolutely necessary but makes the rest less painful and allows you to update your ROOT installation without having to change the header and library paths below)
Now (still in "Build Settings") go to "Search Paths" -> "User Header Search Paths". In this field add the path "$(ROOTSYS)/include"
Set the "Search Paths" -> "Always Search User Paths" field to Yes
At this point the nasty errors on our headers have gone away! Unfortunately, the program wont build. A look at the build errors shows that there are TONS of linking errors! Clearly we need to update our linker flags to include all the ROOT libraries we want to compile against.
Open a terminal and run $ROOTSYS/bin/root-config --libs. For me the output is:
-L/Users/user/root_cern/root_v6.06.04/lib -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lpthread -Wl,-rpath,/Users/user/root_cern/root_v6.06.04/lib -stdlib=libc++ -lm -ldl
Copy the output from the above root-config and paste it under "Build Settings" -> "Linking" -> "Other Linker Flags". Note that you can replace all instances of the path to your ROOT install directory with $(ROOTSYS) and you wont have to update them in the future when you update your ROOT version.
Now the program should build just fine! If you're STILL getting the linking errors, make sure that the TARGET you're trying to build inherits it's linking information from the project. Do this by going to "Other Linker Flags" for the target you are building and set it to $(inherited). You'll get the handy plot of a cos(x) function.
A few notes:
If you dont use a TApplication, the program will end before you get a chance to look at your plot.
You can end the program either through the xcode GUI or by selecting "File" -> "Quit Root" in the plot's menu bar.
Things get a bit more complicated if you're trying to write a class that you want ROOT to be able to stream out to the file. It's possible to do it by adding in an additional "Run Script" build phase to your target. For now though, this should get you started.
Thank you for your detailed guide, I followed it as precise as possible. Only the remark: $(inherited) I am not sure. Unfortunately it does not work on my MAC (M1), Xcode 14.0. Installed ROOT with Home Brew. The ROOT command line tools work fine (I get graphs). Xcode does not give errors in the code (red bars). But there are 6 errors in "ROOT_basic":
error build: Undefined symbol: TApplication::TApplication(char const*, int*, char**, void*, int)
error build: Undefined symbol: TVersionCheck::TVersionCheck(int)
error build: Undefined symbol: TGraph::TGraph(int, double const*, double const*)
error build: Undefined symbol: TCanvas::TCanvas(char const*, char const*, int)
error build: Undefined symbol: TObject::operator delete(void*)
error build: Undefined symbol: TStorage::ObjectAlloc(unsigned long)
Edit: It turned out to be a install problem. I uninstalled Root via Brew and installed it again with Macports. Now it works
I am attempting to setup SDL2 for C++ with Eclipse on Windows 7.
In order to do so, I am following the tutorial in this link, which states that I must first install MinGW. So I follow the link provided in order to setup MinGW. I follow all the steps without issue. I then open Eclipse and attempt to build a simple hello world program:
#include <iostream>
using namespace std;
int main() {
cout << "Hello World!" << endl;
return 0;
}
To my surprise, this code doesn't build, with 6 errors.
I then proceed to simplify the program further:
int main()
{
return 0;
}
This also does not compile. There are two errors:
Program "g++" not found in PATH
Program "gcc" not found in PATH
Here is a screenshot.
However, my path does contain "C:\mingw\bin". I have also tried changing this to "C:\mingw". Looking inside "C:\mingw\bin", I find gcc and g++:
In addition, compiling a test program using the command line (g++ Test.cpp -o Test) works just fine, as does "g++ -v".
I have been searching the web for hours, and can't seem to find an answer as to why Eclipse can't seem to compile anything with MinGW. Questions I have looked at on SO (which haven't been able to fix my issue) include:
Eclipse mingw binary not found
Eclipse not finding c std libraries
g++ not found in path
Eclipse C++ : "Program g++ not found in PATH"
Program g++ not found in path
Program g++ not found in path C++ [duplicate]
Eclipse CDT (Juno) in Win7: Cannot find g++ in PATH, iostream unresolved and other fun stuff
Additional info:
Window > Preferences > C/C++ > Build > Settings > "CDT GCC Built-in Complier Settings MinGW [Shared]" : Toolchain MinGW GCC is not detected on this system.
I have also reinstalled Eclipse to no avail.
I realize that this may be a duplicate question of some that I have linked, but the information in previous questions have not been able to fix my problem, and I fear that adding a comment to an old question may not result in an answer.
Please request additional information as needed.
You need to set the environment for the c/c++ builder.
First you need to install the GNU tool-chain, you can choose either MinGW or Cygwin. You can see the steps here. I used MinGW.
Go to Window->Preferences->C/C++->Build->Environment and add a new variable, name it whatever you want for example a named it "MINGW", now paste the binaries directory of MinGW which is by default C:\MinGW\bin, you should have something like this:
Now when you create a new project you just have to select the MinGW tool-chain:
Hope that helps.
It appears as though I have fixed the problem for the moment.
In case others encounter the same issue:
Project > Properties > C/C++ Build > Settings > MinGW C++ Linker > Command changed from "g++" to "C:\mingw\bin\g++".
I am trying to use libcurl for a simple application using CodeBlocks IDE. In Codeblocks IDE, after clicking on Build Options ==> Linker Settings ==> Link Libraries ==> "Add" , the file browser only allows me to choose between *.a, *.so, *.lib, and *.dyl files. Why is it not allowing me to choose *.dll files? I downloaded the binary packages for Windows for libcurl and they all provide .dll files. This is what it looks like:
====UPDATE====
Hi I have now downloaded the following zip file for lib curl
which includes CURL Source, DLL Files, and a .lib file. It can be
found here: http://www.confusedbycode.com/curl/curl-7.34.0-win64.zip
However, I am still having issues being able to compile my source
code.
Below is my source code:
include
#include <iostream>
#include <stdio.h>
#include "curl/curl.h"
using namespace std;
int main()
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* example.com is redirected, so we tell libcurl to follow redirection */
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
Below is a screen shot of my CodeBlocks IDE working directory:
Below are screen shots of my build options for Linker/Compiler, and Linker Libraries:
I am not sure what is wrong with the setup. It is having trouble building. It is returning the following error messages:
Below is the latest Build Log:
-------------- Build: Debug in libcurl_c (compiler: GNU GCC Compiler)---------------
mingw32-gcc.exe -Wall -g -IC:\Users\bbb\Desktop\libcurl_packages\confused_by_code\curl-7.34.0-win64\curl-7.34.0-win64\include -c C:\Users\bbb\Desktop\workspace\libcurl_c\main.c -o obj\Debug\main.o
mingw32-g++.exe -o bin\Debug\libcurl_c.exe obj\Debug\main.o C:\Users\bbb\Desktop\libcurl_packages\confused_by_code\curl-7.34.0-win64\curl-7.34.0-win64\lib\libcurl.lib
obj\Debug\main.o: In function `main':
C:/Users/bbb/Desktop/workspace/libcurl_c/main.c:9: undefined reference to `_imp__curl_easy_init'
C:/Users/bbb/Desktop/workspace/libcurl_c/main.c:11: undefined reference to `_imp__curl_easy_setopt'
C:/Users/bbb/Desktop/workspace/libcurl_c/main.c:13: undefined reference to `_imp__curl_easy_setopt'
C:/Users/bbb/Desktop/workspace/libcurl_c/main.c:16: undefined reference to `_imp__curl_easy_perform'
C:/Users/bbb/Desktop/workspace/libcurl_c/main.c:19: undefined reference to `_imp__curl_easy_strerror'
C:/Users/bbb/Desktop/workspace/libcurl_c/main.c:23: undefined reference to `_imp__curl_easy_cleanup'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
6 errors, 0 warnings (0 minutes, 1 seconds)
A DLL (dynamic link library) is searched for and loaded by your program at runtime. To
make this happen automatically, you do not link the .dll itself (you can't). You link the matching import library, with extension .lib.
The import library for libcurl.dll is libcurl.lib. If you have downloaded and extracted cURL, say, into C:\develop\curl-7.34.0-win32, then you will find the import library at
C:\develop\curl-7.34.0-win32\lib\libcurl.lib. You should add this file to the libraries
for your Code::Blocks project.
The project will then link (unless it has other problems), but in order for it to run successfully it will have to find libcurl.dll in one of the locations that are searched for DLLs at runtime. The simplest way to ensure this is to place a copy of libcurl.dll in the directory from which your program runs. Otherwise you can decide on a location for it by studying
Dynamic-Link Library Search Order
You may have difficulty in finding the right binary package to download from
the plethora available here. Some
of them are packages of the cURL commandline tools (which you don't want)
and some of them are packages of the development binaries (which you do want)
for various platforms. Visit http://www.confusedbycode.com/curl/ and download
either curl-7.34.0-win32.zip or curl-7.34.0-win64.zip, depending on
whether you are targetting win32 or win64. Extract the archive and
find the import library and DLL in the subdirectories lib and dlls,
respectively.
Update for OP's further issues
Your program is the supplied example simple.c with the addition of a C++ header, <iostream>.
Delete your libcurl project and start again with a clean C project (not C++).
Add only 1 source file to the C project, the example simple.c or a copy of it. Don't make it a .cpp file or otherwise change it. Don't add any other files to the project.
In Build options -> Linker settings -> Link libraries add the relative path to libcurl.lib as you did before.
In Build options -> Search Directories -> Compiler (not Linker) add the relative path to the cURL include directory and nothing else (not the include\curl directory).
Do not put anything in Search directories -> Linker.
Build the project. It compiles and links for me.
Update #2
The problem now is that you are attempting to link the 64-bit curl-7.34.0-win64\lib\libcurl.lib with the 32-bit object code generated by your 32-bit toolchain, mingw32. You can't do that.
Replace your install of curl-7.34.0-win64 with curl-7.34.0-win32 from the same site. In your project, replace your\path\to\curl-7.34.0-win64\lib\libcurl.lib with your\path\to\curl-7.34.0-win32\lib\libcurl.lib and try again. The example will compile and link.
It will also run correctly, provided that it finds 32-bit libcurl.dll at runtime, and likewise the 32-bit DLLs that are dynamically loaded by libcurl.dll in turn. For the purpose of the example just copy all the DLLs from your\path\to\curl-7.34.0-win32\dlls into the same directory as the .exe. For regular development of cURL apps you would want the cURL libraries installed on the the system.
Since you chose to download 64-bit cURL in the first place, you may wish to build 64-bit
executables (although 32-bit executables will run on 64-bit hosts). You can't do that that
with your 32-bit toolchain, mingw32. You can install a 64-bit toolchain, e.g. TDM-GCC MinGW Compiler,
and configure it as an additional toolchain in C::B. Alternatively you could replace your
C::B installation with a C::B 13.12 one that has TDM-GCC pre-configured, from Sourceforge
Edit: I have in the meantime figured this out and written a detailed answer below.
I just tried switching from the Express version of MSVC 10 to Eclipse CDT on Win7, and while configuring I encountered a problem with the following simple OpenGL code (which works fine in Visual Studio):
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
int main()
{
GLFWwindow* w;
if (!glfwInit())
return -1;
w = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
if (!w)
{
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(w);
glewExperimental = true;
if (glewInit() != GLEW_OK)
{
return -1;
}
while (!glfwWindowShouldClose(w))
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glfwSwapBuffers(w);
glfwPollEvents();
}
glfwTerminate();
return 0;
}
In Visual Studio, I include the library paths for GLFW and GLEW, and link (in addition to the stuff that VS does built-in) opengl32.lib, glew32s.lib, glfw3.lib, in that order.
Now if I do the same in Eclipse CDT, I can't get it to work. The following errors occur:
Info: Internal Builder is used for build
g++ "-LD:\\lib\\cpp\\glfw-3.0.1.bin.WIN32\\lib-mingw" "-LD:\\lib\\cpp\\glew-1.10.0binaries\\lib\\Release\\Win32" -o glfwcheck.exe main.o -lopengl32 -lglew32s -lglfw3
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
D:\lib\cpp\glew-1.10.0binaries\lib\Release\Win32/glew32s.lib(tmp/glew_static/Release/Win32/glew.obj):(.text[__glewInit_GL_VERSION_1_2]+0x4): undefined reference to `_imp__wglGetProcAddress#4'
D:\lib\cpp\glew-1.10.0binaries\lib\Release\Win32/glew32s.lib(tmp/glew_static/Release/Win32/glew.obj):(.text[__glewInit_GL_VERSION_1_3]+0x4): undefined reference to `_imp__wglGetProcAddress#4'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: D:\lib\cpp\glew-1.10.0binaries\lib\Release\Win32/glew32s.lib(tmp/glew_static/Release/Win32/glew.obj): bad reloc address 0x4 in section `.text[__glewInit_GL_VERSION_1_3]'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Of course I tried changing the order of the three libraries, but that only mad it worse. (By the way: I think it's strange that I can't reproduce these errors above such that they're the only ones when I re-arrange the libs to the initial order. I stay at 20+ errors until I delete ALL the libs, build, and add them again.)
After fumbling around and looking through forum posts, I figured that maybe it's a problem with the GLEW binaries, and compiled them on my own with MinGW. Only this time, I get all the 'not found' errors. I don't know how I can link statically with my self-compiled GLEW, since there's now no glew32s.lib any longer, but only libglew32.a and libglew32mx.a. Linking dynamically with glew32 and putting the dll into my project folder didn't work either.
I feel like I'm doing something very wrong here in Eclipse, or just forget some additional libraries (although I once tried putting all the ones VS uses in there as well and it still did the exact same thing).
Can you help me out? :) Otherwise I think I'd have to stay with VS, or switch to Linux + make.
I figured it out, and for anyone ever encountering the issue I will try and make clear what exactly I did to finally be able to create OpenGL projects with the setup MinGW + GLEW + GLFW. In my case, I used Eclipse CDT as IDE, but I'll write down the resulting g++ command line so it should be easy to adapt to other IDE's.
I'll suppose MinGW and MSYS (can be chosen to be installed from within the MinGW GUI; thus no need to download separately) are installed.
Download GLFW and unzip it in your external libraries folder of choice (in my case, this is D:\external\cpp, so it would be something along the lines of D:\external\cpp\glfw, where I renamed the glfw-3.0.3.bin.WIN32 folder to simply glfw).
Download the GLEW source as a zip folder an unzip it, in my case it's in D:\external\cpp\glew. Now start MSYS, cd to the glew folder and invoke make all.
Step 3 should have created (among others) the files libglew32.a and glew32.dll inside the folder glew\lib. Now right click your Eclipse CDT C++ project, go to Properties - C/C++ General - Paths and Symbols. In the Includes tab, add the paths to the include folders of GLFW and GLEW. Again, for me this is D:\external\cpp\glew\include and analogous for GLFW. In Library Paths, do the same for the folders lib (GLEW) and lib-mingw (GLFW).
Now we have to add the libraries we want our project to be linked with. If you wish to link with GLEW dynamically, make sure to include the glew32.dll in the folder where your executable will be. In Eclipse CDT, that's usually the Debug (or Release) folder in your project structure. In the Libraries tab in the options window we opened before, add (the order is important!) glfw3, glew32, opengl32, glu32, gdi32. Now building the project should work hopefully. In case you want to link statically with GLEW, add the same libraries with the exception of glew32. Instead, in the project properties go to C/C++ Build - Settings and in the Tool Settings - MinGW C++ Linker - Miscellaneous tab add the path to libglew32.a to the Other objects field. In my case, this is D:\external\cpp\glew\lib\libglew32.a. Now in order for the static linking to work, you have to either add #define GLEW_STATIC above #include <GL/glew.h> or use the preprocessor command -DGLEW_STATIC. The GLEW homepage says that it's also possible to include the glew.c and glew.h files into your project in order to link statically, but somehow this didn't really work out for me.
These steps worked for me, and they produced command lines similar to the following (I have only one file named main.cpp and used static linking with GLEW), which could be useful if you're trying to figure this matter out without Eclipse CDT.
g++ -ID:\external\cpp\glew\include -ID:\external\cpp\glfw\include -c -o main.o main.cpp
g++ -LD:\external\cpp\glew\lib -LD:\external\cpp\glfw\lib-mingw -o minimalexample.exe main.o D:\external\cpp\glew\lib\libglew32.a -lglfw3 -lopengl32 -lglu32 -lgdi32
In the dynamic linking case, simply remove the part containing libglew32.a in the second line, and add -lglew32 between -lglfw3 and -lopengl32. As a little example source file, you could just use the code in my above question.
I hope I can help anyone with this, as I sure saw me having a lot of trouble figuring this out between tens of error messages of unresolved symbols and various other problems :-)
Update: I tried to go over this again some days ago and ran into problems with the pre-compiled GLFW binaries for Windows (I'm now using Win8.1). But you can just use CMake in combination with mingw32-make to compile it on your own. Also, GLEW seems to not be getting updates anymore, so I switched to glad instead. It's also possible to use MinGW-w64 to compile the libraries and your final project as 64-bit application.
I have installed Win64 OpenSSL v1.0.1b and Visual C++ 2008 Redistributables from this page http://slproweb.com/products/Win32OpenSSL.html and added compiler (C:\OpenSSL-Win64\include) and linker paths (C:\OpenSSL-Win64\bin, C:\OpenSSL-Win64\lib, C:\OpenSSL-Win64) to Code::Blocks, but I still cannot compile my program.
Source code:
#include <cstring>
#include <openssl/blowfish.h>
int main() {
const char * key = "aaabbbcccdddeeefffggghh";
BF_KEY bfKey;
BF_set_key(&bfKey, strlen(key), (const unsigned char *) key);
return 0;
}
Error:
obj\Release\main.o:main.cpp|| undefined reference to `BF_set_key'|
I tried to add -lssl, -lopenssl, -llibssl, -lcrypto, but it doesn't work. Then I can see another error:
ld.exe||cannot find -lssl|
I have no idea (and Google also) what to do. Any ideas what I do wrong?
I'm not sure if you configured it properly. It seems like you also have to add the libraries your project is using somewhere in Build Options, on top of setting the library directories. Does this help? http://www.learncpp.com/cpp-tutorial/a3-using-libraries-with-codeblocks/
Because you are using the GCC compiler (MinGW) with Code::Blocks you have to change the library sear directory (C:\OpenSSL-Win64\lib) to C:\OpenSSL-Win64\lib\MinGW and to link the library that have the Blowfish function you must use -leay32 (in your case probably is -leay64).
Inside the directory C:\OpenSSL-Win64\lib\MinGW there are 2 files with the .def extensin that have the list of functions exported by each library (libeay32.a/libeay64.a and ssleay32.a/ssleay64.a), by the way if you use the -l option the file must be called lib.a; the if you want to use any of the functions on the library ssleay32.a/ssleay64.a you must link the file directly (for example C:\OpenSSL-Win64\lib\MinGW\ssleay32.a) or append lib to the name of the file.