Programming :: Random Libraries Are Not Directly Executable?
Jun 30, 2011
Since I read that executing a library could return its version number, I ran "/lib/libc.so.0" on uClinux, but it triggers an error.I'm told that random libraries are not directly executable. Does someone know what a random library is?PS: In case that matters, here's the short version of the error:
<5> - May be used to emulate instructions that are not defined for
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
When you use an if statement directly in bash you have to put the ";" at the end or not? or am I mixing it with the for loop? I am reading advance bash scripting and it shows the if - then statements without ";" so I need a little clarification here.
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.
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?
I have written C++ programs on Windows. I am now learning Linux to ensure my software is portable. I can compile and run C++ programs from the bash shell, but I cannot run my executable programs from the GUI.Here is my sample program:
I'm maintaining a c++ application running on a 64-bit RHEL5 server w/32GB ram, but compiled to be a 32-bit executable with g++. The application handles large amounts of data, and has lately been throwing a st9bad_alloc exception. "top" shows the application as dieing right around when VIRT=~3GB, SWAP=~1.5GB and RES=~1.5GB. In the core dump I can see that it's consistently failing to push_back() a piece of data onto a std::vector (which already has hundreds of thousands of objects in it).
I know 4GB is the maximum address space for 32-bit applications. I've learned from this lwn article that a 32-bit kernel reserves 1GB of address space, leaving 3GB for user space. However I'm not running a 32-bit kernel, so that really doesn't answer anything.I wrote a dummy app which called malloc() over and over in a for loop, and it is able to allocate right up to the 4GB before it fails. I don't understand why this one seems to be able to allocate more.
The only difference between the two apps (besides malloc vs std::vector:ush_back), is that the 3GB crashing application attaches to 512mb of shared memory.Anyone have any ideas why this application would be crashing at 3GB? Is there any more diagnostics I should be doing? I would ultimately like to port this to 64-bit for a number of reasons, but it is a big undertaking for my organization, and I'd like to better understand what's going on here.
i have only basic knowledge of C so guys plz help me...is C language support call the C executable inside the C ?example contect mainA.c have a many function define in the struct,when i compile mainA and make a executable the name is ( A ),can i use executable C inside the C <my C program call the executable ( A ) > .
It is possible to run multiple instances of a jar executable. Is it possible that only a single instance of the jar runs? Wrappers like JSmooth or Launch4J can be made to run as a single instance. But since there are no such wrappers for linux, I need a way to restrict the jar to a single instance. How to embed the jar file into an executable such it runs a single instance?
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
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)
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]
I've been trying for days now to build my first FastCGI application using gcc.
This is the output:
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:
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!
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.
I am trying to use a software package written in ANSI C. It has a makefile which has to be executed first.
As soon as I execute it I get messages like: line i: command not found.
Commands for which I am getting errors :
CC = /usr/bin/gcc GCCFLAGS = -c -Wall ROOTDIR = .
My gcc compiler is located in the above directory only. In ROOTDIR also I tried giving the path in which all the required files & folders are present but still I get the command not found error in all the lines.
I wrote a c++ program but for security reasons I need to make sure that no one can read my codes by my ".out" files. I did everything I could. But everyone can see it by "strings Alpha.cpp".I heard that g++ has some options to do so.
I need to redirect a /usr/sbin/sendmail command to $HOME/bin/msmtp .The sendmail command would be coming from a PHP5 application. I'm assuming the best way is to use .bashrc, but .htaccess is also available.The remote server is a shared web host which is running Debian 4.0.I do not have root access.I have SSH access.
Generating avi files for movies directly from gfortran programs. I make movies from my Fortran codes using seismic unix - SU. Need to modernize this method to make avi movies or something similar. I am quite adept at generating "C" binary files from Fortran. Have not been able to find the documented definition of AVI file format.
I'm using debian and, though i'm new to c++, i'm writing a program using it which needs some HTTPs functionalities . I found these libcurl libraries could help me but I haven been able to use them from my program. I installed them (power trio configure -make -make install ) but i guess i'm doing something wrong ... i feel like i should copy or link them somehow in my project (besides the include sentences in my code). I hope you could give me a hand with this im quite lost
I am using the API libpcap in order to filter the traffic of the port 53 from my PC ro other PCs, in other words the DNS traffic.I want to get more information about the DNS traffic that is being sent to the DNS server, in other words the queries. So far I have no idea how to read the information data or payload of the UDP package in order to read the content of the traffic for example if there is any PTR, A, MX, etc Resource Record.According to the RFC 1053 there is a header that is possible to use in order to easily get this info.
Any good tutorial on sharing dynamically allocated objects across shared libraries in the same process and between shared libaries and main(). In particular, I need to know what creation and destruction sequences are valid when libraries are being loaded and unloaded. For example, is it valid to allocate an object from inside a shared library procedure, and then delete that pointer from a different module, especially in the case where the allocating module has already been unloaded.
I imagine there might be all kinds of problems with this. Although my preliminary tests seem to work most of the time, I get crashes from time to time, but I'm not sure if they're caused by memory management or by threading issues. I've been restructuring my code to use a global context object to manage object creation and destruction from main(), but I'd like to find a clear exposition of the specific issues I'm dealing with before I go too much further.
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...
My senior project team at Penn State is starting to write our code, and I was looking for a revision control system to manage it. I was going to use CVS, but I can't find a client that doesn't have to install something on the local machine(we dont have administrative permissions on school computers). Is there a CVS(or Subversion or anything else) client that comes as a single executable file or web interface?