.o: File Not Recognized: File Format Not Recognized When Compiling

Hello,

I am working on a board (sbc6000x with at91sam9261 micro, linux 2.6.24 to be precise) and having some fun making script i wanted to make real application.
The board is coming with a cross compilation toolchain. When trying to make a simple "hello world" executable to print on the terminal there is no problem.
I open my terminal, give the path of the compiler, cd into the folder where my .c file is and then i type :
Code:
arm-linux-gcc -o hello hello.c

Which create my executable "hello" and this one is working. But like i said, this program only played with the terminal.

The board is starting with a script calling another executable which use the lcd display, i have the source of this executable. My idea was to look at what was in the source of this application (lots of folders and files) in order to understand how it was working. I wanted to test the toolchain on the source (with the makefile) to see if i was able to generate an executable from a application with folderS/fileS but when i try to "make" it i have this error.

In my understanding this is an object file but aside from that i don't see why it would not works.

Thank you for your future answers !


Similar Content



Executable Not Found From /usr/local/bin

Hi,

I installed ghostscript via yum package manager. Later I wanted a newer version of ghostscript and compiled it from source. "make install" placed the gs executable file under /usr/local/bin/gs. This works if I run the command with absolute path, but if try to run gs, the shell will output

"-bash: /usr/bin/gs: No such file or directory"

if I echo the path variable it will display

/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin

If i run whereis it will give me the correct path
gs: /usr/local/bin/gs

How do I make it work so that typing "gs" will run the executable file from the /usr/local/bin/gs?

(I am using Centos 6)

Thanks.

Cygwin Rsync Script Copying File Incorrectly

I am trying to write a simple test script that executes a single rsync call. Once I get the syntax right, the script will be expanded to incorporate several rsync instructions to save me time.

I'm using a Cygwin Terminal on Windows 7 to run Rsync.

The script is called "backup" and I call it from the cygwin terminal using "./backup". Have used chmod to make it executable.

When I execute the rsync instruction as a standalone instruction at terminal prompt, the file copies to the target folder perfectly.

However, when I try and drop the same instruction into a script, it copies the file over from it's original file name "mvi_1840.mov" to a file with the name "." -- literally a single period. I can rename the file to a .mov file and it works fine but naturally, I don't want to have to do this.

The one other thing I will mention is that the file is located in the /home/"username" directory in cygwin vs /bin. But I would not think that this would make a difference.

I have pasted the contents of the script file below:
Code:
#!/bin/bash
    rsync.exe -rltDvP --exclude "System Volume Information" --exclude
 "RECYCLER" --exclude=\$RECYCLE.BIN --delete "/cygdrive/c/users/<USERNAME>
/desktop/mvi_1840.mov" "/cygdrive/c/users/<USERNAME>/desktop/test/"

Any help would be greatly appreciated!

Thanks

Tar Is Not Extracting All Files

Hi,

I have an tar.gz file which when right click extract here on my ubuntu computer is extracted without issue. I have all the folders and all the files (links and one executable) in them.
But when i transfert this tar.gz to another system and use the command :
Code:
tar zxvf nameofthefile.tar.gz

I see in the terminal things like that :
Code:
usr/bin/unzip/lzop        
usr/bin/xargsbin/mountpoin
usr/bin/telnet
bin/pipe_prog
usr/bin/lzma        
bin
usr/bin/sort

which mean that the files must be extracted but when using "ls" intot he folders they are empty. All the links are not here and only the executable is extracted.

When i copy back the archive from the new system to my ubuntu system and extract it all the files are here without issue. Why is it only creating the folders and not extracting the links ?

What Does The "T" Mean When You List File Permissions W/ Ls -l

I have a directory w/ a file that I created using:
Code:
fd = open("file", O_CREAT);

The file turned out to be executable. When I did a 'ls -l' on the directory w'/ that file it has a "T" at the end of the permissions where the executable bit would be set for the "other" group.

I'm New To Linux....questions Compiling A Small Source Code

Hi Everybody.....
I'm new to this site and new to Linux ( Ubuntu 12.04) generally. I am an old goat mechanical engineer with years of electronic instrumentation design experience. I am connecting several of my old HP digital oscilloscopes and logic analyzers to a Ubuntu box via GPIB (ieee 488) interface. I have the interface working well using the open source ( Sourceforge) "Linux-GPIB" kernel module. I can remotely control the instruments using "Linux-GPIB"'s "ibterm" terminal utility. However "ibterm" doesn't provide a means to do a scope screen dump to a file. A guy on EEBLOG published a short C language 30 line source code to perfome this function. Unfortunately it isn't a package with makefile.am, makefile .in, configure etc which I understand I could compile using the typical ./config, make, checkinstall procedure. It is just the c source code text. Soooo.....do I use gcc directly? If so, how do I run gcc in a manner to be able to uninstall all the various files it will make? Or ?? What is the procedure for automake in this situation ? Or....? I'm kind of lost. Your suggestions would be helpful.
Cheers.
Alan Jacobs
Green Bay, Wisconsin USA

How To Share The Same Code Segment Between Two Processes Using Mmaps?

Hi Experts:

I'm new to Linux,recently i was confused with the words as below:

"To achieve sharing,the process A mmaps the executable file of process B into into the virtual address space of process A. As the Linux loader maps the executable files into the process when executing them,the two processes share the memory image of the mapped file"

questions:
1,What are the "executable files",are they ELF files?
2,How to do "mmaps"?if process A and process B share the same code segment, ,where is process A's own code segment?


Thank you in advance.

How To Write A Makefile With .c And .asm File

Hi,
I am working with Debian and gcc.

I have a single C file main.c, with some code in it.
For this trivial build, I am using the following Makefile:

Code:
SOURCES=main.c
CFLAGS=-c -w -gdwarf-4 -g3 -O0

LDFLAGS=
CC=

OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=myprogram

all: clean $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
	$(CC)gcc $(LDFLAGS) $(OBJECTS) -o $@

clean:
	rm -f $(EXECUTABLE) $(OBJECTS) $(MAKE)

.c.o:
	$(CC)gcc $(CFLAGS) $(LDFLAGS) $< -o $@

Now, in main.c, I want to use an assembly function, say myFunction which is implemented in the file function.asm.

My question is now: how do I build this? How do I modify the Makefile above to do this ?

Many thanks for your help!!!

PD.

How To Make .bin File Of C Code

I have simple c code and I want to make .bin file to run on friendly arm board. In redhat I install cross compile gcc and Use "gcc -o hello hello.c" this command to make object file. when I run this file in friendly arm it give "line 1: syntax error: unexpected "(" "

Thanks
--
Abdul Wahab

Python Ftplib

hello all,

please help me with python ftplib. i was trying to copy files from my linux machine to a windows server using ftplib. everything was working good. but i'm only able to copy files from the same directory the script is. how do i copy files from a different directory? i always get "file not found error message". here's my code :

Code:
tester_name = str (socket.gethostname())
def upload(ftp, file):
    ext = os.path.splitext(file)[1]
    if ext in (".txt", ".htm", ".html"):
        ftp.storlines("STOR " + file, open(file))
    else:
        ftp.storbinary("STOR " + file, open(file, "rb"), 1024)



parse_source_path = ('/path/to/where/i/go/')
parse_source_file_list = os.listdir(parse_source_path)

ftp = ftplib.FTP("server_IP")
ftp.login("username", "pass")

folder_list = []

ftp.dir(folder_list.append)

if str(tester_name) not in str(folder_list) :
    ftp.mkd("%s"%tester_name)
    ftp.cwd("%s"%tester_name)
    for files in parse_source_file_list :
        print files
        upload(ftp, files)


else :
    print "later"

How To Use Static Libraries? Please Help Lol

https://code.google.com/p/wavelet1d/...ar.gz&can=2&q=

The above link is where I downloaded *.cpp(s) and the libraries.

If you "untar" the package, in "examples" directory, there are some demonstration files. What I wanted to do was to make an executable file out of "wavedemo1.cpp".

I modified the code in "wavedemo1.cpp"; Code:
#include "wavelet2d.h"

to Code:
#include "wavelet2s.h"

, then placed the header file "wavelet2s.h" (from /wavelib/src/linuxstatic) and the modified "wavedemo1.cpp" into my working directory.

Inside the working directory, I ran the following command

Code:
gcc -L/home/mario/wavelet/wavelib/linuxstatic -lwavelet2s wavedemo1.cpp -o wavedemo1

Then I get the following error messages.

/usr/bin/ld: skipping incompatible /home/mario/wavelet/wavelib/linuxstatic/libwavelet2s.a when searching for -lwavelet2s
/usr/bin/ld: cannot find -lwavelet2s
collect2: error: ld returned 1 exit status

I'm not sure what went wrong with my approach. This is my first time trying to use libraries on linux and it's giving me really tough times.

I would appreciate your help, please let me know if you need more details to explain things.

Thanks.