Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,121 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,762 people online right now. Registration is fast and FREE... Join Now!




Won't Run, No Compile Errors

 
Reply to this topicStart new topic

Won't Run, No Compile Errors, Runs on my machine, not on ones w/out .NET Framework

Squirrel
17 Apr, 2007 - 10:47 PM
Post #1

D.I.C Head
**

Joined: 6 Feb, 2007
Posts: 61


My Contributions
Hey guys I got an interesting one for you. I made this windows form, and although it runs pretty will on my computer, it refuses to run on any w/out .NET 2.0 Framework. My question is, what may be causing this? I have had library selection trouble in the past, but none of those seem to help. Heres the header:

#pragma once
#include<iomanip>
#include<time.h>

namespace Program {

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

This was compiled using Visual Studio, don't know much about what the #'s are besides the ones I put in. (Im a CSE 100 student and all we are doing is DOS stuff). OK, so thats where we stand. I am using /MD for the runtime library and /clr:pure as the other thingy. I tried /MT like in the DOS ones we had to make, but that made me change the clr, and that made my program not compile. Any ideas?
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Won't Run, No Compile Errors
17 Apr, 2007 - 10:57 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,926



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
Since you wrote your application using Microsofts managed C++, so it will require the .NET Framework in order to run on any computer.

One of the drawbacks to using .NET is that you must have the Framework installed on any computer that you want to run your application on.
User is online!Profile CardPM
+Quote Post

Squirrel
RE: Won't Run, No Compile Errors
17 Apr, 2007 - 11:01 PM
Post #3

D.I.C Head
**

Joined: 6 Feb, 2007
Posts: 61


My Contributions
Ok, so any suggestions for a recompile/fix/conversion/etc?

This post has been edited by Squirrel: 17 Apr, 2007 - 11:05 PM
User is offlineProfile CardPM
+Quote Post

dizzywiggle
RE: Won't Run, No Compile Errors
18 Apr, 2007 - 05:43 AM
Post #4

New D.I.C Head
*

Joined: 13 Apr, 2007
Posts: 9


My Contributions
One suggestion is to not use any of the .NET stuff (such as all the stuff in the System namespace).
User is offlineProfile CardPM
+Quote Post

Squirrel
RE: Won't Run, No Compile Errors
18 Apr, 2007 - 06:52 AM
Post #5

D.I.C Head
**

Joined: 6 Feb, 2007
Posts: 61


My Contributions
what other namespace would I use then?
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Won't Run, No Compile Errors
18 Apr, 2007 - 08:42 AM
Post #6

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
You'd have to use the standard C++ equivalents, or ensure that each client machine will have the framework.
User is offlineProfile CardPM
+Quote Post

Squirrel
RE: Won't Run, No Compile Errors
18 Apr, 2007 - 08:49 AM
Post #7

D.I.C Head
**

Joined: 6 Feb, 2007
Posts: 61


My Contributions
Anywhere that would have the information on the equivalencies? using namepace std doesnt work, it says no std namespace exists (and we usually use std in class). This is getting into some things that I have no knowledge about, so any help would be greatly apprecieved. Assuming there is another namespace for String^, woudl the standard one require me to re-code the whole thing?
User is offlineProfile CardPM
+Quote Post

Squirrel
RE: Won't Run, No Compile Errors
18 Apr, 2007 - 08:55 AM
Post #8

D.I.C Head
**

Joined: 6 Feb, 2007
Posts: 61


My Contributions
QUOTE(Squirrel @ 18 Apr, 2007 - 09:49 AM) *

Anywhere that would have the information on the equivalencies? I would assume its using namespace std, but then i wouldnt know what to do with things like

private: System::Windows::Forms::RadioButton^ radioButton1;
protected:
private: System::Windows::Forms::RadioButton^ radioButton2;
private: System::Windows::Forms::RadioButton^ radioButton3;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::PictureBox^ pictureBox1;
private: System::Windows::Forms::TextBox^ textBox1;

ANy suggestions?


User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Won't Run, No Compile Errors
18 Apr, 2007 - 09:05 AM
Post #9

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
Not all methods or objects available in managed C++ will be available in standard C++ (although you can make equivalents). the standard C++ string opbject is located in the string header:
CODE

#include<string>

Keep in mind that the standard C++ string object is not the same as the managed C++ string object.
User is offlineProfile CardPM
+Quote Post

Squirrel
RE: Won't Run, No Compile Errors
18 Apr, 2007 - 09:24 AM
Post #10

D.I.C Head
**

Joined: 6 Feb, 2007
Posts: 61


My Contributions
Lol, this simple side project is becoming a monster. Ok lets try a different approach... anyway to compress the .NET files with it to maybe make it work? Or possibly install a downgraded .NET using the .exe I created?

Or, is there a website that maps out the std and System:: namespaces and that could possibly help?

This post has been edited by Squirrel: 18 Apr, 2007 - 04:13 PM
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 10:07PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month