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

Newbie needs help with VisualC++ and EasyCE 1.6


Newbie needs help with VisualC++ and EasyCE 1.6

Postby Mr Plant » Feb 20, 2002 @ 1:15am

Hi!
I figured a good way to learn Visual C++ is with EasyCE 1.6 - then again, I'm mad! :P
I will be buying a pocket PC soon but for now just want to compile using the PC library and test it on the PC.
I have figured out how to open the workspace file and it compiles and runs (but only after I copy the two PC .dll files into the DEBUG folder).
Am I doing this part right - or am I missing something..
Next question - when I change the options in C++ to make a RELEASE build - it stops compiling - what can I do to get this to work?
Answers really appreciated as this is stopping me from USING and LEARNING easyce and visual C++

please email here or stevenmcd@hotmail.com thanks.
really appreciate any responses!
Mr Plant
 


Postby Dan East » Feb 20, 2002 @ 1:20am

What errors do you get when you try to build with the Release config?

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


More Info

Postby Mr Plant » Feb 20, 2002 @ 3:36am

Hi!

I am slowly getting my head around this!

Do I have this set up correctly?
I have a folder on my desktop called EasyCE 1.6 (as downloaded).

Ok - in debug mode - I double click the easyce.dsw file and it fires up VisualC++ with the project open.
Build - Rebuild All - works and generates a Debug folder with the easyce.exe file in it. I try to run this from the desktop but it won't run - I need to dump into the folder the files ptc.dll and hermes.dll - then it runs! success!

So far - have I got things set up ok?

It works anyway and it runs.

Next - I change the configuration to "Release mode" and click on rebuilt all again.

I get an 102 errors!
Linking...
EasyCE.obj : error LNK2001: unresolved external symbol _ptc_format_destroy@4
EasyCE.obj : error LNK2001: unresolved external symbol _ptc_surface_create@12
EasyCE.obj : error LNK2001: unresolved external symbol _ptc_console_create@0

etc. etc.

I worked out if I go into project settings - Link -
Object/Library modules and add to it "ptc.lib winmm.lib" (which I got my looking at that same line in the DEBUG version!), that it compiles a bit better!
Now I get:

Deleting intermediate files and output files for project 'easyce - Win32 Release'.
--------------------Configuration: easyce - Win32 Release--------------------
Compiling...
adler32.c
compress.c
crc32.c
deflate.c
gzio.c
infblock.c
infcodes.c
inffast.c
inflate.c
inftrees.c
infutil.c
trees.c
uncompr.c
zutil.c
EasyCE.cpp
sample.cpp
Linking...
LINK : fatal error LNK1181: cannot open input file "ptc.lib"
Error executing link.exe.

easyce.exe - 1 error(s), 0 warning(s)

What am I doing wrong here?
My other question is - how come the project file isn't already set up to "just compile" for release mode as well?
I'd learn a lot from your reply to these two questions!

Thanks.
Mr Plant
 


Postby Phantom » Feb 20, 2002 @ 9:26am

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


Almost!

Postby Mr Plant » Feb 20, 2002 @ 11:27am

Hi! I did as you said - and its went from 102 errors to just 2!
This is what I get now (under release mode).

Linking...
EasyCE.obj : error LNK2001: unresolved external symbol __imp__sndPlaySoundA@8
Release/easyce.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

easyce.exe - 2 error(s), 0 warning(s)

Any idea what I need to add to fix this?

Thanks.
Mr Plant
 


Postby Phantom » Feb 20, 2002 @ 11:46am

Ah yes, the sound stuff. Well at the same spot where you added ptc.lib, add winmm.lib and all should go well.
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


Worked! Last query!

Postby Mr Plant » Feb 20, 2002 @ 11:57am

It worked!

Linking...
LINK : warning LNK4089: all references to "GDI32.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "WINMM.dll" discarded by /OPT:REF

easyce.exe - 0 error(s), 2 warning(s)

Do I just ignore those warnings?
Mr Plant
 


Postby Phantom » Feb 20, 2002 @ 12:52pm

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


Postby Guest » Feb 20, 2002 @ 1:22pm

Sorry to take peoples time up here but one more question if I may.

I am following the tutorials and am trying to load in a TGA file and display it on screen.
As instructed, I have included this code at the correct place in my program:


#include "easyce.h"

void loadtga( unsigned short* file, int w, int h, PIXEL* dest )
{
DWORD size = w * 2 * h + 20, bytesread;
BYTE* tgabuff = new BYTE[size];
HANDLE tga = CreateFile( file, GENERIC_READ, FILE_SHARE_READ,
0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 );
ReadFile( tga, tgabuff, size, &bytesread, 0 );
CloseHandle( tga );
unsigned short* src = (unsigned short*)tgabuff + 9 + (h - 1) * w;
unsigned short* dst = (unsigned short*)dest;
for ( int i = 0; i < h; i++ )
{
for ( int x = 0; x < w; x++ )
{
int red = (*(src + x) & (31 << 10)) >> 10;
int green = (*(src + x) & (31 << 5)) >> 5;
int blue = *(src + x) & 31;
*(dst + x) = (red << 11) + (green << 6) + blue;
}
dst += w;
src -= w;
}
delete tgabuff;
}

void main()
{main code here}

Problem is - this gives this error:

C:\Documents and Settings\Steven McDonald\Desktop\EasyCE 1.6 (Custom)\Rock Crush 2002 - Project Files\RC2002.cpp(10) : error C2664: 'CreateFileA' : cannot convert parameter 1 from 'unsigned short *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.

RC2002.exe - 1 error(s), 0 warning(s)

Something to do with C versus C++ ??
Anyone know how to fix?
Thanks.
Guest
 


Postby Phantom » Feb 20, 2002 @ 2:31pm

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


Will prevent link warning from being displayed

Postby Chirper9 » Aug 25, 2003 @ 8:28pm

Chirper9
 


Postby Dan East » Aug 28, 2003 @ 12:35am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


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