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
_______________________________________________
Make-w32 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/make-w32