file not recognized: File format not recognized

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2009
Posts: 20
Reputation: mathueie is an unknown quantity at this point 
Solved Threads: 0
mathueie mathueie is offline Offline
Newbie Poster

file not recognized: File format not recognized

 
0
  #1
Apr 10th, 2009
Hi


I am using eclipse.I got error.I am using g++ complier.

*.o : file not recognized: File format not recognized
collect2: ld returned 1 exit status

Please any one help me..
Last edited by mathueie; Apr 10th, 2009 at 8:11 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: file not recognized: File format not recognized

 
0
  #2
Apr 10th, 2009
As far as I know it happens after "compilation" of .h files.
Insufficient info...
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: file not recognized: File format not recognized

 
0
  #3
Apr 10th, 2009
A '.o' file is normally an object file, are you trying to link an object file to an executable file ?

Maybe you should check out this also ...

Originally Posted by ArkM View Post
Insufficient info...
Agreed
Last edited by tux4life; Apr 10th, 2009 at 8:50 am.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 20
Reputation: mathueie is an unknown quantity at this point 
Solved Threads: 0
mathueie mathueie is offline Offline
Newbie Poster

Re: file not recognized: File format not recognized

 
0
  #4
Apr 10th, 2009
Originally Posted by ArkM View Post
As far as I know it happens after "compilation" of .h files.
Insufficient info...


yes. It happens after compilation of .h files.
you mentioned insufficient information.
can you tell what information you want about this problem.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 20
Reputation: mathueie is an unknown quantity at this point 
Solved Threads: 0
mathueie mathueie is offline Offline
Newbie Poster

Re: file not recognized: File format not recognized

 
0
  #5
Apr 10th, 2009
Originally Posted by tux4life View Post
A '.o' file is normally an object file, are you trying to link an object file to an executable file ?

Maybe you should check out this also ...


Agreed



yes, .o file is an object file.
I am trying to link an object files to the library files.
This same program i complied successfully in Netbeans using g++ complier
Now I am using eclipse.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: file not recognized: File format not recognized

 
0
  #6
Apr 10th, 2009
Originally Posted by mathueie View Post
I am trying to link an object files to the library files.
To create a static library from an object file you just need to invoke the following command:
ar -rv libyourlibfilename.a yourobjectfile.o
Last edited by tux4life; Apr 10th, 2009 at 11:18 am.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 20
Reputation: mathueie is an unknown quantity at this point 
Solved Threads: 0
mathueie mathueie is offline Offline
Newbie Poster

Re: file not recognized: File format not recognized

 
0
  #7
Apr 10th, 2009
Originally Posted by tux4life View Post
To create a static library from an object file you just need to invoke the following command:
ar -rv libyourlibfilename.a yourobjectfile.o



Hi

I won't create static library file from object file.
already I created static and dynamic library file.Now I am trying link object file to library file.
Any special properties setting is need in ecplise editor?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: file not recognized: File format not recognized

 
0
  #8
Apr 10th, 2009
Originally Posted by mathueie View Post
yes. It happens after compilation of .h files.
you mentioned insufficient information.
can you tell what information you want about this problem.
Well, you have compiled .h files as independent modules... But WHY?..
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,358
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1463
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: file not recognized: File format not recognized

 
0
  #9
Apr 10th, 2009
why not something like cc -o a.out obfile.o -lmylib.a
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: file not recognized: File format not recognized

 
0
  #10
Apr 11th, 2009
Originally Posted by Ancient Dragon View Post
why not something like cc -o a.out obfile.o -lmylib.a
That should do the trick, if I'm not wrong the following also works:
g++ -o a.out obfile.o -lmylib.a
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC