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.

Recommended Answers

All 8 Replies

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.

Could you tell us what include directives you used?

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

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

>>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.

I like the old Dev-Cpp, and still using that. I had similar problem but I could fix it withouh reinstallation. The reason in my case was a mixing with new mingw installation. In the "Compile log" window I seen that crt2.o was linked from an other location. Solution is deleting "LIBRARY_PATH" variable. Actually, I set dev-cpp to call an own made "make.bat" instead of "make.exe", and that " make.bat" has a "SET LIBRARY_PATH=" line at the top. (And this make.bat do some other tricks: it can call latest make.exe version and can compile with -j multi-thread parameters withouth problems)

I like the old Dev-Cpp, and still using thatc

I guess you like using obsolete and buggy programs :) But you could just update the MinGW compiler with newest version.

By now, I know well the few bugs in Dev-Cpp, and can manage them. Of course, new development tools and compilers are better, but I am quite sure that they have also bugs, many of them is not yet known. For my projects running in low power embedded systems, DevCpp and old Mingw and old GTK works very well, for many many years, I trust this system. If I turn into a newer envirement and compiler, then I take some risk. Anyway, I am also using the latest MinGW (just downloaded last week), but mainly for developping calculation-intensive applications.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.