Programming :: Using Binary C++ Libraries?

Feb 21, 2011

I am learning C++ and wish to include some Boost functions in my code. My machine is running Debian Linux with the pre-installed boost binarys.I have a couple of questions:How do I include the library in my C++ code as there are no cpp or h files only binary files (eg /usr/lib/libboost_regex-d.so and /usr/lib/libboost_regex-d.a)How do I comile the code. I am using DialogBlocks for creating forms using wxwidgets. The editor also compiles the code using the gcc compiler. Do I have to give an instruction to the compiler saying which file is requried and where to find it? If so, any ideas how this is done?

View 4 Replies


ADVERTISEMENT

General :: Specify The Location Of Libraries To A Binary?

Sep 25, 2010

I'll be using a specific example, but really this generalizes to pretty much any binary on linux that can't seem to find its' dependent libraries. So, I have a program that won't run because of missing libraries:

./cart5: error while loading shared libraries: libcorona-1.0.2.so: cannot open shared object file: No such file or directory

ldd sheds some light on the issue:
linux-vdso.so.1 => (0x00007fff18b01000)
libcorona-1.0.2.so => not found
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/libstdc++.so.6

[Code]....

View 2 Replies View Related

General :: Libraries - Binary Executable Properties : Ldd Alternative?

Mar 23, 2011

The Linux ldd command can show the dynamic libraries used by an executable. It's a bash script.But it seems to be fragile, and does not work on some binaries. Is there an alternative tool? In my specific example, I can use:

% file datab2txt

datab2txt: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.4.0, not stripped

but ldd fails with:

% ldd -v datab2txt

not a dynamic executable

View 2 Replies View Related

Programming :: Finding A Utility To Combine Two Or More Binary Files Into A Single Binary File?

May 5, 2011

Is there any Linux utility to combine two or more binary files into a single binary file ?

View 7 Replies View Related

Programming :: Version Info Coded Into ELF Binary / Author And Company Name Into ELF Binary?

Nov 30, 2010

How to coded version info and other information likes author and company name into the ELF binary?

I prefer the put the version info during build step.

View 5 Replies View Related

Programming :: Binary Not Running From Php?

May 4, 2011

I have written a c program. And compiled it to make a binary. Now when i try to call this binary from php page, it is not being executed.

View 14 Replies View Related

Programming :: See The Contain Of Binary Files?

Aug 4, 2010

i have some files name libbeet.so.3.02 , libpos.so.3.04.I think all is binary files , but i am not able to see the contain of file.is there any script to read the file contain.

View 5 Replies View Related

Programming :: TCL AND Operator (&) On A Binary Value?

May 1, 2010

I have a binary value which I receive from a controller. Say this binary value is 42. Just plain hex 42. If you would look at that byte in a debugger you would see 42.Now this value hold 8 bits each indicating a high or a low output. So 0x42 = 01000010b. Which means bits 1 and 6 are '1'.When I would want to find out which bits are set and which are not in a language like C, I simply do:

Code:

mask = 0x80;
if (binval & mask) {...}
etc..

However I am programming in TCL, and I try to do:

Code:

set mask 0x80
if { [expr ($binval & $mask) > 0] } {...}
etc...

this fails. At the moment the expr is executed, $binval is evaluated and substituted so the expression I am evaluating is

Code:

set mask 0x80
if { [expr ('B' & '0x80') > 0] } {...}
etc...

Eventually I got it working by converting the $binval into a '0x42' string value, like this:

Code:

