trec_eval's makefile generates errors on windows - windows

Good morning,
I've got the same problem, here are the syntax errors mentionned bye the cygwin64 on windows7 :
$ make
gcc -g -I. -Wall -DVERSIONID=\"9.0\" -o trec_eval trec_eval.c ... m_Rprec_mult_avgjg.c m_P_avgjg.c -lm
In file included from sysfunc.h:21:0,
from m_ndcg.c:9:
m_ndcg.c:13:8: erreur : expected ‘)’ before ‘/’ token
double log2(double x);
^
In file included from sysfunc.h:21:0,
from m_ndcg_cut.c:8:
m_ndcg_cut.c:12:8: erreur : expected ‘)’ before ‘/’ token
double log2(double x);
^
In file included from sysfunc.h:21:0,
from m_Rndcg.c:9:
m_Rndcg.c:13:8: erreur : expected ‘)’ before ‘/’ token
double log2(double x);
^
In file included from sysfunc.h:21:0,
from m_ndcg_rel.c:9:
m_ndcg_rel.c:13:8: erreur : expected ‘)’ before ‘/’ token
double log2(double x);
^
In file included from sysfunc.h:21:0,
from m_binG.c:9:
m_binG.c:13:8: erreur : expected ‘)’ before ‘/’ token
double log2(double x);
^
In file included from sysfunc.h:21:0,
from m_G.c:9:
m_G.c:13:8: erreur : expected ‘)’ before ‘/’ token
double log2(double x);
^
make: *** [Makefile:54: trec_eval] Error 1
Is there someone that can help ?
Thanks

Related

error ‘underlying_type_t’ in namespace ‘std’ does not name a template type in example.cpp from project-OSRM

I try to execute the examle.cpp file of Project-OSRM. I did the following steps:
build OSRM from source as described here
in new terminal: cd osrm-backend/example
in the terminal: cmake ..
in the terminal: cmake --build .
in the terminal: sudo cmake --build . --target install
move the maps contractor, engine, extractor, partition, storage, util from /usr/local/include/osrm to /usr/local/include (else error maps are not in /usr/local/include)
in the terminal: g++ -std=c++11 example.cpp -o example
But I get the error
‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>
Does anyone have a idea what I'm doing wrong or what is going wrong and how to solve this?
Error message
In file included from /usr/local/include/engine/api/match_parameters.hpp:31:0,
from /usr/local/include/osrm/match_parameters.hpp:31,
from example.cpp:1:
/usr/local/include/engine/api/route_parameters.hpp: In function ‘bool osrm::engine::api::operator&(osrm::engine::api::RouteParameters::AnnotationsType, osrm::engine::api::RouteParameters::AnnotationsType)’:
/usr/local/include/engine/api/route_parameters.hpp:144:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:144:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:144:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:144:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:144:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(lhs) &
^
/usr/local/include/engine/api/route_parameters.hpp:145:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:145:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:145:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:145:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:145:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:145:84: error: expected ‘)’ before ‘;’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:145:84: error: expected ‘)’ before ‘;’ token
/usr/local/include/engine/api/route_parameters.hpp: In function ‘osrm::engine::api::RouteParameters::AnnotationsType osrm::engine::api::operator|(osrm::engine::api::RouteParameters::AnnotationsType, osrm::engine::api::RouteParameters::AnnotationsType)’:
/usr/local/include/engine/api/route_parameters.hpp:152:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:152:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:152:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:152:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:152:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(lhs) |
^
/usr/local/include/engine/api/route_parameters.hpp:153:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:153:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:153:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:153:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:153:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:153:84: error: expected ‘)’ before ‘;’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:153:84: error: expected ‘)’ before ‘;’ token
underlying_type_t requires C++14. To be able to use it pass -std=c++14 to your compiler.
Don't forget to
#include <type_traits>
This missing directive also lead to the same (confusing) error message.

EGlib 2.6.20 does not install (trying to install SCIP)

