I am compiling openssl-1.1.0h version on Window 7 64 bit machine.
I have followed below steps:
Downloaded the source code from open ssl website
https://www.openssl.org/source/
Installed Visual Studio 2015 and required Perl environment.
perl Configure VC-WIN64A --prefix=custom-dir --openssldir=custom-dir no-asm shared
nmake
namke test
nmake install
I am able to successfully compile the source code, but it has created libcrypto.lib and libssl.lib files under lib folder. How can I create dll instead of libs?
Related
in the new version of putty there is no Makefile.vc or project file for visual studio. How can I compile putty under visual studio 2019? can someone help me?
link to zipped source
I tried to open the windows folder in visual studio with the following error:
Severity Code Description Project File Line Suppression State
Error CMake Error at C:\Usersuser\Downloads\Compressed\putty-src\windows\CMakeLists.txt:3 (add_sources_from_current_dir):
Unknown CMake command "add_sources_from_current_dir". C:\Users\user\Downloads\Compressed\putty-src\windows\CMakeLists.txt 3
You don't need to open Visual Studio or any IDE to compile the executables.
Download cmake and make sure Visual C compiler is installed.
Unzip the .zip file, open a command prompt where the readme and CMakeLists.txt reside
Then, as the readme states:
run these commands in the source directory:
cmake .
cmake --build .
In the Debug directory, you'll find a lot of .exe files.
Then, to install in the simplest way on Linux or Mac:
cmake --build . --target install
I didn't need that part. I suppose that it copies the executables & other files somewhere in the path.
Problem with creating a distro using Microsoft compiler is that the executables then require a lot of Microsoft runtime DLLs. For instance if you deploy the executables on other machines it may not work.
An alternative is to use gcc and make to build the executables.
First:
install a recent gcc for windows
install make
Installing a recent MinGW distribution should do it. Personally I used another gcc distribution so I had to grab make too.
Now, I followed Setting default compiler in CMake, the key part being to enable mingw makefiles: -G "MinGW Makefiles", else cmake ignores your compiler requirements and keeps on using Microsoft compiler.
cmake -DCMAKE_MAKE_PROGRAM=/path/to/make/make.exe -DCMAKE_C_COMPILER=/path/to/gcc/gcc.exe -G "MinGW Makefiles" .
Note that specifying full paths require that / are used. Backslashes conflict with escaping in cmake/make files.
Then
cmake --build .
i want to use this library https://github.com/json-c/json-c with my C program in codeblocks(windows) but i dont know how to make makefile/cmake on windows.
I dont know how to do it in this particular example. There is only something like "Config.cmake.in".
Any ideas?
You didn't state what kind of build environment you are using on Windows.
So find below a short description how i built the 32-bit version of json library on Windows 10 using cmake 3.14.3 and Visual Studio 2015. CMake supports several generators for Visual Studio as well as MinGW (see CMake documentation).
Open command window (cmd.exe) change to root directory of json-c library source.
Setup build configuration for 32 bit target in directory "build" using command line "cmake -G "Visual Studio 14 2015" -A Win32 -B build"
Open command window for Visual Studio 2015 x86 environment (link at start menu) and change to build directory created during previous step.
Run "msbuild json-c.sln" to build Debug version of json-c dynamic library
Run "msbuild json-c.sln /p:Configuration=Release" to build Release version of json-c dynamic library
After that you should be able to add the built library to your project.
I am moving from intellij to NetBeans and am hitting an issue with code assist for remote C projects.
I have the set up as below, with the correct directories added under code assist. However NetBeans reports two types of problem with the red underline and light-bulb
cannot find include file #Include <gst/gst.h.> + many others.
Unable to resolve identifier ..... from include file gst.h.
When running build from NetBeans , it uploads and comiles the code on the remote machine with no errors reported and compile happens as expected.
What am I doing wrong in my set up?
Local NetBeans Machine
Windows 10
Product Version: NetBeans IDE 8.2 (Build 201609300101)
Java: 1.8.0_91; Java HotSpot(TM) 64-Bit Server VM 25.91-b15
Remote Build Host
SSH with PPK (password protected)
centos 7
Build Tools: GNU GCC 5.4.0
Options -> code Assist -> C compiler -> included Directories
[with key symbol] /home/ec2-user/gst/master/gstreamer
The password for the PPK is not saved in NetBeans.
myScript.c
#include <gst/gst.h>
On remote host host I have the file
/home/ec2-user/gst/master/gstreamer/gst/gst.c
/home/ec2-user/gst/master/gstreamer/gst/gst.h
Thanks
Art
I want to create a standalone executable from a C file so that the libraries that I'm using don't have to be installed on the computer that I'm running the executable on.
I'm using the libssh and libconfig libraries, both of which may need to be installed on the machine I'm running the executable on.
When I run my binary on a machine that doesn't have these libraries installed, I get:
error while loading shared libraries: libssh.so.4: cannot open shared object file: No such file or directory
Is there a way I can compile my program.c file so that it has the libssh binaries included within it?
See this Link http://api.libssh.org/master/libssh_linking.html about how to link the static version of the libssh. There must be similar instructions for libconfig.
I downloaded the X264 source and installed mingw.
Step 1:
Executed this in the MINGW bash:
./configure --disable-cli --enable-shared --enable-win32thread -
-extra-ldflags=-Wl,--output-def=libx264.def
and then 'make'
Step 2:
Renamed the libx264-142.dll to libx264.dll and Opened up VS2012 Command Prompt and executed this:
LIB /DEF:libx264.def
which gave me libx264.lib and object libx264.exp
Step 3:
Included the lib file in a VS2012 project which uses the X264 API.
Problem:
When I start the project I get the following error message:
"The program can't start because libx264.dll is missing from your computer"
Question:
Why is it looking for the dll when I'm linking the static library in?
How do I resolve this? I would like to build a static X264 library which I can link in with my project.
EDIT:
I just had to put the dll in the same directory as the project executable.
However - My question still stands: How do I build a static x264 library? So I don't need the dll?
After the latest update of x264 you can build static library usable by MSVS project. For such library compilation you will need:
MSYS and MSVS 2013 Update 2 (express version [for Windows Desktop] would also work if you install Update 2)
run "VS2013 x86 Native Tools Command Prompt" or "VS2013 x64 Native Tools Command Prompt" depending what version (32 or 64-bit) you want to build
change dir to x264 path and run MSYS shell (sh)
from shell run "CC=cl ./configure --disable-cli --enable-static" for x264 configuring
run "make" which should build libx264.lib usable from MSVS
P.S. MSVS builds would be a little bit slower than one build by MinGW
Matthew Oliver has a GIT repository of a patched x264 source tree (https://github.com/ShiftMediaProject/x264) that compiles natively in VS2013 update 2 and later. It requires installing a YASM version for VS.
It worked pretty much straight out of the box for me, though I did have to change the VSYASM parameter "-f Win32" to "-f win32" for a 32bit build
Take a look here: http://siliconandlithium.blogspot.no/2014/03/building-x264-on-windows-with-visual.html
Static lib is not possible in windows as per my knowledge.