Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-19-2012, 04:56 AM   #1
LQ Newbie
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
how to link all and make execute

I am having an openssl dh_gen.c file which is having cryptlib.h as shared library. I am having cryptlib.h file also, in that cryptlib.h again its having another two shared libraries e_os.h and ms/uplink.h i am also having e_os.h and uplink.h files also and also having one uplink.c file also. now i want to make dh_gen.c to be execute suggest how to link all and make it execute. plz help me

In brief

#include "cryplib.h"
#include "e_os.h"
#include "ms/upload.h"
one more uplink.c file also there now i want to link all these at last i should run dh_gen.c plz help me
Old 10-20-2012, 01:48 AM   #2
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Do you want to execute all header files i.e. library files within a single c executable file? Does your dh_gen.c file has execute permissions?
An executable can simple run by ./<executable-filename> command from a Unix terminal.
So please specify the error message or problem you're facing while running it.
Old 10-20-2012, 02:27 PM   #3
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
To rephrase your question, you want to build C source files (xxxx.c & yyyy.h) into executable binaries. It is possible that in this case, it is as simple as typing
make dh_gen
This will compile and link dh_gen.c into the executable binary dh_gen. Assuming that the code is syntactically correct, the make command has enough built-in knowledge of building C source code into runtime binaries, that it will usually succeed. It may be that you need to link the dh_gen.o (created by compiling dh_gen.c) with one or more libraries. If that is the case, you will need to identify what libraries, and then either:
  1. run the linker, ld, independently, giving appropriate linker commands to specify which libraries and where they are stored
  2. add some commandline options to the LDFLAGS macro when invoking make
  3. craft a Makefile with the accordant rules and macros.
If the need for a Makefile or more commandline arguments is necessary, post the complete and exact results from the make command here, and someone will be able to advise you.
One last point of clarification; C header files (blahblah.h) are not libraries. They often accompany libraries (, so that the code that uses the library knows how to access the content of the library.

--- rod.

Last edited by theNbomr; 10-20-2012 at 02:29 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can I make a symbolic link that is dynamic link->$HOME/file? croog Linux - General 4 10-14-2012 08:55 PM
How can i execute a command in a link ? Tiberio Linux - Newbie 2 06-30-2011 11:53 PM
Link and execute a script teresevo1 Linux - Newbie 2 06-18-2010 08:20 PM
Cannot execute symbolic link on Debian cold Linux - Newbie 4 06-26-2008 06:12 AM
Need to execute shell script from link. chackercon Linux - Software 8 06-25-2008 04:16 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration