I have made makefile which is creating shared library of two C code files (I used gcc). Makefile is also creating runnable main C file. Now I need to know how to tell main C file to use my shared library - because I need to use functions which are already contained in code files in shared library. Thanks for the help.
2
There are 2 best solutions below
Related Questions in C
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in GCC
- gcc static library compilation
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
- How to add directories to Cygwin gcc default search path
- Usage of #ifndef directive
- Failure to link a program with gcc -static
- Text as parameter in inline assembly (ARM)?
- Alternatives for strrspn and strfind functions(libgen functions in Solaris) in AIX?
- Incorrect format specifier with gcc compiler
- Why should I use a closing bracket in this?
- How can I compile *without* various instruction sets enabled?
- Automatically wrap C/C++ function at compile-time with annotation
- gcc compiled library: can successfully link with, how come it's "undefined symbol" when run the program?
- compiling caffe on Yosemite
- error - /usr/bin/ld: cannot find -lavutil in ubuntu 15.04
- Compatibility of libstdc++.so libgcc_s.so when upgrading GCC 4.1 to GCC 4.8.2
Related Questions in MAKEFILE
- Error trying to generate Makefile for glBinding
- Eclipse Makefile: Make Variables are skipped
- Errors in makefile for qemu 0.14.1 in ubuntu 15.04 64 bit
- C++ Struct prototyping in separate header file
- Reuse jquery plugin without conflict
- How do I a conditional build through a make file?
- basic makefile ifeq how to
- (automake, libtool) build fails in automake when using same source file name in different directory
- Makefile pattern rules differences
- Errors while trying to run make on source code
- Git tag name as version in Go via Travis-CI
- gcc make -properly sort out the sequence of making object files
- AOSP ROM for Samsung Grand duos GT-i9082 Error loading kernel
- How to address multiple definition compiler error
- How does MAKE remember the file timestamps
Related Questions in SHARED
- Alternative to the mod_qos module for Apache 2.4
- Wrong Charset in Shared Preferences
- Shared folder access with login & password impersonation - W2K8 IIS7
- Shared Pointers declaration
- Access a shared calendar (such as a meeting room via Office 365 REST API)
- cpanel full account restoration without whm access
- C++ differ between Linking with .o and with .a file: different behavior, why?
- Threads with multi shared resources
- C++ using typedef shared_ptr<Class> Shared as a type of field - member of another class
- Saving items in List Component using Shared Objects (flash AS3)
- Crystal Reports - Standard Deviation of data from 2 sources
- delphi XE7 firemonkey android shared object / library to be dynamically loaded - template
- Multiple instances of Singleton in a c++ shared library on Windows
- C - Using shared library
- SharedPreference Change Listener and custom preference
Related Questions in LIBS
- Android - Handling android libraries (jars) in project
- How to add 'libs' folder in Android Studio?
- C - Using shared library
- can a directx executable be statically linked such that the redistributable dll's are not needed on the system?
- Can robovm convert every and all compiled jar file there is?
- Path to store libraries. Best practice needed
- Create android project using command line with jars in Libs folder
- Generic Play json Formatter
- Compiler definitions of source code linked to lib change lib?
- Does Boost BCP also copy the required LIB files?
- Android Studio: "could not find method compile<> for arguments [file collection]"
- Android Studio 1.0.1 add external libraries
- Install ZXing into Android Studio
- Android | Allow different libs version in the same project
- Android Repository not working in library module
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
#includethe header file containing the declaration of the function(s) you want to use in your main file.link with your shared library using
-L/path/to/libraries abc.c -l<yourLIb>. [Assuming your libary name islib<yourLIb>.so]Note: You can find some good reads here.