LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 07-20-2013, 03:25 PM   #1
PeterUK
Member
 
Registered: May 2009
Posts: 277

Rep: Reputation: 16
Compiling FX2_Programmer errors


I am trying to learn about FX2 programming and USB handling, I am trying to compile the whole FX2_programmer code from here

But after changing all the warning mainly have to be with the buffer from unsigned to just char, I getting this error:

Quote:
/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: note: 'pthread_create@@GLIBC_2.1' is defined in DSO /lib/libpthread.so.0 so try adding it to the linker command line
/lib/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [fx2_viewer] Error 1
Also I cannot remove this warning:
Quote:
fx2.c: In function 'usb_reader':
fx2.c:79:2: warning: pointer targets in passing argument 3 of 'usb_bulk_read' differ in signedness [-Wpointer-sign]
In file included from fx2.c:10:0:
/usr/include/usb.h:303:5: note: expected 'char *' but argument is of type 'unsigned char *'
/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: /tmp/cc81eRgD.o: undefined reference to symbol 'pthread_create@@GLIBC_2.1'
But I looked at that function and I have removed "unsigned" from the char, and you see it giving the error at usb.h evaluation.

Here is the make file:

Quote:
CC=gcc -pipe -g -Wall -O2

PREFIX=/usr/local/

#
# FX2 viewer uses GL, GLUT and FFTW
#
# First two usually come standard, the latter can be obtained from
# http://www.fftw.org/
#

VIEWER_LIBS= -L/usr/X11/lib -lGL -lGLU -lglut -lfftw3


all: fx2_programmer fx2_viewer test1



test1: fx2_programmer fx2_viewer
@echo "---------------- FX2 PROGRAMMER -----------------------"
@./fx2_programmer || true
@echo "------------------ FX2 VIEWER -------------------------"
@./fx2_viewer || true


fx2_programmer: fx2_programmer.c
$(CC) fx2_programmer.c -lusb -o fx2_programmer

fx2_viewer: fx2.c fx2.h viewer.c
$(CC) fx2.c viewer.c $(VIEWER_LIBS) -lusb -o fx2_viewer


install: fx2_programmer fx2_viewer
install -s -m 0755 ./fx2_programmer ${PREFIX}/bin/
install -s -m 0755 ./fx2_viewer ${PREFIX}/bin/

tarball:
(cd .. ; tar cvf - fx2_programmer/Makefile fx2_programmer/*.c fx2_programmer/*.h fx2_programmer/README.txt) | gzip - > fx2_programmer.tgz
How do I fix this compiling problem? Thanks
 
Old 07-20-2013, 03:32 PM   #2
John VV
Guru
 
Registered: Aug 2005
Posts: 13,243

Rep: Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774
try using g++ instead of gcc

that normally solves the DSO error

if not then you might need to add " -Lpthread " in the linker line

Last edited by John VV; 07-20-2013 at 03:33 PM.
 
Old 07-20-2013, 06:50 PM   #3
PeterUK
Member
 
Registered: May 2009
Posts: 277

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by John VV View Post
try using g++ instead of gcc

that normally solves the DSO error

if not then you might need to add " -Lpthread " in the linker line
If I change g++ it disappear the error but it get some new ones:

Quote:
fx2.c: In function 'void init_buffers()':
fx2.c:62:44: error: invalid conversion from 'void*' to 'char**' [-fpermissive]
fx2.c:64:53: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
viewer.c: In function 'void glut_printf(void*, const char*, ...)':
viewer.c:69:28: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
viewer.c:74:29: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
viewer.c: In function 'void init_fft()':
viewer.c:262:50: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
viewer.c:263:46: error: invalid conversion from 'void*' to 'double (*)[2]' [-fpermissive]
viewer.c:264:46: error: invalid conversion from 'void*' to 'double*' [-fpermissive]
make: *** [fx2_viewer] Error 1
But I guess those can be fixed,

if I leave gcc and add "-Lpthread "

I get:

Quote:
cc -pipe -g -Wall -O2 fx2.c viewer.c -L/usr/X11/lib -lGL -lGLU -lglut -lfftw3 -Lpthread -lusb -o fx2_viewer
/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: /tmp/ccHII0ie.o: undefined reference to symbol 'pthread_create@@GLIBC_2.1'
/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: note: 'pthread_create@@GLIBC_2.1' is defined in DSO /lib/libpthread.so.0 so try adding it to the linker command line
/lib/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [fx2_viewer] Error 1
So no a fixed! :-(
 
Old 07-20-2013, 07:27 PM   #4
John VV
Guru
 
Registered: Aug 2005
Posts: 13,243

Rep: Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774Reputation: 1774
by chance are you building a 32 bit program ( using the 32 bit gcc tools) on a 64 bit OS

also seeing as "fx2_programmer-2.0.2.tgz" is from 2005
your current version of gcc4.7 it very likely way too new


install the compatibility gcc 3.3 or 3.4

gcc 4.1 might work ?

fx2_programmer-2.0.2.tgz is 8 years old and has not been updated to use any newer software

it is likely that you will need to use 8+ year old Operating system or 8+ year old versions of programs


---------- edit ---

just built it ( while replying )
it builds using gcc 4.3 and 4.7
BUT i had to have the lib line in the Makefile use this
Code:
VIEWER_LIBS= -L/usr/X11/lib -lGL -lGLU -lglut -lfftw3 -lm -lpthread
this is on a 64 bit install of OpenSUSE 12.3 ( i have gcc 33 ,43, and 47 installed currently )

Last edited by John VV; 07-20-2013 at 07:31 PM.
 
Old 07-20-2013, 07:46 PM   #5
PeterUK
Member
 
Registered: May 2009
Posts: 277

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by John VV View Post
by chance are you building a 32 bit program ( using the 32 bit gcc tools) on a 64 bit OS

also seeing as "fx2_programmer-2.0.2.tgz" is from 2005
your current version of gcc4.7 it very likely way too new


install the compatibility gcc 3.3 or 3.4

gcc 4.1 might work ?

fx2_programmer-2.0.2.tgz is 8 years old and has not been updated to use any newer software

it is likely that you will need to use 8+ year old Operating system or 8+ year old versions of programs


---------- edit ---

just built it ( while replying )
it builds using gcc 4.3 and 4.7
BUT i had to have the lib line in the Makefile use this
Code:
VIEWER_LIBS= -L/usr/X11/lib -lGL -lGLU -lglut -lfftw3 -lm -lpthread
this is on a 64 bit install of OpenSUSE 12.3 ( i have gcc 33 ,43, and 47 installed currently )
I have gcc-4.7.1-i486-1 on a slackware(14) machine and add the two link libraries and wooallaaa, it compile too, thanks

I did look at that viewer file and notice that was even used of fft and more maths never though I needed the lm link, even I have used in some code :-/, Thanks John that fix that bug!

John do you know a lot of the USB interface?
 
  


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
Compiling errors when compiling OpenGL with GLUT Hvl Programming 3 06-28-2011 09:21 AM
Errors while compiling pita0017 Linux - Software 3 01-22-2009 09:18 PM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 06:03 AM
Errors when compiling anything! adizzle Linux - Newbie 4 06-16-2004 06:27 PM
Errors compiling 2.6.0 plisken Linux - General 3 10-10-2003 06:12 PM


All times are GMT -5. The time now is 04:48 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration