Programming :: Setting For Header File And Library?

May 8, 2010

I have 3 files: main.c, mylib.h, mylib.c Now I want to put mylib.h into : /usr/include/mydir/mylib.h And I create a static library: libmylib.a, and put into the folder: /usr/lib/mydir/libmylib.a Then I compile: $ gcc -o main main.c Then I got linking error

Code:
main.c:(.text+0x3e): undefined reference to `extract_v1'
main.c:(.text+0x7b): undefined reference to `modify_v1'
collect2: ld returned 1 exit status

So I try with -l options: $ gcc -o main main.c -lmylib I still got error

Code:
/usr/bin/ld: cannot find -lmylib
collect2: ld returned 1 exit status
Any idea about this?

Also, I want to ask about: how to create my own header and library to put into /usr/include/mylib/ and /usr/lib/mylib/, so when I use function in my program, the compiler will automatically link to library. It's like when you #include <stdio.h>, and you compile: $ gcc -o program program.c, you don't need to specify any linking folder or library.

View 4 Replies


ADVERTISEMENT

Programming :: Put Header Files For A Shared Library?

Feb 26, 2010

I have written a simple library and ended up with a .so file. I have a header file from writing the code that describes how to use the functions in the source code I have written. I think this .h files needs to be available to other programs that access this code.

I have seen lots of tutorials on how to copy the .so file to the relevant directories and make links with the version number. What I can't find is where to put the header file so that any programs I write to use my new library can access the header.

Hope this makes sense. For example, I might use <stdio.h> normally, I will need to access <mylibrary.h> once mylibrary.so is loaded (as far as I understand!)

It's weird, I've been using C compilers for embedded processors over ten years now and never given a second thought to how libraries and headers work behind the scenes!

View 6 Replies View Related

General :: Get Socket.h Header File / Copy Pasting This Header File In 'incl' Directory Allow To Use It In The Program?

Apr 22, 2011

where can i get socket.h header file? will copy pasting this header file in 'incl' directory allow me to use it in the my program?

View 1 Replies View Related

Programming :: Can't Write Header To Excel File?

Jan 15, 2010

I am having trouble getting some code to work. It takes an input file (csv) and converts it to an XLS. The problem is that I can't seem to get a header to be printed first...

Code:
use Spreadsheet::WriteExcel;
my $input = $ARGV[0];

[code]...

View 5 Replies View Related

Programming :: Get Jpeg File Header Using C Language?

Oct 10, 2009

I want to get files header as much as possible which are mostly used so how can i get jpeg file header using C ?

If any other headers of MS Office is possible for U.

View 7 Replies View Related

General :: Programming In C++ Under Windows Using Graphics.h Header File

Aug 19, 2010

I am new to ubuntu.I have done some programming in c++ under windows using graphics.h header file.I want to implement my programs in ubuntu.How can i do this?I am writing a program.

View 4 Replies View Related

Programming :: Including User Defined Header File?

Apr 29, 2011

i got a sample.c which generate a linked list for sorting according to the number generated. then i want to split the sorting function into a header file. and it looks like the sort function in the header file could not access the linked list in the main. the error is dereferencing pointer to incomplete type

sample.c

Code:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

[code]...

View 2 Replies View Related

Programming :: Header File Which Support OpenOffice Writer At RedHat4

Jun 9, 2010

I need to know the header file used at 'c' to support openoffice writter at REDHAT4. I plan to write a c++ program for something like spellbee game. so instead of giving a txtfile which has a list of words as a source for the game I decided to use some header file. My assumptions are: Since the redhat4 is written through the "C" language and as well as the openoffice writter which is a supporting package at this os too might have the linker right. At openoffice writter we have the spellcheck feature which might had a source from where it checks the words whenever we type something at openoffice writer. So is it possible to use those header file or linkage source at my c++ spellbee game program instead off creating the list about few bunch of words.

View 1 Replies View Related

Programming :: (.text+0x7): Undefined Reference - Compiling Program Include One Header File And 2 C

May 21, 2011

i am a new programer in c i have write a simple app and i have a problem with combiling my program include one header file and 2 c

fun.h
#include<stdio.h>
void f();
/******EOF*******/
fun.c
#include"fun.h"
void f(){
[Code].....

View 6 Replies View Related

Programming :: Library Linking - ELF File OS ABI Invalid Error

May 6, 2010

[root@shankar-lx src1]# make
gcc -c main.c
gcc -c database.c
gcc -c e_sqlite.c
gcc -o TEST main.o database.o e_sqlite.o /usr/local/lib/libsqlite3.so.0.8.6 -w -lpthread
[root@shankar-lx src1]# ./TEST
./TEST: error while loading shared libraries: /usr/lib/libsqlite3.so.0: ELF file OS ABI invalid

My application compiled well but when try to run, it is giving ELF file OS ABI invalid ERROR. What is this error.
Kernel version is 2.4-18

View 1 Replies View Related

Programming :: Find Sys/types.h File / Library Files?

Mar 24, 2009

can anyone provide me with the path where i can find the library files. stdio.h, sys/types.h.......

View 4 Replies View Related

Programming :: SDL Static Library - Shared Library ?

Apr 7, 2009

I'm reading about shared, static, and dynamic libraries. What is SDL? Is it static, shared, or dynamic?

I always thought a library would be a lot of .h and .cpp files compiled separately into .o files and then if you compiled your own program you could use the -l parameter to link the library and it was all compiled together. Now I'm not so sure.

I don't even see any SDL .cpp files in my system anywhere. All I have are lots of SDL .h files in /usr/include/SDL and I don't really understand the code in them.

I'm making a wild guess here: SDL is a shared library. SDL itself is NOT compiled into my program, therefore SDL must be on any system my program tries to run on. When I compile and link SDL all it needs is the header files to know what SDL function and objects it can use. And then on every system it uses an already compiled SDL shared library thingy somewhere.

So... where is that part of SDL? All I can find are header files.

I'm thinking the advantage of shared libraries is that someone could say update SDL on their own system and take advantage of the new features without having to download new executables with the new version of SDL compiled into them for every program that uses SDL.

So if I'm making an editor and a game engine and they both use a lot of the same .cpp and .h files that I wrote and I'm tired of updating one and then the other and I need to turn them into a library, then a shared library might be kind of a silly solution. I could just make a static library. Right? Because it's not SDL. Nobody else is ever going to use this library.

View 6 Replies View Related

Programming :: JFileChooser : Setting The Default 'file Filter'

Sep 28, 2010

Code:

// create a filechooser;
JFileChooser chooser = new JFileChooser(cwd);
FileNameExtensionFilter filter = new FileNameExtensionFilter(
"sdf files (*.sdf)", "sdf");

[code]....

This will give 3 filefilters ('all files', 'sdf files' and 'xml files') for a fileopen dialog. Exactly as I want (in alphanumerical order), but XML is the default extension and I like SDF to be the default extension. Research has not revealed solutions; the setFileFilter method sets the primary filter. If I swap the sequence in the code, SDF becomes the default (as I want) but the sequence is wrong (All, XML, SDF).

View 3 Replies View Related

Programming :: Convert A Dynamic Library (filename.so) To A Static Library (filename.a)?

Nov 18, 2009

How can we convert a dynamic library (filename.so) to a static library (filename.a) using gnu gcc . Can we get a static library form a dynamic library . I saw a few post in which the conversion form a static library to a dynamic library is mentioned but, unfortunately, not the other way.

View 4 Replies View Related

General :: Overwrite The Header Of A File Without Copying The Whole File?

Mar 1, 2011

Asuming I have two files, one large file and one small file, I want to write the smaller file to the large file without overwriting the remaining part of the larger file.

Both are binary files, and the large file can become very large, so I want to avoid copying the whole file, as that will take some time. Is there any standard Linux console utility to do this, or do I need to write it myself?

View 2 Replies View Related

Programming :: C Tcp Header Change?

Jul 25, 2011

I am trying to write a program that will send a packet to a server as a different IP address so I can test my firewall rules as I only have access to a couple of machines:

Code:
int my_socket;
struct sockaddr_in sin;

[code]....

View 2 Replies View Related

Programming :: Cannot Find Header Files To Use Kmalloc()

Jun 16, 2010

I want to use kmalloc() to allocate contiguous memory on ram. But I can not seem to find the required header file(s) like linux/slab.h. I suppose I do not have the required library and I certainly do not know what and where to look.

View 14 Replies View Related

Programming :: How To Attach New C Header Files And Libraries

Mar 10, 2010

I have been a predominant Windows user for a long time but shifted to Ubuntu recently. I was just trying out a few basic C functions when i realized that the "conio.h" header file isn't included in the libraries and therefore i was unable to use the "clrscr()" function.

I downloaded a tarball which contained the necessary library and header files including conio.h. Once extracted, i specified the location and included in the program as " #include "path to the header file" ".

I still didn't call the "clrscr()" function, and it compiled successfully. Next i edited the program to call that function and it gave the following error...

How i can add new libraries in the future?

View 14 Replies View Related

Programming :: Simple Header For Perl Programs?

Nov 5, 2010

i am trying to do something very simple like a header and a footer for my first perl programs, what iam trying to do is that when i create a file in vim: lets say hello.pl , i would like that file to have already this in its header:

#!/usr/bin/perl
and this on the footer:
print "
";

so that i dont have to type everytime #!/usr etc i tried to do it this way but i get weird vim errors: header is a file that contains the header and footer $ vim hello.pl;header > is there another way to do it as a function in bash or some other one liner command?

View 1 Replies View Related

Programming :: Using Header Files - Reference And Put Formulas?

Feb 14, 2011

New to programming having issues reference header files.

Not sure how to put the fomula in headers below:

Program

using namespace std;

View 7 Replies View Related

Programming :: Cmake - Using Header Files In Higher Directories ?

Nov 1, 2010

Say I have a directory structure:

And other.c has:

How do I setup the CMakeFiles.txt files in each directory, so the executable "program" (from program.c) is created.

Currently I get the error:

View 1 Replies View Related

Programming :: Codeblocks Plugins And Header Files Location?

Jan 29, 2010

I installed Codeblocks and build some programs, but I have two questions:1. Where are my header files placed, since I don't know where codeblocks is installed. Soemetimes I have to remove header file extension (.h) to be able to compile some source. I use gcc as setting for codeblocks to compile and build programs.2. Plugins for Codeblocks can be installed, but when browse codeblocks's wiki I can't find download links neither developer pages

View 3 Replies View Related

Programming :: SFTP Connection With User And Password On The Header?

Mar 25, 2011

how I can do a ftp connection putting the user and passwd as default?

View 6 Replies View Related

Networking :: No /usr/include/usb.h Header File?

Dec 16, 2010

I was trying to install usb-modeswitch edora-14 (64 bitt saidCode:usb_modeswitch.c:56:17: fatal errr: usb.h: No such file or directoryWhen I tried to install libusb, it said that it is already installed and is the latest version. But, it still doesn't show usb.h in /usr/include directory.What shall I do to make usb-modeswitch?

View 4 Replies View Related

Programming :: Writting A C++ Program Using Netbeans And Keep Getting Error About Finding My Header

Feb 14, 2011

Below are the header files and the program:

using namespace std:

View 2 Replies View Related

General :: Extract 5th Column From A File Without The Header?

Oct 15, 2010

How can I extract 5th column from a file without the header.

View 5 Replies View Related

Programming :: Interface The Output Pins On The Header Of The GESBC-9260 To The Distribution?

Jan 13, 2010

I'm a complete linux beginner and currently have the following board that I am playing around with.the main chip onboard is an atmel arm9 core with a debian style distribution pre-installed. I have just updated the factory kernel to 2.6.30 as I was told this had an inbuilt GPIO driver? I am trying to interface the output pins on the header of the GESBC-9260 to the linux distribution. i.e. I would initially like to write a c file that did something like toggle an output pin, which I can then connect upto an led and see this flash. However I don't really have a clue where to start. Hopefully someone could point me in the right direction?

View 1 Replies View Related

OpenSUSE :: Compiling - Can't Find A Header File In /usr/include/gtk-2.0/?

Mar 11, 2011

Compiling Amarok from git gives error "gdk-pixbuf/gdk-pixbuf.h: No such file or directory" it is installed in /usr/include/gtk-2.0/gdk.I just up'ed to openSuse 11.4 and KDE 4.6.1 - compiled fine last time I tried which was probably last weekend or so (March 2nd or third)Wondering if /usr/include/gtk-2.0/ is new in 11.4 because of the upcoming gtk3.0 and the problem is it's not some path and not being compiling proficient I'm a bit lost.full error

Code:
/home/smiley/MyTemp/amarok/src/core-impl/collections/ipodcollection/handler/IpodHandler.cpp:35:35: fatal error: gdk-pixbuf/gdk-pixbuf.h: No such file or directory

[code]....

View 1 Replies View Related

Programming :: Compile C++ Program Without Changing #include Line & Header Files Not System?

Apr 3, 2011

I have C++ source code(*.cpp) files that expects it's header files in System's include folder which is/usr/include.The cpp files has include lines like this:

Code:
#include <some.h>
#include <another.h>

[code]...

View 3 Replies View Related

Ubuntu :: Choose Nautilus File Manager Header Format?

Oct 31, 2010

Last night I had to re-install Ubuntu. Previously, the header of the file manager had been configured up with the three buttons on the right for icon/list/compact view (see 1st image below), whilst since re-installing, they appear with the drop-down menu instead (as per the 2nd image). How do you change between these two formats? My preference is for the first of these.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved