Forums Gallery Downloads LOGIN |REGISTER

Common compiler errors

Please use this forum for questions on C++, Lua, XML, and any other languages used in Crysis modding.


 

User avatar
intrepidbiped
Producer
Producer
 
Posts: 1382
Member since: 22.07.2007, 13:00
Location: BC, Canada
Likes: 0

Common compiler errors

Postby intrepidbiped » 07.03.2008, 22:39

Please post your compiler errors in this and only this thread. Thanks for your cooperation :)

-jameszhao00


Common Problems:
  1. Cannot find afxres.h
    Open GameDll.rc and replace afxres.h with windows.h
    Code: Select all
    //#include "afxres.h" //comment out afxres.h
    #include "windows.h"
  2. (Visual Studio 2010) error C2440, utility (163)
    Open NetHelpers.h and replace this
    Code: Select all
    return TNetMessageCallbackResult( ((cls*)p)->Handle##name( serialize, curSeq, oldSeq, pEntityId, pChannel ), NULL ); \

    With this:
    Code: Select all
    return TNetMessageCallbackResult( ((cls*)p)->Handle##name( serialize, curSeq, oldSeq, pEntityId, pChannel ), reinterpret_cast<INetAtSyncItem*>(NULL) ); \

When loading the CryCommon.vcproj the Express Edition asks if you want to convert the project to the format used by the Express Edition... this won't cause any compatibility problems if converted will it?

I would assume not, but would just like confirmation before I do so.
Thanks.
Last edited by intrepidbiped on 03.05.2010, 16:57, edited 5 times in total.
jameszhao00
Producer
Producer
 
Posts: 1795
Member since: 20.04.2007, 14:42
Location: Maryland, USA
Likes: 0

RE: Visual C++ 2008 Express Edition?

Postby jameszhao00 » 07.03.2008, 23:00

Shouldn't. And I can also confirm VS08 can compile correctly.

/moving to scripting
Smilies2themax!
:D :rolleyes: :)) :easter: ;) :P :] :)) ;) :evil: :p :D :)) :tongue: :] :P
User avatar
intrepidbiped
Producer
Producer
 
Posts: 1382
Member since: 22.07.2007, 13:00
Location: BC, Canada
Likes: 0

Postby intrepidbiped » 07.03.2008, 23:07

Thanks, james.

Obviously I'm not experienced with C++, but I'm determined to learn :))

sorry for picking the wrong section :P
DINihilus
Just getting started
Just getting started
 
Posts: 8
Member since: 25.02.2008, 18:25
Likes: 0

cannot open include file 'afxres.h'.

Postby DINihilus » 08.03.2008, 06:34

Hello,

I installed the sdk and opened the crysismod solution in vc++ 2008. I made sure to put it from debug to profile and when i tried to build the solution, i get the error : cannot open include file 'afxres.h'.

Any help?

Thank you
jameszhao00
Producer
Producer
 
Posts: 1795
Member since: 20.04.2007, 14:42
Location: Maryland, USA
Likes: 0

RE: cannot open include file 'afxres.h'.

Postby jameszhao00 » 08.03.2008, 06:37

Do you have mfc/atl? Do you have Visual C++ Express? Maybe you need the platform SDK.

Mine is located @ C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxres.h

/moved to scripting+coding

Download the Platform SDK @ http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&DisplayLang=en

You don't any of the .NET stuff.
Last edited by jameszhao00 on 08.03.2008, 06:43, edited 2 times in total.
Smilies2themax!
:D :rolleyes: :)) :easter: ;) :P :] :)) ;) :evil: :p :D :)) :tongue: :] :P
DINihilus
Just getting started
Just getting started
 
Posts: 8
Member since: 25.02.2008, 18:25
Likes: 0

RE: cannot open include file 'afxres.h'.

Postby DINihilus » 08.03.2008, 07:51

What is mfc/alt? Yeah, I do have Visual C++ Express, 2008.

I downloaded the windows sdk and i still have the problem.
jameszhao00
Producer
Producer
 
Posts: 1795
Member since: 20.04.2007, 14:42
Location: Maryland, USA
Likes: 0

RE: cannot open include file 'afxres.h'.

Postby jameszhao00 » 08.03.2008, 07:58

Did you set up the include path?

Project Properties->C++->General->Additional Include Directories

Also, it's "ATL", not "ALT". MFC/ATL are some commonly used windows programming libraries, which you don't have to worry about when making mods. They're only used in CrysisMod for resource stuff.

Also, make sure you use Google :)) <- A programmer's best friend.

and MSDN :)
Last edited by jameszhao00 on 08.03.2008, 09:00, edited 6 times in total.
Smilies2themax!
:D :rolleyes: :)) :easter: ;) :P :] :)) ;) :evil: :p :D :)) :tongue: :] :P
User avatar
B4zzA
Just getting started
Just getting started
 
Posts: 14
Member since: 27.10.2007, 18:48
Likes: 0

RE: cannot open include file 'afxres.h'.

Postby B4zzA » 08.03.2008, 11:24

I found by changing afx entries to windows.h it worked.

Apparently afx isn't required, but VC++ includes it anyway
User avatar
B4zzA
Just getting started
Just getting started
 
Posts: 14
Member since: 27.10.2007, 18:48
Likes: 0

Altered Code - Not being used

Postby B4zzA » 08.03.2008, 12:19

I can't get my test mod to see any changes ive made to the source code. As a test ive removed energy draining from suit while in cloaked mode. But when i load up my mod in sandbox or game, it still drains.

Ive got the dll in the right place, and the file structure is correct.

Anyone else got this problem?
User avatar
B4zzA
Just getting started
Just getting started
 
Posts: 14
Member since: 27.10.2007, 18:48
Likes: 0

RE: Altered Code - Not being used

Postby B4zzA » 08.03.2008, 15:05

Never mind, after restarting its working now?
DINihilus
Just getting started
Just getting started
 
Posts: 8
Member since: 25.02.2008, 18:25
Likes: 0

Postby DINihilus » 09.03.2008, 04:13

//#include "afxres.h" //comment out afxres.h
#include "windows.h"

i did that as was suggested in another post but now it says

error PRJ0003 : Error spawning 'cmd.exe'.


Ahh, can anyone help with this one?

Thank you
jameszhao00
Producer
Producer
 
Posts: 1795
Member since: 20.04.2007, 14:42
Location: Maryland, USA
Likes: 0

Postby jameszhao00 » 09.03.2008, 04:19

wtf... post as much information as you can please. Compiler version. Build log... rc Source file...
Smilies2themax!
:D :rolleyes: :)) :easter: ;) :P :] :)) ;) :evil: :p :D :)) :tongue: :] :P
User avatar
puffdadder
Just getting started
Just getting started
 
Posts: 80
Member since: 03.07.2007, 03:59
Location: in my cold dark yet humid basement.
Likes: 0

Postby puffdadder » 09.03.2008, 04:20

omgosh so this means that we can use visual c++ express 2008 edition with no worries! i love you!
If you wish to join BP productions, please email or pm me. So far we are looking for a female voice actress. Vive jesu!
User avatar
Fortran
Has seen it all
Has seen it all
 
Posts: 6478
Member since: 27.12.2007, 01:50
Location: Nottingham
Likes: 4

Postby Fortran » 09.03.2008, 04:22

Yep, works perfectly.
Associate Producer - New World Interactive
DINihilus
Just getting started
Just getting started
 
Posts: 8
Member since: 25.02.2008, 18:25
Likes: 0

Postby DINihilus » 09.03.2008, 04:28

i can't upload the build log, basically it says

1>------ Build started: Project: CrysisMod, Configuration: Profile Win32 ------
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1> Creating library C:\Program Files\Electronic Arts\Crytek\Crysis\Mods\CrysisMod\Code\..\Bin32/CrysisMod.lib and object C:\Program Files\Electronic Arts\Crytek\Crysis\Mods\CrysisMod\Code\..\Bin32/CrysisMod.exp
1>Embedding manifest...
1>Project : error PRJ0003 : Error spawning 'cmd.exe'.
1>Build log was saved at "file://C:\Program Files\Electronic Arts\Crytek\Crysis\Mods\CrysisMod\BinTemp\Win32\Profile\CrysisMod\BuildLog.htm"
1>CrysisMod - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========


I am using Visual C++ 2008 Express Edition. I downloaded the sdk platform for windows server 2008 as you suggested. I installed the code in the default directory and I use the CrysisMod solution file to open up the solution. I set both Crycommon and Crymod to profile. As one fix suggested, I commented out the part about the include file and replace it with windows.h. Having done that, I get the cmd.exe error now.

Anything else?
Last edited by DINihilus on 09.03.2008, 04:31, edited 1 time in total.


 
Connect and collaborate with CRYENGINE developers in the official Forums.
Visit the Gallery to share what you have created and be inspired by what others are creating with CRYENGINE.
Community