473,395 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

What is "ERROR: Wrong magic number"

Hi all,

I written and compiled a c++ program using g++ no errors or
warning are reported.

But when I run it , reporting an error : ERROR: Wrong magic number.

What is the reason for this error?

anybody had an idea ?

--Ravi.T

Sep 26 '07 #1
4 2016
On Sep 26, 5:15 pm, ravi <gototh...@gmail.comwrote:
Hi all,

I written and compiled a c++ program using g++ no errors or
warning are reported.

But when I run it , reporting an error : ERROR: Wrong magic number.

What is the reason for this error?

anybody had an idea ?

--Ravi.T
OS is Linux.gcc3.4.3

Sep 26 '07 #2
ravi wrote:
Hi all,

I written and compiled a c++ program using g++ no errors or
warning are reported.

But when I run it , reporting an error : ERROR: Wrong magic number.

What is the reason for this error?

anybody had an idea ?
That sounds like the OS is having a problem running your executable for
some reason -- perhaps the first few bytes of the executable file are
not what they're supposed to be. Could be a problem with the compiler, a
corrupted file, a hardware issue, or something else.

You didn't post any code, but it seems like the problem might be beyond
that.
--
SM
rot13 for email
Sep 26 '07 #3
"ravi" <go*******@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
I written and compiled a c++ program using g++ no errors or
warning are reported.

But when I run it , reporting an error : ERROR: Wrong magic number.

What is the reason for this error?
Either you didn't link it, or the file you are executing is not the one you
think it is.
Oct 8 '07 #4
On Oct 8, 7:40 pm, "Andrew Koenig" <a...@acm.orgwrote:
"ravi" <gototh...@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
I written and compiled a c++ program using g++ no errors or
warning are reported.
But when I run it , reporting an error : ERROR: Wrong magic number.
What is the reason for this error?
Either you didn't link it, or the file you are executing is
not the one you think it is.
He didn't give a too many details, but in a lot of Unix
distributions today, the default $PATH doesn't have . in it
(which is as it should be for non-developers). And I find a lot
of files have the x bit set when they shouldn't. Combine the
two, and that could very easily explain his symptoms.

Depending on the shell being used, either "type command" or
"which command" can be used to see which executable is actually
being found. More generally, however, when testing a just built
executable, it's usually preferable to invoke it with
../filename. (Or maybe I just believe this because so many of my
test programs are called simply test:-), and even with . in the
path, test and ./test invoke different things.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Oct 9 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Chul Min Kim | last post by:
Hi, I got a BUS ERROR from one of my company's program. Let me briefly tell our environment. Machine : Sun E3500 (Ultra Sparc II 400Mhz CPU 4EA) OS : Solaris7 Compiler : Sun Workshop...
8
by: Grant Richard | last post by:
Using the TcpListener and TcpClient I created a program that just sends and receives a short string - over and over again. The program is fine until it gets to around 1500 to 1800 messages. At...
0
by: KathyB | last post by:
Hi, Using the following in an asp.net procedure. I get the error "The expression passed to this method should result in a NodeSet". Dim xDoc As New Document() The line causing the error is:...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
2
by: ken.carlino | last post by:
Hi, I have the following compile error instantiated from here, I appreciate if someone can help me find out why? g++ -O0 -g3 -Wall -c -fmessage-length=0 -ostddev.o ../stddev.cpp...
16
by: Frederick Gotham | last post by:
Does the following snippet exhibit undefined behaviour (excuse the stupidity of the code): int i = 5; i = i; Or what about a more complex form of it: void Func(int *const p,int const...
3
by: DontB3 | last post by:
Hi, I'm new in this forum, and i hope someone can help. I'm creating an automatic application that transfer a database from Access -> DBF -> Oracle. When My App try to execute Insert SQL...
5
by: Cirene | last post by:
I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm using, webhost4life. NOTE: I HAVE deployed other SQL Server sites to the same account with no issues. Now I'm getting...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.