Error Messages about System/Namespace. Need help.

Aug 2, 2016 at 2:59pm
I'm trying to make a program that generates a output file, but within my code, it keeps sending me these errors. I keep getting these erros

Error 1 error C2871: 'System' : a namespace with this name does not exist

I have 6 files and below is the code that is in them that is causing these error codes(it keeps highlighting each system line). I've included the fstream, manip and iostream as well as the string:

using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;

using namespace std;
using namespace System;
using namespace System::IO;
using namespace System::Windows::Forms;
using namespace System::Runtime::InteropServices;
Aug 2, 2016 at 3:04pm
The namespaces you are trying to use do not exist. Why are you trying to use them? You may want to post more of your code.
Aug 2, 2016 at 3:09pm
I've tried to post my code but the website says its too long
Last edited on Aug 2, 2016 at 3:10pm
Aug 2, 2016 at 3:19pm
> I've tried to post my code but the website says its too long

Try pastebin or textuploader
Aug 2, 2016 at 3:23pm
Form 1.h(not sure if I'm doing this right)

<script src="//pastebin.com/embed_js/EWZzzq0N"></script>

Mantis.h

<script src="//pastebin.com/embed_js/JY7uWRCc"></script>

Resource.h

<script src="//pastebin.com/embed_js/t9Juf7x8"></script>

Stdafx.h
<script src="//pastebin.com/embed_js/AV4wvXPk"></script>

CPP

Assembly Code.cpp
<script src="//pastebin.com/embed_js/7RJi0AEy"></script>

Program3.cpp
<script src="//pastebin.com/embed_js/Bdx7wdyH"></script>

Mantis.cpp
<script src="//pastebin.com/embed_js/ew7uLEua"></script>

Stdafx.cpp
<script src="//pastebin.com/embed_js/ZukBvKPa"></script>


I also have a input text file.






Last edited on Aug 2, 2016 at 3:31pm
Aug 2, 2016 at 3:29pm
Is it Java or C# code?
Aug 2, 2016 at 3:30pm
Try adding at the top
#using <system.dll>
What version of Visual Studio do you use ?
Aug 2, 2016 at 3:39pm
its C# and we're using Visual Studio 2012. It's a GUI Programming with C++ class.

Thomas: in which file should I put the #using <system.dil> in?
Aug 2, 2016 at 5:36pm
in which file should I put the #using <system.dil> in?


In the file where you get the error - probably program3.cpp
You also might need to add #using <mscorlib.dll>
Aug 2, 2016 at 5:48pm
Wait, hold on.
its C# and we're using Visual Studio 2012. It's a GUI Programming with C++ class.

How are you using those two languages together? Could you post a short example program you have worked on before that demonstrates the kind of code you are writing?
Aug 2, 2016 at 7:54pm
Aug 3, 2016 at 9:10pm
Hey! So I finally got my program to work after starting over. Thank you guys for the help!
Topic archived. No new replies allowed.