Hi everybody,
I have a sort of strange problem, I need to search for a special file
(perl.exe) in run time and searching the help I have found out
CFileFind but it needs afx.h to be included. The problem is when I
include afx.h some other parts of my program which were being built and
working properly seem impossible to be built. an example is
Directory::GetCurrentDirectory(). I had a similar problem with
including windows.h. again some formerly proper statements seemed to
turned out to unproper ones after including windows.h and
Directory::GetCurrentDirectory() was one of them. The error message in
both cases are the same and seem even stranger to me. It is :" error
C2039: 'GetCurrentDirectoryA' : is not a member of
'System::IO::Directory' " I don't have any GetCurrentDirectoryA. what
the problem could be?

Re: some headers seems to conflict the others by John

John
Sat Sep 23 01:12:50 CDT 2006

"golnar" <golnar_19@yahoo.com> wrote in message
news:1158990137.944410.175200@m73g2000cwd.googlegroups.com
> Hi everybody,
> I have a sort of strange problem, I need to search for a special file
> (perl.exe) in run time and searching the help I have found out
> CFileFind but it needs afx.h to be included. The problem is when I
> include afx.h some other parts of my program which were being built
> and working properly seem impossible to be built. an example is
> Directory::GetCurrentDirectory(). I had a similar problem with
> including windows.h. again some formerly proper statements seemed to
> turned out to unproper ones after including windows.h and
> Directory::GetCurrentDirectory() was one of them. The error message in
> both cases are the same and seem even stranger to me. It is :" error
> C2039: 'GetCurrentDirectoryA' : is not a member of
> 'System::IO::Directory' " I don't have any GetCurrentDirectoryA. what
> the problem could be?


This has been explained to you twice already, once by Norman Bullen and once
by me. Explaining it a third time doesn't seem likely to succeed given that
the two previous attempts apparently failed. Perhaps if you told us what you
don't understand about those two previous explanations, then some progress
may be possible.

--
John Carson



Re: some headers seems to conflict the others by golnar

golnar
Sat Sep 23 02:45:50 CDT 2006

about what Fred said currentpath is a String * so the syntax is ok and
about what you said I understood why I am receiving something about
GetCurrentDirectoryA but even by trying #undef GetCurrentDirectory I
couldn't solve the problem. after inserting #undef GetCurrentDirectory
I got the link errors:"error LNK2005: "void * __cdecl operator
new(unsigned int)" (??2@YAPAXI@Z) already defined in
libcpmtd.lib(newop.obj)
" and "error LNK2005: "void __cdecl operator delete(void *)"
(??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)".

John Carson wrote:
> "golnar" <golnar_19@yahoo.com> wrote in message
> news:1158990137.944410.175200@m73g2000cwd.googlegroups.com
> > Hi everybody,
> > I have a sort of strange problem, I need to search for a special file
> > (perl.exe) in run time and searching the help I have found out
> > CFileFind but it needs afx.h to be included. The problem is when I
> > include afx.h some other parts of my program which were being built
> > and working properly seem impossible to be built. an example is
> > Directory::GetCurrentDirectory(). I had a similar problem with
> > including windows.h. again some formerly proper statements seemed to
> > turned out to unproper ones after including windows.h and
> > Directory::GetCurrentDirectory() was one of them. The error message in
> > both cases are the same and seem even stranger to me. It is :" error
> > C2039: 'GetCurrentDirectoryA' : is not a member of
> > 'System::IO::Directory' " I don't have any GetCurrentDirectoryA. what
> > the problem could be?
>
>
> This has been explained to you twice already, once by Norman Bullen and once
> by me. Explaining it a third time doesn't seem likely to succeed given that
> the two previous attempts apparently failed. Perhaps if you told us what you
> don't understand about those two previous explanations, then some progress
> may be possible.
>
> --
> John Carson


Re: some headers seems to conflict the others by John

John
Sat Sep 23 04:03:10 CDT 2006

"golnar" <golnar_19@yahoo.com> wrote in message
news:1158997549.936970.120720@b28g2000cwb.googlegroups.com
> about what Fred said currentpath is a String * so the syntax is ok and
> about what you said I understood why I am receiving something about
> GetCurrentDirectoryA but even by trying #undef GetCurrentDirectory I
> couldn't solve the problem. after inserting #undef GetCurrentDirectory
> I got the link errors:"error LNK2005: "void * __cdecl operator
> new(unsigned int)" (??2@YAPAXI@Z) already defined in
> libcpmtd.lib(newop.obj)
> " and "error LNK2005: "void __cdecl operator delete(void *)"
> (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)".