binary scan $binval c byte
set byte [format "0x%0x" $byte]
set mask 0x80
if { [expr ($byte & $mask) > 0] } {...}
etc...[

Then the expression yields what I want. But this seems so stupid and clumsy. Isn't there a better way where I can compare two binary values without conversions?

View 14 Replies View Related

Programming :: C++ Pdf Libraries

May 24, 2010

Im doing a project,in which i have to add a script in c++ inorder to merge two or pdf files page by page or based on some headindgs.SO anyone can please suggest me any open source pdf libraries in c++ which provide functions for merging and splitting.

View 3 Replies View Related

Programming :: Where To Get A Windows Binary For PAR::Packer?

Nov 4, 2010

I am looking to use PAR:acker to convert perl to some executable in Windows. Just wondering if there is an easy way (say a binary download) is available ?

CPAN has the code but I want to save sometime if possible.

View 6 Replies View Related

Programming :: Binary File Cannot Be Found?

Jan 28, 2010

I get this error when I run the program that i created using eclipse.How to fix this?

View 3 Replies View Related

Programming :: Cannot Execute Binary File

Feb 11, 2011

I'm trying to compile a simple script for a ar71xx (bleeding edge /from snapshots) Openwrt router.I have previously compiled scripts for Kamikaze 8.09. I just copied the gcc file inside the SDK dir and used it without problems.

View 4 Replies View Related

Programming :: 'strings' Binary From Binutils - How To Use It

Jul 14, 2010

it is about 'strings' binary from binutils. I recently wanted to test what it does and how it works. The best I did was this:

Code:

#!/bin/sh
PROGRAM="
int main()
{

[code]....

Ok, from the output I don't get it.Can someone show me in a simple script, what is 'strings' good for ?

View 10 Replies View Related

Programming :: Search And Replace In A Binary File?

Aug 11, 2010

i need to change a binary file, let's say to find and replace username:

find string: "/home/name/bla-bla-bla/ "
new string: "/home/anewname/bla-bla-bla/ "

i can do it, for example, in emacs (hexl-mode), but interesting in writing a script instead. it will be much more better for me if i could do it automatically. is there an analog of: sed 's/string1/string2/g' ? P.S. the best way is to recompile the binary files i have, but there are no sources available.

View 5 Replies View Related

Programming :: Algorithm For Binary Frequency Search?

Jul 16, 2010

I've got a bit of an obscure question for you to test your brains a wee bit. I'm trying to implement a search program to find areas of high density in a binary string.

E.g.

Code:

[0001001010
0001110001
0000001000
1001000010
0101100100]

Where density is the number of 1's / number of digits with a maximum number of digits being the current number in a buffer (in this example 50). So for the example the density for the whole buffer is 15/50. But the density of Buffer[14..20]=[1110001]=4/7. So if looking for areas of density = 1/3 it would find the longest sequences of density over 1/3.So in the example. Buffer[4..9]=[100101]=3/6=1/2 which is above 1/3 but it is within the Buffer[4..48]=[100101000011100010000001000100100001001011001]=15/45=1/3

View 5 Replies View Related

Programming :: Unable To Disassemble A Binary File?

Apr 15, 2011

I want to be able to disassemble a binary file, modify the assembly source, then assemble the modified assembly source back into a modified binary file. Purpose for this is pretty much just to play around with the Crackmes (www.crackmes.de) game.

Now, disassembly is easy, there are several tools that do it, including the standard objdump with the -d argument. However, how would you assemble an assembly source file created with objdump -d? GCC for sure doesn't want to assemble it in that format. What program, script, or arguments to GCC (none that I can think of) can be used to accomplish this? If someone also has some good tips for tools in general for Crackmes beyond what is standard in GNU/Linux I'd love to hear about it.

View 10 Replies View Related

Programming :: Convert Bash Script To Binary?

Apr 28, 2010

compile binary package for bash script?

View 2 Replies View Related

Programming :: Pass Arguments To Binary Cgi Program?

Mar 5, 2010

My hosting server does not allow exec() or system() calls, for security reasons. I can call a cgi process in two ways. From a .shtml page, i can issue a directive like code...

View 11 Replies View Related

Programming :: Patch Binary Files From Different Library?

Jul 2, 2010

I am currently implementing an upgrade system for silent upgrades in my application. I am stuck. I need the code to patch binary files. But I can't find a good third party library. My code is in C# so I would prefer a C# library, but right now I would even go as far as using a library in another language and bind it into my C# code. But I just can't find a good patch/diff library. I must be missing something. Surely there must be some libraries out there that give us the ability to patch binary files?

View 8 Replies View Related

Programming :: Reading A Binary File Which Is In Hexadecimal

Jan 9, 2011

I have a binary file, which I need to process using my C++ application. Only thing I know is first chunk of the file is long, second chunk is int, third chunk is char etc... The binary file actually contains something like below. (which is represented in hex base).

D7 07 00 00 00 00 00 00 37 18 00 00 DE 07 ............ so on.....

I need to procees the file in the following way.

* I know the first data segment in my file is long. So it takes 4 bytes.
* so I need to read the first four bytes. That is D7 07 00 00.
* Then I need to reverse this as 00 00 07 D7.
* Finally I need to get the decimal value of above hexa decimal line. ( 00 00 07 D7)
* i.e. 00 00 07 D7 (in hex) = 7D7 (in hex- after removing leading 0 s) = 2007 (in decimal)

Like wise I need to process the whole file.

View 14 Replies View Related

Programming :: Sending Binary Data Through Sockets In C

Nov 29, 2010

I am coding a http server which has to send the file(s) such as images, .avi files, .mpeg, that the client is going to request. I have been trying of sending files through sockets.

char info [256];
bzero(info, 256);
//memset(&info,0,sizeof(info));
read(socket, info, 255);
write(socket, HTTP, 255);
FILE *fl= fopen(info,"rb");
fseek(fl, 0, SEEK_END);
long len = ftell(fl);
printf("largo: %ld", len);
unsigned char *ret = (char*) malloc(len);
fseek(fl, 0, SEEK_SET);
fread(ret, 1, len, fl);

However, it's supposed to be shown in Mozilla Firefox (as the client). But it is not doing it, so.. It's just not getting the complete file.

View 1 Replies View Related

Programming :: Sort A Binary Min-heap Tree

Mar 23, 2011

I'm searching for an algorithm to sort a binary min heap tree. That's when in root i have the smallest value in the tree. The only restriction it has, is that the parent must be smaller the its two children. i think something like quick-sort, but i don't know how to implement it.

View 8 Replies View Related

Programming :: Convert A String To Its Binary Form?

Jun 9, 2010

Like the binary form of the integer '2' is '10',

How should I find out the binary form of a string say "abcd" ?

View 11 Replies View Related

Programming :: Link Static Libraries With Gcc

Oct 15, 2010

I am stuck with a problem to link static libraries with gcc. There is no problem with source files since I am able to compile in a machine where the static library is installed. I am compiling with the following: Code: :~/Emotion/pjproject-1.0.3/third_party 157% gcc -Wall -I/portaudio/include -o rec patest_record.c -L./lib -lportaudio-x86_64-unknown-linux-gnu

[Code]....

View 5 Replies View Related

Programming :: Adding Gtk Libraries To Eclipse Using C

Jan 30, 2010

So I decided to take my first steps into programming with C + gtk. So far I have doneI loaded eclipse and ensured I had the cdt package Created a new C/C++ project called "play" Added a new source file called "Playfullsrc.c" Added the following to paths and symbols (output of the command: pkg-config --cflags gtk+-2.0)

Code:
/usr/include/gtk-2.0
/usr/lib/gtk-2.0/include
/usr/include/atk-1.0
/usr/include/cairo
/usr/include/pango-1.0
/usr/include/pixman-1
/usr/include/freetype2
[Code]....

added "/usr/lib/libgtk-x11-2.0.so" to GCC C Linker Libaries (I have cheacked and this file exists) When I build the project I get the error message "cannot find -l/usr/lib/libgtk-x11-2.0.soplayline 0C/C++ Problem" I have been following this tutorial: [URL]

View 2 Replies View Related

Programming :: Creating C++ Shared Libraries

Apr 4, 2010

I have 2 questions... I couldn't find answers by Googling (more precisely, by Blackling) and in GCC documents, so I'm asking here.

1. There are 2 flags for position independent code, -fpic and -fPIC. All the examples I read use -fPIC... so when is -fpic useful and what is the difference?

2. Some tutorials use "g++ -shared" while others use "ld" for the creation of the shared library. Why? Does it matter which method I use? Is there a difference? Why does nobody mention both options?

View 11 Replies View Related

Programming :: Gcc Cannot Find FastCGI Libraries

Jan 6, 2010

I've been trying for days now to build my first FastCGI application using gcc.

This is the output:

Code:

I believe I wouldn't have to refer to the lib path, but I added the -L flag to be sure.

The directory /usr/lib includes (among others) these files:

Code:

I have tried to follow these instructions. The files in the tar.gz archive provided by FastCGI.com no longer corresponds to the instructions there, but I was still able to run the ./configure and make commands so I believe FastCGI is installed.

But why can not the library be properly linked to? Really hope you can help me out on this one!

View 2 Replies View Related

Programming :: Use 32 Bit C Libraries On 64 Arch Sysem?

Apr 11, 2010

Just what it says in the title.

I can work in a 32-bit VirtualBox VM, but it's very inconvenient and I would rather work in my 64-bit desktop if that's not too difficult.

These are all the lib32 packages I have installed code...

View 14 Replies View Related

Programming :: Dynamically Loading Libraries In GNU?

Oct 22, 2010

This post isn't really asking for a tutorial, but rather asking for some ideas. I've come up with a few ideas, but they seem cumbersome and unnecessary, so I was wondering if someone with more experience than me could out. Also, my explanations suck, but I'll try to do my best. So say I have an executable called X. At some point during its execution, X loads and uses (using dlopen and dlsym) a library called Y. In Y, there a bunch of functions that call the function called, for example, void *special_malloc (size_t). These functions come from another linked library (linked during compilation) called Z. Problem is, special_malloc contains some static variables within its scope, and when those variables are reset midway through a program, an invalid free occurs (special_malloc uses garbage collection). Now, what I want to happen is that whenever lib Z calls special_malloc, it instead calls the special_malloc defined in the executable X, so that these static variables are retained. Keep in mind that I have control of the Z library, meaning I can edit the source to fit my needs.

View 2 Replies View Related

Programming :: Removing Symbols From Binary Executable File

Aug 21, 2010

Arm-linux-strip for removing the symbols from binary executable file after compilation. What exactly the symbols means.

View 1 Replies View Related







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