LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 10-04-2017, 07:40 PM   #1
severed_bit
LQ Newbie
 
Registered: Oct 2017
Location: Oregon
Distribution: Ubuntu 16.04
Posts: 2

Rep: Reputation: Disabled
Exclamation Problem linking archive file (libz.a) - could not read symbols: file format not recognized


I am working in Ubuntu 16.04. I am new to Linux and cross-compiling. I am using cmake and libwebsockets (LWS) to make a webserver that will be cross-compiled to a ARM and loaded on a TS-7800 dev board.

I have installed LWS and have compiled .exe files in gcc (Ubuntu's native compiler, I guess) and also in the cross-compiler (arm-linux-gcc). The problem comes in when I want to add "things" to the executables, like libuv, or openssl.

Adding a test webserver (lwsws) to cmake (-DLWS_WITH_LWSWS=1) allows me to build the LWS files, but when I try to compile (make && sudo make install), i get:

/usr/lib/x86_64-linux-gnu/libz.a: could not read symbols: File format not recognized
collect2: ld returned 1 exit status

If I compile without the lwsws flag, I can build and compile. To me, that would indicate that the archive is okay. I don't understand why it is a problem with the lwsws flag.

All of this stuff worked fine with the native gcc compiler.

I have been working incrementally to maximize my success, but I can't seem to get out of the continuous road blocks that Linux throws my way.

Thanks for any tips you might have.
 
Old 10-05-2017, 08:50 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,863

Rep: Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905
for me it looks like you want to cross link libs, so you tried to link x86_64 libs to an arm application.
Another cause can be: 32bit/64bit mismatch.
 
1 members found this post helpful.
Old 10-17-2017, 04:12 PM   #3
severed_bit
LQ Newbie
 
Registered: Oct 2017
Location: Oregon
Distribution: Ubuntu 16.04
Posts: 2

Original Poster
Rep: Reputation: Disabled
I told you I was new to this. I didn't realize I had to build libraries for the cross-compiler. Thanks for letting me know!
 
Old 10-18-2017, 02:09 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,863

Rep: Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905
Quote:
Originally Posted by severed_bit View Post
I was new to this
I'm really sorry, but it does not mean anything. I mean it is really hard to guess what do you really know and what is your real problem.
Giving more detailed description of your problem (what did you really execute, what's happened ... - make && sudo make install without context is meaningless too) could help us to give you better help.

But finally you could find the reason. That is good. Glad to head that.
Please mark the thread solved if you think your problem is now solved.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Glade compile error, could not read symbols: File in wrong format Lethys Slackware 5 10-01-2016 06:28 AM
[SOLVED] /usr/lib/libXfixes.so: could not read symbols: File in wrong format enine Slackware 2 12-16-2015 08:27 PM
How to format a SD card that's recognized as a read-only file? darthpinguim Linux - Hardware 4 02-26-2011 11:57 PM
/usr/lib/libfontconfig.so: could not read symbols: File in wrong format TrekJunky Linux - Newbie 2 10-01-2006 07:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 01:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration