• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

c++ system cannot find specified file (help pls)

Status
Not open for further replies.
Level 3
Joined
Mar 5, 2016
Messages
25
So i started to code c++ for the first time but i took this error "c++ system cannot find specified file" what can i do ? some people saying problem is my code well here it is:

// ConsoleApplication2.cpp : main project file.

#include "stdafx.h"
#include <studio.h>
#include <stdlib.h>
#include <string.h>
using namespace System;

int main(array<System::String ^> ^args)
{

struct element
{
char isim[20];
char sembol[5];
float agirlik;
float kutle;

};

struct element X;
X.agirlik = 3.0;
X.kutle = 1.0;
strcpy(X.isim, "Hidrojen");
strcpy(X.sembol"H");

prinf("Element:\n");
prinf("%s\n",X.isim);
prinf("%s\n",X.sembol);
prinf("%2f\n",X.agilirlik);
prinf("%2f\n",X.kutle);

getchar()


Console::WriteLine(L"Hello World");
return 0;
}

i did what they said but im still taking that error
 
Level 3
Joined
Mar 5, 2016
Messages
25
Do you have a code which something to do with opening a file from the filepath?

Invalid filepath can cause an error.


No the path at the error is "C:\Users\Effect\Doccuments\Visual Studio 2015\Projects\ConsoleApplication7\Debug\ConsoleApplication7.exe'." i heard i had to do something about exe


Note: when i start c++ without writing anything its working but at coding nothings working

c++ marking first "printf" at the code not the second not the third only first i tried some much thing about code but nothing working
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
What on earth is System? Did you mean std?
You are missing a comma, a semicolon, etc.

Your code isn't valid, so you don't get an executable to run. Change the tab to the one that shows errors.

Regardless - change the site with which you are learning. The code you wrote shows you are using a bad utterly outdated site, and your code will be bad.
 
Level 3
Joined
Mar 5, 2016
Messages
25
What on earth is System? Did you mean std?
You are missing a comma, a semicolon, etc.

Your code isn't valid, so you don't get an executable to run. Change the tab to the one that shows errors.

Regardless - change the site with which you are learning. The code you wrote shows you are using a bad utterly outdated site, and your code will be bad.

my teacher gaved it the code... he was using 2010

i beter try to find on websites
 
Level 19
Joined
Jul 14, 2011
Messages
875
Build(F7 for me) to see the errors, and fix them all. I think you have that 'run anyway' option ticked which tries to run the last created exe.
Also, I think your project must be a CLR project.

Also, why C++/CLI? It is more confusing than user-friendly for a begginer if you ask me.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Please attach the entire project the way you have it setup at the moment. I can try to diagnose the fault by building and running it on my own system. Chance are you have the wrong sort of project or the project is set up incorrectly.

The point in this case is not for beautiful code, but more to get it to run. He may be using such a project setup for many projects, including assessed submissions, so it is important to get it to work now.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
You are right. All the syntax errors are not obvious enough.
Cannot rule out copying errors, auto correct or other oddities. We have no guarantee what is posted above is exactly identical to what he is trying to run, although it should be if he expects reasonable help.

Still the easiest way to solve it would be to see how his project is fixed up. This way one can be certain about the syntax and the errors it is throwing.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I'm not a C++/C programmer. Is adding a struct inside main or whatsoever doesn't cause a syntax error? Came here only to ask about struct.
It should not be a problem as it becomes a type declared within the scope. You can do something similar in Java as well.

It is useful for when you need a certain type within a scope, eg for some algorithm, but do want to limit its exposure as it is given a common name or is only useful for a specific purpose.
 
Level 3
Joined
Mar 5, 2016
Messages
25
Well i beleive problem is happening from "library" of c++ i try so many test codes on internet but nothing working what can i do about if c++ doesnt working well ?
 
Status
Not open for further replies.
Top