Gcc 4.3 and Header issues
I’m using gcc 4.3.3 version and nowadays i’m trying to write hybrid file transfer system with c++ on Linux.The problem is i used to use some function in c or c++ like strcmp() with including string library but now when i try to compile I’m getting some error like
error: ‘strcmp’ was not declared in this scope
Simple example code
In gcc 4.1 version i can compile this code without any error or warning
-
#include <string>
-
#include <iostream>
-
"gccHeaderIssue","gccHeaderIssue""kelimeler ayni"<<endl;
-
}
-
}
-
but same code can’t compile in gcc 4.3 ,it returns error like
We can solve this error with including cstring library .After that our code is
-
#include <string>
-
#include <iostream>
-
#include <cstring>
-
"gccHeaderIssue","gccHeaderIssue""kelimeler ayni"<<endl;
-
}
-
}
-
The other missing headers
If missing | Then include this header |
---|---|
find, for_each, sort | <algorithm> |
ostream_iterator, istream_iterator | <iterator> |
auto_ptr | <memory> |
typeid | <typeinfo> |
isalnum, toupper | <cctype> |
INT_MIN, INT_MAX, RAND_MAX | <climits> |
printf | <cstdio> |
atoi, free, rand, exit | <cstdlib> |
EXIT_FAILURE | <cstdlib> |
strcmp, strdup, strcpy, memcpy | <cstring> |
Removal of Pre-ISO headers
Various backwards and deprecated headers have been removed.
If missing | Then include this header |
---|---|
<algobase.h> | <algorithm> |
<algo.h> | <algorithm> |
<alloc.h> | <memory> |
<bvector.h> | <vector> |
<complex.h> | <complex> |
<defalloc.h> | <memory> |
<deque.h> | <deque> |
<fstream.h> | <fstream> |
<function.h> | <functional> |
<hash_map.h> | <tr1/unordered_map> |
<hashtable.h> | <tr1/unordered_map> or <tr1/unordered_set> |
<heap.h> | <queue> |
<iomanip.h> | <iomanip> |
<iostream.h> | <iostream> |
<istream.h> | <istream> |
<iterator.h> | <iterator> |
<list.h> | <list> |
<map.h> | <map> |
<multimap.h> | <map> |
<multiset.h> | <set> |
<new.h> | <new> |
<ostream.h> | <ostream> |
<pair.h> | <utility> |
<queue.h> | <queue> |
<rope.h> | <ext/rope> |
<set.h> | <set> |
<slist.h> | <ext/slist> |
<stack.h> | <stack> |
<streambuf.h> | <streambuf> |
<stream.h> | <iostream> |
<tempbuf.h> | <ext/memory> |
<tree.h> | <ext/rb_tree> or <ext/pb_ds/assoc_container.hpp> |
<vector.h> | <vector> |
More information and solution for porting old programs to gcc 4.3 : http://gcc.gnu.org/gcc-4.3/porting_to.html
1 Comment to Gcc 4.3 and Header issues
Tags
Recent Posts
- PriveMall Davetiye
- Polymorphism (Overloading)
- Nautilus ve Ssh Bağlantısı
- Highlighting Nano
- Difference between C++ Class and C struct
- Gcc 4.3 and Header issues
- Re-Enable restarting X server with Ctrl+Alt+Backspace in Jaunty
- I Installed BETTER
- Ruby’de Sayiyi Yaziya Ceviren Program
- Ubuntu Volume Wheel Problem [ Fix ]
- Google Android
- Encoding mysql dump file while importing from console
- Ubuntu altinda mp3 kesmek {Cutting mp3 files over ubuntu}
- Flv’den mp3 elde eden bash programi {Converting flv to mp3}
- Video Sitelerinden İçerik İndirmek ve Videolardan Ses Almak
Thanks for this post
Could you help me?
I change to but when I execute the makefile, the program give me the next error:
MOFSVar.h:73: error: expected `)’ before ‘&’ token
MOFSVar.h:90: error: ‘ofstream’ not was declared
where
L_73: MOFSVar(ifstream& file_in);
L_90: void SalvarIncidencia(ofstream& file_out);
thanks,
and congratullations for the aspect of website