Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 215591

Summary: sys-power/acpitool-0.4.7-r1 fails to compile with gcc-4.3.0
Product: Gentoo Linux Reporter: Bert Karwatzki <spasswolf>
Component: [OLD] GCC PortingAssignee: Mobile Herd (OBSOLETE) <mobile+disabled>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 198121    
Attachments: acpitool-047-r1-gcc43-fix.patch

Description Bert Karwatzki 2008-03-31 14:50:09 UTC
compiling sys-power/acpitool-0.4.7-r1 with gcc-4.3.0 from portage fais with
main.cpp:142: error: »atoi« was not declared in this scope

Reproducible: Always




This patch solves the problem:

diff -aur src.old/acpitool.cpp src/acpitool.cpp
--- src.old/acpitool.cpp	2008-03-29 18:06:52.000000000 +0100
+++ src/acpitool.cpp	2008-03-29 18:08:16.000000000 +0100
@@ -31,6 +31,8 @@
 #include <iostream>
 #include <iomanip>
 #include <fstream>
+#include <cstring>
+#include <cstdlib>
 #include <dirent.h>
 #include "acpitool.h"
 #include "thinkpad.h"
diff -aur src.old/battery.cpp src/battery.cpp
--- src.old/battery.cpp	2008-03-29 18:06:52.000000000 +0100
+++ src/battery.cpp	2008-03-29 18:11:30.000000000 +0100
@@ -30,6 +30,8 @@
 #include <iostream>
 #include <iomanip>
 #include <fstream>
+#include <cstdlib>
+#include <cstring>
 #include <dirent.h>
 #include "acpitool.h"
 #include "thinkpad.h"
diff -aur src.old/cpu.cpp src/cpu.cpp
--- src.old/cpu.cpp	2008-03-29 18:06:52.000000000 +0100
+++ src/cpu.cpp	2008-03-29 18:10:56.000000000 +0100
@@ -31,6 +31,8 @@
 #include <iomanip>
 #include <fstream>
 #include <dirent.h>
+#include <cstdlib>
+#include <cstring>
 #include "acpitool.h"
 #include "cpu.h"
 #include "freq.h"
diff -aur src.old/freq.cpp src/freq.cpp
--- src.old/freq.cpp	2008-03-29 18:06:52.000000000 +0100
+++ src/freq.cpp	2008-03-29 18:12:07.000000000 +0100
@@ -30,6 +30,8 @@
 #include <iostream>
 #include <iomanip>
 #include <fstream>
+#include <cstdlib>
+#include <cstring>
 #include <dirent.h>
 #include "acpitool.h"
 #include "freq.h"
diff -aur src.old/main.cpp src/main.cpp
--- src.old/main.cpp	2008-03-29 18:06:52.000000000 +0100
+++ src/main.cpp	2008-03-29 18:08:40.000000000 +0100
@@ -30,6 +30,7 @@
 #include <iostream>
 #include <iomanip>
 #include <fstream>
+#include <cstdlib>
 #include <unistd.h>
 #include <getopt.h>
 #include "acpitool.h"
diff -aur src.old/thinkpad.cpp src/thinkpad.cpp
--- src.old/thinkpad.cpp	2008-03-29 18:06:52.000000000 +0100
+++ src/thinkpad.cpp	2008-03-29 18:10:25.000000000 +0100
@@ -3,6 +3,8 @@
 #include <iomanip>
 #include <iostream>
 #include <fstream>
+#include <cstring>
+#include <cstdlib>
 
 using namespace std;
 int IBM_be_quiet = 1;
diff -aur src.old/toshiba.cpp src/toshiba.cpp
--- src.old/toshiba.cpp	2008-03-29 18:06:52.000000000 +0100
+++ src/toshiba.cpp	2008-03-29 18:09:14.000000000 +0100
@@ -31,6 +31,7 @@
 #include <iostream>
 #include <iomanip>
 #include <fstream>
+#include <cstring>
 #include "toshiba.h"
 
 using namespace std;
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2008-03-31 19:41:57 UTC
Please attach, don't inline.
Comment 2 Bert Karwatzki 2008-04-02 08:47:48 UTC
Created attachment 148063 [details, diff]
acpitool-047-r1-gcc43-fix.patch

Patch attached.
Comment 3 Ryan Hill (RETIRED) gentoo-dev 2008-07-17 01:56:08 UTC

*** This bug has been marked as a duplicate of bug 214171 ***