This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Compilation Errors


Compilation Errors

Postby nAme » Oct 2, 2001 @ 10:34am

hello,<br>while reading and experementing with phantoms tutorials i've ran into trouble compiling the code [using eVc], i get mostly casting errors such as "error C2440: 'initializing' : cannot convert from 'unsigned short' to 'unsigned short *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast", "error C2296: '>>' : illegal, left operand has type 'unsigned short *'" or "error C2110: cannot add two pointers"<br>what is wrong?
nAme
 


Re: Compilation Errors

Postby Phantom » Oct 2, 2001 @ 10:37am

Wich tutorial are you referring to?
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: Compilation Errors

Postby Phantom » Oct 2, 2001 @ 10:38am

Oh and register. :) This is a cool place with cool people, so you might want to come back some day. :)
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: Compilation Errors

Postby nAme » Oct 2, 2001 @ 10:47am

actually i do come back every day for awhile now, took me some time to find this website/forum which i think is a great source of information, i'll take the chance now also to thank you for your major contribution :)<br><br>the tutorial i reffer to is number two, the tga reading function and Image mixing...
nAme
 


Re: Compilation Errors

Postby Phantom » Oct 2, 2001 @ 10:57am

Name :),<br><br>There is an error in that tutorial, indeed. In the last block of code, wich reads<br><br>unsigned short* p1 = *(buffer + x + y * 320); <br>unsigned short* p2 = *(buffer + x + (319 - y) * 320); <br><br>you should remove the '*' after 'short' on both lines. We are not creating pointers to the pixels, but we are storing the pixels themselves in two variables named p1 and p2.<br><br>If you get any other errors, please let me know. Also, be aware that this source is intended to be used in EVC; I don't think Visual C will like the 'unsigned short' strings.<br><br>- Jacco.
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: Compilation Errors

Postby Hezi » Oct 2, 2001 @ 11:10am

Registered ;)<br><br>the source compiled successfuly :)
Hezi
pm Member
 
Posts: 15
Joined: Oct 2, 2001 @ 11:10am


Re: Compilation Errors

Postby Hezi » Oct 2, 2001 @ 11:29am

Ouch :\<br>got a 'Fatal Application Error' when trying to run it on ppc with following information:<br>'Exception: 0xc000005, Address: 0013022WierdSquare'<br>
Hezi
pm Member
 
Posts: 15
Joined: Oct 2, 2001 @ 11:10am


Re: Compilation Errors

Postby Phantom » Oct 2, 2001 @ 11:53am

Aw, there's another error in the text. Everywhere you see '* 320', this should read '* 240', since the display is 240 pixels wide. After these modifications, it should work. I will upload the fixed tutorial tomorrow.<br>BTW, I believe this is the only tutorial that I did code for that I didn't test. :) All other tutorials *should* have code that I cut/pasted from actually working demos.<br>Sorry for the inconvenience.
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: Compilation Errors

Postby Hezi » Oct 2, 2001 @ 12:13pm

program compiled and ran, but all it did is blackout the screen.<br>cant escape it too so i'll have to wait until machine shutsdown [soft reset only loads last operation in range of 5minutes]<br><br>might it have something to do with getting the warnning:<br>warning C4129: 'i' : unrecognized character escape sequence<br>for the line of code:<br>loadtga( _T(".\image.tga"), 240, 320, buffer );<br>meanning it couldnt open the file and thus just displays null?<br>i'll try and add error handling to file and image type after my ppc loads ok.<br>by the way i also got the following warnning:<br>warning C4244: '=' : conversion from 'long' to 'unsigned short', possible loss of data<br><br>
Hezi
pm Member
 
Posts: 15
Joined: Oct 2, 2001 @ 11:10am


Re: Compilation Errors

Postby Phantom » Oct 2, 2001 @ 12:18pm

Ehm yes, that should be .\\image, if that's where the image is located. Otherwise it thinks 'i' is a special character, just like \n. Why didn't anyone spot these errors before? :) Does anyone actually take the time to try this stuff?! ;)
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: Compilation Errors

Postby Hezi » Oct 2, 2001 @ 1:02pm

still blackouts :(<br>correct me if i'm wrong but if the functino is defined:<br>void loadtga( unsigned short* file, int w, int h, PIXEL* dest ) <br>shouldnt the width and hieght be oposite to what's writen here:<br>loadtga( L"\\My documents\\image.tga", 240, 320, buffer ); ?<br>
Hezi
pm Member
 
Posts: 15
Joined: Oct 2, 2001 @ 11:10am


Re: Compilation Errors

Postby Hezi » Oct 2, 2001 @ 1:09pm

ack sorry my mistake :)<br>old habbit from PC coding where the width is larger then the hieght in oposite to ppc.<br><br>anyhow found the problem, apperently using '.\\' is invalid and instead a full path length should be specified.<br><br>
Hezi
pm Member
 
Posts: 15
Joined: Oct 2, 2001 @ 11:10am


Re: Compilation Errors

Postby Dan East » Oct 2, 2001 @ 1:41pm

Right, Windows CE does not have a "current working directory", so relative paths are not supported. The closest you can get is to extract the path of the module's file name (the current running executable) and use it as the base dir for data files, etc. At least with that technique the end user can install the program wherever they like.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: Compilation Errors

Postby Dan East » Oct 2, 2001 @ 1:42pm

GetModuleFileName is the exact API function to use to get the full path and filename of the running exe.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: Compilation Errors

Postby Hezi » Oct 2, 2001 @ 2:21pm

cool thanks!<br><br>by the way when trying to move the update() function out of the loop [of twicking the image] in-order to make it load faster the application breaks with fatal error, what's the reason? <br>
Hezi
pm Member
 
Posts: 15
Joined: Oct 2, 2001 @ 11:10am


Next

Return to Phantom's Forum


Sort


Forum Description

Discuss any of Phantom's projects here (Operation Nutcracker, etc.)

Moderators:

sponge, RICoder, Phantom

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron