[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Bug report: Compile with Microsoft and Intel compiler
From: |
Jerker Bäck |
Subject: |
RE: Bug report: Compile with Microsoft and Intel compiler |
Date: |
Fri, 29 Apr 2005 17:24:03 +0200 |
I've found it!
Again about:
> -------------------------------------------
> _CRTIMP int __cdecl _chdir(const char *);
>
> int main(int argc, char *argv[])
> {
> if (argc > 1)
> _chdir(argv[1]);
> return 0;
> }
> -------------------------------------------
You need to express: extern "C"
Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#ifdef __cplusplus
extern "C" {
#endif
int _chdir(const char *); //OK if __cdecl
or
_CRTIMP int __cdecl _chdir(const char *); //OK
or
int __cdecl _chdir(const char *); //OK
#ifdef __cplusplus
}
#endif
Or simply:
extern "C" int __cdecl _chdir(const char *);
extern "C" int __cdecl chdir(const char *);
------------------------------------------
#include <stdlib.h>
#include <direct.h>
extern "C" _CRTIMP int __cdecl _chdir(const char *);
int main(int argc, char *argv[])
{
if (argc > 1)
_chdir(argv[1]);
return 0;
}
------------------------------------------
Works with any compiler settings!!
Add
#ifdef __cplusplus
extern "C" {
#endif
to make.h will maybe solve the whole thing!
Regards JB
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- RE: Bug report: Compile with Microsoft and Intel compiler,
Jerker Bäck <=