Click to See Complete Forum and Search --> : Question about __gc and clr/OldSyntax
Programming_Elf
March 22nd, 2008, 09:57 AM
Hello, I have been working with Visual Studios C++ and I am currently trying to use __gc to create a class for a .dll I am running in C#. However, it is telling me that I need to add in clr/OldSyntax into the command-line. My problem is that I cannot find the command-line to do this. Could anyone point me in the right direction to add it in. Thanks!
Alex F
March 22nd, 2008, 12:47 PM
Project - Properties - Configuration Properties - C/C++ - General - Compile with CLR. Select /clr:OldSyntax here.
However, working with VS2005, why do you need obsolete old syntax? Change your source code to new syntax, in any case you will need to do this some time later.
Paul McKenzie
March 22nd, 2008, 01:21 PM
Hello, I have been working with Visual Studios C++ and I am currently trying to use __gc to create a class for a .dllAny followups should be posted in the Managed C++ forum, not the Visual C++ forum.
Regards,
Paul McKenzie
Programming_Elf
March 23rd, 2008, 12:34 PM
Any followups should be posted in the Managed C++ forum, not the Visual C++ forum.
Whoops, sorry about that.
I'm actually using VS2008. It's obsolete? I get this error when I use __gc:
"'__gc' : use of this keyword requires /clr:oldSyntax command line option". Should I use something other than /clr:oldSyntax or something other than __gc? If so, what other option is there?
Paul McKenzie
March 23rd, 2008, 01:05 PM
Whoops, sorry about that.
I'm actually using VS2008. It's obsolete?No. All of that __gc stuff is *not* C++, but managed C++. There is a managed C++ forum where you should be posting your questions to.
If you are not building a managed C++ program, your program should have nothing to do with "__gc", as this doesn't exist in traditional Visual C++ programs (which this forum is about). If this is the case, then you must choose a traditional, unmanaged project (Win32 GUI or console project are examples).
Regards,
Paul McKenzie
Alex F
March 23rd, 2008, 02:49 PM
Other option is using /clr switch (without OldSyntax) and normal modern C++/CLI. For example, __gc class in C++/CLI is ref class.
Ejaz
March 24th, 2008, 01:27 AM
[ Moved Thread ]
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.