I am trying to solve an integer linear program using SCIP. The beta version that I require (for exact solving) is given at:
http://scip.zib.de/#exact
As linked there, the source code is at:
http://scip.zib.de/download.php?fname=scip-3.0.0-ex.tgz
I followed the INSTALL file. It requires the installation of EGlib 2.6.20. However, this installation fails during 'make' with the following error:
phani#OptiPlex-9030-AIO ~/EGlib-2.6.20 $ make
make[1]: Entering directory '/home/phani/EGlib-2.6.20'
make[1]: Leaving directory '/home/phani/EGlib-2.6.20'
make[1]: Entering directory '/home/phani/EGlib-2.6.20'
Building include/EGlib.h
Compiling src/eg_bit.c
Compiling src/eg_compare.c
Compiling src/eg_io.c
src/eg_io.c: In function ‘EGioGets’:
src/eg_io.c:618:7: warning: unused variable ‘b’ [-Wunused-variable]
char*b = buf;
^
src/eg_io.c: In function ‘EGioEof’:
src/eg_io.c:648:6: warning: unused variable ‘err’ [-Wunused-variable]
int err;
^
src/eg_io.c: In function ‘EGmvar’:
src/eg_io.c:42:2: warning: second parameter of ‘va_start’ not last named argument [-Wvarargs]
va_start (largs, nind);
^
Compiling src/eg_lpnum.c
Compiling src/eg_net.c
Compiling src/eg_random.c
Compiling src/eg_macros.c
Compiling src/eg_ehash.c
Compiling src/eg_perm_it.c
Compiling src/eg_symtab.c
Compiling src/eg_keytab.c
Compiling src/eg_simula.c
In file included from src/eg_simula.c:25:0:
src/eg_simula.h:227:2: error: unknown type name ‘dbl_EGeHeapCn_t’
dbl_EGeHeapCn_t heap_cn;/**< connector in the heap containing the agent */
^
src/eg_simula.h:240:2: error: unknown type name ‘dbl_EGeHeap_t’
dbl_EGeHeap_t hp; /**< Heap containing events to be processed */
^
src/eg_simula.c: In function ‘EGsimExp’:
src/eg_simula.c:29:30: warning: unused parameter ‘t’ [-Wunused-parameter]
double EGsimExp(const double t, void*const data)
^
src/eg_simula.c: In function ‘EGsimUniform’:
src/eg_simula.c:40:34: warning: unused parameter ‘t’ [-Wunused-parameter]
double EGsimUniform(const double t, void*const data)
^
src/eg_simula.c: In function ‘EGsimNormal’:
src/eg_simula.c:51:33: warning: unused parameter ‘t’ [-Wunused-parameter]
double EGsimNormal(const double t, void*const data)
^
In file included from src/eg_simula.c:25:0:
src/eg_simula.c: In function ‘EGsimNewEvent’:
src/eg_simula.h:277:2: warning: implicit declaration of function ‘dbl_EGeHeapCnInit’ [-Wimplicit-function-declaration]
dbl_EGeHeapCnInit(&(__EGsimA->heap_cn));\
^
src/eg_simula.c:73:2: note: in expansion of macro ‘EGsimSetAgent’
EGsimSetAgent(la,sim->cur_time + gen->gen(sim->cur_time,gen->data));
^
src/eg_simula.c:74:13: error: request for member ‘val’ in something not a structure or union
la->heap_cn.val = la->last_time;
^
src/eg_simula.c:77:12: error: request for member ‘sz’ in something not a structure or union
if(sim->hp.sz == sim->hp.max_sz)
^
src/eg_simula.c:77:26: error: request for member ‘max_sz’ in something not a structure or union
if(sim->hp.sz == sim->hp.max_sz)
^
src/eg_simula.c:78:3: warning: implicit declaration of function ‘dbl_EGeHeapResize’ [-Wimplicit-function-declaration]
dbl_EGeHeapResize(&(sim->hp),sim->hp.sz*2);
^
src/eg_simula.c:78:39: error: request for member ‘sz’ in something not a structure or union
dbl_EGeHeapResize(&(sim->hp),sim->hp.sz*2);
^
src/eg_simula.c:80:9: warning: implicit declaration of function ‘dbl_EGeHeapAdd’ [-Wimplicit-function-declaration]
rval = dbl_EGeHeapAdd(&(sim->hp),&(la->heap_cn));
^
In file included from src/eg_simula.h:47:0,
from src/eg_simula.c:25:
src/eg_simula.c:85:55: error: request for member ‘val’ in something not a structure or union
MESSAGE(EG_SIM_VERBOSE,"new Agent at %lf",la->heap_cn.val);
^
src/eg_macros.h:246:18: note: in definition of macro ‘MESSAGE’
fprintf(stderr,__VA_ARGS__);\
^
In file included from src/eg_simula.h:47:0,
from src/eg_simula.c:25:
src/eg_simula.c: In function ‘EGsim’:
src/eg_simula.c:284:22: warning: implicit declaration of function ‘dbl_EGeHeapGetMin’ [-Wimplicit-function-declaration]
ca = EGcontainerOf(dbl_EGeHeapGetMin(&(sim->hp)), EGsimAgent_t,heap_cn);
^
src/eg_macros.h:134:56: note: in definition of macro ‘EGcontainerOf’
typeof(((__type *)0)->__member) *const __EGcOf_ptr = (__ptr);\
^
src/eg_macros.h:134:55: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
typeof(((__type *)0)->__member) *const __EGcOf_ptr = (__ptr);\
^
src/eg_simula.c:284:8: note: in expansion of macro ‘EGcontainerOf’
ca = EGcontainerOf(dbl_EGeHeapGetMin(&(sim->hp)), EGsimAgent_t,heap_cn);
^
src/eg_simula.c:285:30: error: request for member ‘val’ in something not a structure or union
sim->cur_time = ca->heap_cn.val;
^
src/eg_simula.c:327:17: error: request for member ‘val’ in something not a structure or union
na->heap_cn.val = sim->cur_time + cn->gen(sim->cur_time,cn->data);
^
src/eg_simula.c:328:6: warning: implicit declaration of function ‘dbl_EGeHeapSiftUp’ [-Wimplicit-function-declaration]
dbl_EGeHeapSiftUp(&(sim->hp),&(na->heap_cn));
^
src/eg_simula.c:365:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = sim->cur_time;
^
src/eg_simula.c:371:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = sim->cur_time + nn->gen(sim->cur_time,nn->data);
^
src/eg_simula.c:377:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = DBL_MAX;
^
src/eg_simula.c:381:12: warning: implicit declaration of function ‘dbl_EGeHeapSiftDown’ [-Wimplicit-function-declaration]
rval = dbl_EGeHeapSiftDown(&(sim->hp),&(ca->heap_cn));
^
src/eg_simula.c:388:5: warning: implicit declaration of function ‘dbl_EGeHeapDel’ [-Wimplicit-function-declaration]
dbl_EGeHeapDel(&(sim->hp),&(ca->heap_cn));
^
src/eg_simula.c:429:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = sim->cur_time;
^
src/eg_simula.c:433:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = sim->cur_time + nn->gen(sim->cur_time,nn->data);
^
src/eg_simula.c:441:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = DBL_MAX;
^
Makefile.library:38: recipe for target 'obj/eg_simula.o' failed
make[1]: *** [obj/eg_simula.o] Error 1
make[1]: Leaving directory '/home/phani/EGlib-2.6.20'
Makefile:23: recipe for target 'library' failed
make: *** [library] Error 2
After some searching, I have noticed that dbl_EGeHeap_t is not defined in the source code, and that seems to be throwing errors.
On searching online, it seems to be the case that it was defined in EGlib 2.6.15 (https://conexo.dii.uchile.cl/SVN/EGlib/EGlib2/tags/EGlib-2.6.15/TEmplate/dbl_eg_eheap.h), but the corresponding file in 2.6.20 does not have the definition.
Has anybody else experienced this? I badly need a solution to this.

Building Python from source as a framework on Mac OS X Mountain Lion: error in headers

I was building Python (3.4 dev version) from source as a framework on OS X 10.8. I'm a relative newbie to Mac OS X internals and couldn't figure out why the OS X framework headers caused these errors. Can someone please give me some pointers?
I use the latest version of GNU gcc on my mac instead of the Apple supplied LLVM compiler. Perhaps, that's causing a compatibility problem.
gcc -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -o FileSettings.o -c ./FileSettings.m
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:123:0,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:69:24: error: expected identifier or ‘(’ before ‘^’ token
#property (copy) void (^terminationHandler)(NSTask *) NS_AVAILABLE(10_7, NA);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:72:1: error: expected identifier before ‘end’
#end
^
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:159:0,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:36:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserScriptTaskCompletionHandler)(NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:37:1: error: unknown type name ‘NSUserScriptTaskCompletionHandler’
- (void)executeWithCompletionHandler:(NSUserScriptTaskCompletionHandler)handler;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:53:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserUnixTaskCompletionHandler)(NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:54:1: error: unknown type name ‘NSUserUnixTaskCompletionHandler’
- (void)executeWithArguments:(NSArray *)arguments completionHandler:(NSUserUnixTaskCompletionHandler)handler;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:68:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserAppleScriptTaskCompletionHandler)(NSAppleEventDescriptor *result, NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:69:1: error: unknown type name ‘NSUserAppleScriptTaskCompletionHandler’
- (void)executeWithAppleEvent:(NSAppleEventDescriptor *)event completionHandler:(NSUserAppleScriptTaskCompletionHandler)handler;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:86:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserAutomatorTaskCompletionHandler)(id result, NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:87:1: error: unknown type name ‘NSUserAutomatorTaskCompletionHandler’
- (void)executeWithInput:(id <NSSecureCoding>)input completionHandler:(NSUserAutomatorTaskCompletionHandler)handler;
^
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:160:0,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:46:11: error: expected identifier or ‘(’ before ‘^’ token
void (^_interruptionHandler)();
^
make[2]: *** [FileSettings.o] Error 1
make[1]: *** [install_PythonLauncher] Error 2
make: *** [frameworkinstallapps] Error 2
The errors correspond precisely to the 'block' extension Apple developed for C, C++ and Objective-C languages. GCC (the GNU version) doesn't recognize the block occurences and complains.

Error with new gcc48 on macos

I'm having serious problems running some standard commands such as sleep() with g++-mp-4.8 downloaded from macports. I don't have any of these problems compiling with llvm-g++-4.2.
This is quite annoying, because I'm trying to use C++11 features in this program.
Here is the read out from the compiler - I'm really sorry it's so long, I just have no idea what to do with it:
17:11:54 **** Incremental Build of configuration Debug for project BSDESimV2 ****
make all
Building file: ../TrueSolutions/TrueSoln.cpp
Invoking: GCC C++ Compiler
/opt/local/bin/g++ -g -O0 -Wall -I/opt/local/include -I/usr/include -I/usr/llvm-gcc-4.2 /lib/gcc/i686-apple-darwin11/4.2.1/include -I/Applications/Xcode.app/Contents/Developer/usr/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include -I/usr/include/c++/4.2.1 -I/usr/include/c++/4.2.1/backup -I/opt/local/bin -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"TrueSolutions/TrueSoln.d" -MT"TrueSolutions/TrueSoln.d" -o "TrueSolutions/TrueSoln.o" "../TrueSolutions/TrueSoln.cpp"
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:72:0,
from /usr/include/c++/4.2.1/bits/char_traits.h:46,
from /usr/include/c++/4.2.1/ios:45,
from /usr/include/c++/4.2.1/istream:44,
from /usr/include/c++/4.2.1/fstream:45,
from ../TrueSolutions/TrueSoln.h:15,
from ../TrueSolutions/TrueSoln.cpp:8:
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:381:12: error: expected identifier before '__is_pod'
struct __is_pod
^
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:381:12: error: expected unqualified-id before '__is_pod'
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:394:12: error: expected identifier before '__is_empty'
struct __is_empty
^
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:394:12: error: expected unqualified-id before '__is_empty'
In file included from /usr/include/c++/4.2.1/memory:54:0,
from /usr/include/c++/4.2.1/string:48,
from /usr/include/c++/4.2.1/bits/locale_classes.h:47,
from /usr/include/c++/4.2.1/bits/ios_base.h:47,
from /usr/include/c++/4.2.1/ios:48,
from /usr/include/c++/4.2.1/istream:44,
from /usr/include/c++/4.2.1/fstream:45,
from ../TrueSolutions/TrueSoln.h:15,
from ../TrueSolutions/TrueSoln.cpp:8:
/usr/include/c++/4.2.1/bits/allocator.h:135:41: error: expected unqualified-id before '__is_empty'
template<typename _Alloc, bool = std::__is_empty<_Alloc>::__value>
^
/usr/include/c++/4.2.1/bits/allocator.h:135:41: error: expected '>' before '__is_empty'
In file included from /usr/include/c++/4.2.1/vector:70:0,
from ../TrueSolutions/TrueSoln.h:23,
from ../TrueSolutions/TrueSoln.cpp:8:
/usr/include/c++/4.2.1/bits/stl_vector.h: In member function 'void std::vector<_Tp, _Alloc>::swap(std::vector<_Tp, _Alloc>&)':
/usr/include/c++/4.2.1/bits/stl_vector.h:740:34: error: template argument 2 is invalid
std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
^
/usr/include/c++/4.2.1/bits/stl_vector.h:740:45: error: invalid type in declaration before '(' token
std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
^
/usr/include/c++/4.2.1/bits/stl_vector.h:741:36: error: expression list treated as compound expression in initializer [-fpermissive]
__x._M_get_Tp_allocator());
^
In file included from /usr/include/c++/4.2.1/vector:71:0,
from ../TrueSolutions/TrueSoln.h:23,
from ../TrueSolutions/TrueSoln.cpp:8:
/usr/include/c++/4.2.1/bits/stl_bvector.h: In member function 'void std::vector<bool, _Alloc>::swap(std::vector<bool, _Alloc>&)':
/usr/include/c++/4.2.1/bits/stl_bvector.h:690:56: error: template argument 2 is invalid
std::__alloc_swap<typename _Base::_Bit_alloc_type>::
^
/usr/include/c++/4.2.1/bits/stl_bvector.h:691:10: error: invalid type in declaration before '(' token
_S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
^
/usr/include/c++/4.2.1/bits/stl_bvector.h:691:61: error: expression list treated as compound expression in initializer [-fpermissive]
_S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
^
make: *** [TrueSolutions/TrueSoln.o] Error 1
As suggested in the hints, I got rid of all the outdated -I/'s and set up the clang++ compiler as in Eclipse, Macos 10.8 and C++11
There were some clashes with between my code and the stl, but they were easy to hunt down from the console output.

gcc compile error for gnu readline() to read from stdin

HI, guys,
I write a small program, named "ioprogram.c", with gnu readline library, refering various documentation on the Internet. however, gcc reports the following errors. what is my problem?
#include <readline/readline.h>
#include <stdio.h>
int main()
{
char* c = readline("");
int len = strlen(c);
for(int i=0; i<len; i++)
{
printf("%c", *(c+i));
fflush(stdout);
}
free(c);
}
gcc errors:
In file included from /usr/include/readline/readline.h:37,
from ioprogram.c:1:
/usr/include/readline/rltypedefs.h:65: error: expected ‘)’ before ‘*’ token
In file included from ioprogram.c:1:
/usr/include/readline/readline.h:416: error: expected ‘)’ before ‘*’ token
/usr/include/readline/readline.h:532: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/readline/readline.h:533: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/readline/readline.h:555: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/readline/readline.h:823: error: expected specifier-qualifier-list before ‘FILE’
ioprogram.c: In function ‘main’:
ioprogram.c:7: error: ‘for’ loop initial declaration used outside C99 mode
Thanks in advance for any comments.
try compiling with
gcc ioprogram.c -o ioprogram -lreadline -lncurses

Resources