954,479 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Linker Error with Dev-C++

Hi all!
I'm at work - newly hired:) - and I'm given this mpeg2 video codec

http://www.mpeg.org/MPEG/video/mssg-free-mpeg-software.html

and in particular the decoder that exists in the folder mpeg2v12.zip.
It is code c written for gcc, so I decided to download MinGW and DevC/C++. I add all the files to the project and then clicked compile.Compilation always stops though because of errors with the linker:

[Linker error] undefined reference to `__cpu_features_init'
140:8 C:\MPEGORG_CODEC\src\mpeg2dec\spatscal.c ld returned 1 exit status

:'( I am trying to solve this problem the whole day.I tried rebuild all, clean, compile, with all possible combinations but nothing worked.
I noticed though while googling a lot of links reporting linker errors with dev-c++.

I am just started learning C and C++ and I feel very discouraged...:(
Anybody any idea?


compilation log is attached.

Attachments log.txt (3.15KB)
Alice_Blue
Newbie Poster
3 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

That error means it can not find the function cpu_features_init() in any of the file it compiled or in any of the libraries it is trying to link.

Check out those warnings -- they might actually be errors which are causing that link problem.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Could you tell us what include directives you used?

Ahmed_I
Light Poster
32 posts since Nov 2008
Reputation Points: 14
Solved Threads: 1
 

thanx a lot! i solved my problem - actually I don't know what was exactly.It just took me a day, of trying, and all of a sudden..

it might have been a small unintentional change to my code, who knows...:D

Alice_Blue
Newbie Poster
3 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

Hi ,
I too have face same prob. It happens when there is already mingw32 already installed on your computer.

The solution is to mingw32 from add remove problem and delete its folder from C drive.

May be u need to re install Dev and hopefully probelm will vanish

jainpratik2
Newbie Poster
7 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

>>May be u need to re install Dev and hopefully probelm will vanish

Forget Dev-C++ because it has not been updated for quite a few years now. It's officially dead.

Get Code::Blocks with MinGW compiler (its all in one install package). You might want to uninstall Dev-C++ first.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You