LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-15-2011, 01:18 PM   #1
thosch97
Member
 
Registered: Feb 2010
Distribution: Xubuntu
Posts: 40

Rep: Reputation: 16
SIMH diesn't compile "undefinied reference to [fmod|clock_getres" although -lrt/-lm


Hello,

I wanted to compile SIMH (http://simh.trailing-edge.com/), but following happens:
Code:
<thosch97@darkstar:~/simh>
zsh 6 % make     
gcc -std=c99 -U__STRICT_ANSI__ -g -lrt -lm -D_GNU_SOURCE -I . PDP1/pdp1_lp.c PDP1/pdp1_cpu.c PDP1/pdp1_stddev.c PDP1/pdp1_sys.c PDP1/pdp1_dt.c PDP1/pdp1_drm.c PDP1/pdp1_clk.c PDP1/pdp1_dcs.c scp.c sim_console.c sim_fio.c sim_timer.c sim_sock.c sim_tmxr.c sim_ether.c sim_tape.c -I PDP1 -o BIN/pdp1 
/tmp/ccANdat7.o: In function `drm':
/home/thosch97/simh/PDP1/pdp1_drm.c:205: undefined reference to `fmod'
/home/thosch97/simh/PDP1/pdp1_drm.c:236: undefined reference to `fmod'
/home/thosch97/simh/PDP1/pdp1_drm.c:246: undefined reference to `fmod'
/home/thosch97/simh/PDP1/pdp1_drm.c:257: undefined reference to `fmod'
/tmp/ccmSIFWD.o: In function `sim_os_ms_sleep_init':
/home/thosch97/simh/sim_timer.c:306: undefined reference to `clock_getres'
collect2: ld gab 1 als Ende-Status zurück (ld exited with 1)
make: *** [BIN/pdp1] Fehler 1 (error 1)
I'm using gcc-Version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) on 3.0.0-12-generic/Ubuntu 11.10

What is wrong with it?
Thank you for you help,

thosch97
 
Old 10-15-2011, 02:23 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
1) sudo apt-get install g++-4.4

2) Edit line 15 in 'makefile' from
Code:
  CC = gcc -std=c99 -U__STRICT_ANSI__ -g $(OS_CCDEFS) -I .
to :
Code:
  CC = gcc-4.4 -std=c99 -U__STRICT_ANSI__ -g $(OS_CCDEFS) -I .
... Then 'make' will create all 26 binaries to the BIN/ directory.

.
 
Old 10-16-2011, 05:19 AM   #3
thosch97
Member
 
Registered: Feb 2010
Distribution: Xubuntu
Posts: 40

Original Poster
Rep: Reputation: 16
Thanks! It works great now!
(Well, that also explains why it worked on a Sun Ultra5 with Debian Lenny: it has gcc version 4.3.2 (Debian 4.3.2-1.1))
 
  


Reply

Tags
simh



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
New MPICH2 installation "interfering" with "make", cant compile fortran programs shitij90 Programming 1 07-28-2011 09:40 AM
"Multiple definition of" and "undefined reference to" in QT Creator with QJson lib echelon89 Programming 1 05-01-2009 06:48 AM
Undefined Screen " XFree86" reference by serverLayout "XFree86 Configured" comox *BSD 7 01-17-2005 05:47 PM
Hi All ..Need help with "Fmod" SlackwareMan Linux - Software 0 08-20-2004 04:11 AM
ncurses compile error: "undefined reference" Mr. Eek Linux From Scratch 1 05-12-2003 04:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:35 PM.

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
Open Source Consulting | Domain Registration