News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Problem with Build

Started by Rishahnu, September 21, 2009, 12:05:13 AM

Previous topic - Next topic

Rishahnu

Hi Folks,

I just installed Code::Blocks version 8.02 today, and it seems great so far, except for this problem when I try to build a project:

Quote-------------- Build: Debug in RobostixStabilitySystem ---------------

Linking console executable: bin/Debug/RobostixStabilitySystem.elf
/usr/lib/libm.so: file not recognized: File format not recognized
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

I'm using the AVR-GCC compiler version 4.3.2 in Ubuntu version 9.04, and am compiling for the ATmega128. Any suggestions?

Thanks!

stahta01

#1
Read the FAQ and turn on full compiler logging.
Verify the project is using correct compiler with proper project settings.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Rishahnu

Thanks for the reply!

I turned on full compiler logging and now I get the following output:
Quote-------------- Build: Debug in RobostixStabilitySystem ---------------

avr-g++ -L/usr/lib  -o bin/Debug/RobostixStabilitySystem.elf obj/Debug/main.o   -mmcu=atmega128 -Wl,-Map=bin/Debug/RobostixStabilitySystem.elf.map,--cref 
/usr/lib/libm.so: file not recognized: File format not recognized
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

stahta01

A wild guess from a windows user; but, does "/usr/lib" contain the proper libraries for the embedded AVR compiler?

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Jenna

#4
Is your system 64- or 32-bit ?

I'm not sure whether the avr-cross-linker should link against the systems libm.so, but it might be correct.
But if you have a 64-bit and need 32 it will not work.

In this case you need the 32-bit libs also, the package you need in this case is most likely ia32-libs-dev.
And you should use /usr/lib32/ as linker-searchpath in this case.

Please be aware, that all I posted is only correct, if the cross-compiler uses the systems libc6 and is 64-bit.


Most likely all wrong.

I just looked into the debian package list.
Do you have avr-libc installed ?

Quote from: description for avr-libcStandard C library for Atmel AVR development

Standard library used to the development of C programs for the
Atmel AVR micro controllers. This package contains static
libraries as well as the header files needed.

Rishahnu

Yeah, I believe I do have avr-libc installed. Any idea how would I check to make sure?

My system is 64 bit, but I do think I already have the ia32-libs-dev package. I added it to the linker search path with no success...

Thanks for the continued help.

Jenna

You have /usr/lib in the linker search-path, that's normally wrong for cross-compiling, because it contains system-libs.
You might ned to explicitely set the path where the libm.so for your microcontroller is to the linker search paths.
dpkg -L <package-name> lists all files belonging to the package.
In your case dpkg -L avr-libc.

If it is not installed, you can install it with sudo apt-get install avr-libc.

Rishahnu

Thanks! I changed the search location for the linker to lib32 instead of lib, and it now works!

Cheers!