1752796 Members
5633 Online
108789 Solutions
New Discussion юеВ

invalid magic number ?

 
Pedro Pontes
Occasional Contributor

invalid magic number ?

Hi,

I'm trying to compile a C program in a HP-UX 11.00, and I'm recieving the error message: "Not a valid object file (invalid magic number)". Does any one knows anything about this error? All I know is that chatr returns to me a valid magic number (i.e., "shared executable").
COuuld it be some 32-bit /64-bit compilation problem?
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: invalid magic number ?

Hi Pedro:

I suspect that you are not having compile problems but rather linking problems with one of your .o files.
If it ain't broke, I can fix that.
Pedro Pontes
Occasional Contributor

Re: invalid magic number ?

Clay,

Actually, yes. The error is being returned by the linker (ld). But I still can't identify the reason for this kind of error, or what it means.

Can you help me?

thanks!

Pedro
Bruce Mulder
New Member

Re: invalid magic number ?

I have seen this before when we accidentally mixed 32-bit and 64-bit libraries. Double check your library path variables and the contents of the library directories.
A. Clay Stephenson
Acclaimed Contributor

Re: invalid magic number ?

Do a 'file myfile.o' and let's see what that reports. Was this .o generated on this machine?
If it ain't broke, I can fix that.