environment variable not found

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

environment variable not found

Postby roy844 » Tue May 04, 2010 3:58 pm

hi,

i am trying to build the tutorial files but i get an error that it cannot find the environment variables NEWTON_HOME so i added this variable configurationscreen -> system -> environment variables using these properties

name: NEWTON_HOME
value: C:\NewtonWin-2.20\sdk

but still the error keeps showing up while building. what am i doing wrong ?

Code: Select all
10>------ Build started: Project: Tutorial_101_GettingStarted, Configuration: Release Win32 ------
10>Performing Pre-Build Event...
10>Ongeldig aantal parameters
10>Project : error PRJ0019: A tool returned an error code from "Performing Pre-Build Event..."
10>Project : warning PRJ0018 : The following environment variables were not found:
10>$(NEWTON_HOME)
10>Build log was saved at "file://c:\Documents and Settings\Ontwikkel\Bureaublad\NewtonTutorials\Tutorial_101_GettingStarted\x32\Release\BuildLog.htm"
10>Tutorial_101_GettingStarted - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 9 skipped ==========
roy844
 
Posts: 13
Joined: Mon Mar 03, 2008 3:36 am

Re: environment variable not found

Postby Julio Jerez » Tue May 04, 2010 4:19 pm

you set the env vairvle in windows not in VS

then you quick VS and re opening it.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: environment variable not found

Postby roy844 » Tue May 04, 2010 4:45 pm

thank you for your reaction the problem decribed above has been solved and the project compiled succesfully.
however while starting the aplication it gives me the following error:
Unhandled exception at 0x00402fe1 in Tutorial_101_GettingStarted.exe: 0xC0000005: Access violation writing location 0x00000000.

does that mean that the value of the envirement variable value is incorrect ?

C:\NewtonWin-2.20\sdk
roy844
 
Posts: 13
Joined: Mon Mar 03, 2008 3:36 am

Re: environment variable not found

Postby Julio Jerez » Tue May 04, 2010 6:09 pm

If it compiled the variable was correct.
did have you run the binaries before to see if they crash?
make sure the path is right when you run from VS debugger.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: environment variable not found

Postby roy844 » Tue May 04, 2010 6:22 pm

i checked the binnaries work fine and all compiles well but as soon as i try to run i get the error,
what exactly do you mean with: "make sure the path is right when you run from VS debugger"

thank you in advance
roy844
 
Posts: 13
Joined: Mon Mar 03, 2008 3:36 am

Re: environment variable not found

Postby Julio Jerez » Tue May 04, 2010 6:46 pm

if the code is tryi to read a file and it doe nof fidn teh right path it will crash.
so you have to point the path to teh binary and the assets in debuger.

That is one of the thing that the project file do not store, so the end user have to set it on thier side.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: environment variable not found

Postby roy844 » Tue May 04, 2010 6:59 pm

what files like images 3dmodels etc ?
and where do i point the path in the debugger ? using visual c++ 2008
roy844
 
Posts: 13
Joined: Mon Mar 03, 2008 3:36 am

Re: environment variable not found

Postby Julio Jerez » Tue May 04, 2010 7:45 pm

roy844 wrote:what files like images 3dmodels etc ?

yes, but i think they are in the executable folder.
just make sure every thing is in the same forder.
The demos have a post build rule that copy the exe file to where the assets folder.

in VS debugget I thopnk it is

project properties->Debugging->Working Directoty : the you type the path there
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: environment variable not found

Postby Shubho » Wed May 19, 2010 10:34 am

Hi,
I am getting the same problem. I've set the environment variable to the sdk directory, but I'm getting the same run-time exception error. Could you explain what I need to do to get it running properly? I've tried setting the debugging working directory, to no effect. Thanks in advance.
Shubho
 
Posts: 4
Joined: Wed May 19, 2010 10:29 am

Re: environment variable not found

Postby Julio Jerez » Wed May 19, 2010 10:58 am

did it compiled?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: environment variable not found

Postby Shubho » Wed May 19, 2010 11:02 am

yeah it compiled. But it's having the same run time error
Shubho
 
Posts: 4
Joined: Wed May 19, 2010 10:29 am

Re: environment variable not found

Postby Julio Jerez » Wed May 19, 2010 11:36 am

The exe, and the DLLs should be in the folder
...->bin->x32

is that what you are having?


what does the error say?
can you step in debug mode and see in what line is crashing?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: environment variable not found

Postby Shubho » Wed May 19, 2010 2:13 pm

I've set the working directory in debug to .../bin/x32 but still the error is persistent.
I've also kept the dlls and the binary file in that folder.

The error message is:
Unhandled exception at 0x00402fe1 in Tutorial_101_GettingStarted.exe: 0xC0000005: Access violation writing location 0x00000000.

The Error is occuring at the Break Point (in the file OpenGlUtil.cpp):

void GetWorkingFileName (const char* name, char* outPathName)
{
char path[256];
GetModuleFileNameA(NULL, path, 256);

char* ptr = strstr (path, "bin");
ptr [0] = 0;---------------------------------------------------> "The Break Point"
sprintf (outPathName, "%sbin/%s", path, name);
}

I have just started with Newton Physics and I am clueless as to what ptr[0] does. I would appreciate any help. Thanks in advance.
Shubho
 
Posts: 4
Joined: Wed May 19, 2010 10:29 am

Re: environment variable not found

Postby Julio Jerez » Wed May 19, 2010 2:50 pm

you are running the demo from a forder that is no a child fordel of teh assets

Tha fu ction buidl a path to load and asset, teh path format is

bin/name

like I said the executable should be placed in teh fordel
bin/w32

make sure that si were it at,
The project file has a post build script taht does it autmatically, jsut jsu nee to mae sure teh debug path point to the bin/w32
and it shoud be fine.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: environment variable not found

Postby Shubho » Wed May 19, 2010 4:08 pm

I found a very weird solution.

I deleted the binaries from the x32 folder in bin, after that I set the output directory in General option in project properties to "NewtonTutorials/bin/x32" (I'm working in VS2008).

Then I 'Build' the solution.

The binary produced in the x32 folder now works fine. But, when I'm trying to execute the program from the compiler, I get the exception error message.

That is relieving and disturbing at the same time.

Can you shed some light on this weird phenomenon?
Shubho
 
Posts: 4
Joined: Wed May 19, 2010 10:29 am

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 7 guests

cron