In other words,

#undef GetCurrentDirectory

solved the problem, but you had another unrelated problem. That is progress.
You got to the link stage, which means your compilation was successful ---
which it wasn't before.

The error message is saying that new and delete have been defined twice. You
are only allowed to define any operator or function once. If you haven't
defined new and delete yourself, then this probably means that you have
linked to two different libraries, each of which uses a different definition
of new and delete.

--
John Carson



Re: some headers seems to conflict the others by golnar

golnar
Sat Sep 23 04:59:08 CDT 2006

Though I agree that it's most probably another problem but I insist it
is a result of these includings and compiler commands. And though this
is progress comparing to the previous stage, it is not comparing to
time the program was working. anyway, the problem is unsolved because I
don't know how to solve this new problem. Of course all these doesn't
lessen the value of your explanation, advice and concern.

Regards


John Carson wrote:
> "golnar" <golnar_19@yahoo.com> wrote in message
> news:1158997549.936970.120720@b28g2000cwb.googlegroups.com
> > about what Fred said currentpath is a String * so the syntax is ok and
> > about what you said I understood why I am receiving something about
> > GetCurrentDirectoryA but even by trying #undef GetCurrentDirectory I
> > couldn't solve the problem. after inserting #undef GetCurrentDirectory
> > I got the link errors:"error LNK2005: "void * __cdecl operator
> > new(unsigned int)" (??2@YAPAXI@Z) already defined in
> > libcpmtd.lib(newop.obj)
> > " and "error LNK2005: "void __cdecl operator delete(void *)"
> > (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)".
>
>
> In other words,
>
> #undef GetCurrentDirectory
>
> solved the problem, but you had another unrelated problem. That is progress.
> You got to the link stage, which means your compilation was successful ---
> which it wasn't before.
>
> The error message is saying that new and delete have been defined twice. You
> are only allowed to define any operator or function once. If you haven't
> defined new and delete yourself, then this probably means that you have
> linked to two different libraries, each of which uses a different definition
> of new and delete.
>
> --
> John Carson


Re: some headers seems to conflict the others by Alexander

Alexander
Sat Sep 23 08:16:03 CDT 2006

This happens if some of your files are compiled with MFC, and some without.

"golnar" <golnar_19@yahoo.com> wrote in message
news:1159005548.483139.63100@h48g2000cwc.googlegroups.com...
> Though I agree that it's most probably another problem but I insist it
> is a result of these includings and compiler commands. And though this
> is progress comparing to the previous stage, it is not comparing to
> time the program was working. anyway, the problem is unsolved because I
> don't know how to solve this new problem. Of course all these doesn't
> lessen the value of your explanation, advice and concern.
>
> Regards
>
>
> John Carson wrote:
>> "golnar" <golnar_19@yahoo.com> wrote in message
>> news:1158997549.936970.120720@b28g2000cwb.googlegroups.com
>> > about what Fred said currentpath is a String * so the syntax is ok and
>> > about what you said I understood why I am receiving something about
>> > GetCurrentDirectoryA but even by trying #undef GetCurrentDirectory I
>> > couldn't solve the problem. after inserting #undef GetCurrentDirectory
>> > I got the link errors:"error LNK2005: "void * __cdecl operator
>> > new(unsigned int)" (??2@YAPAXI@Z) already defined in
>> > libcpmtd.lib(newop.obj)
>> > " and "error LNK2005: "void __cdecl operator delete(void *)"
>> > (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)".
>>
>>
>> In other words,
>>
>> #undef GetCurrentDirectory
>>
>> solved the problem, but you had another unrelated problem. That is
>> progress.
>> You got to the link stage, which means your compilation was
>> successful ---
>> which it wasn't before.
>>
>> The error message is saying that new and delete have been defined twice.
>> You
>> are only allowed to define any operator or function once. If you haven't
>> defined new and delete yourself, then this probably means that you have
>> linked to two different libraries, each of which uses a different
>> definition
>> of new and delete.
>>
>> --
>> John Carson
>