Jiangshan - Full SOURCE

Status
Not open for further replies.
How I can fix it errors?

1>d3d_interface.obj : error LNK2001: unresolved external symbol _IID_IDirect3D7
1>d3d_interface.obj : error LNK2001: unresolved external symbol _IID_IDirect3DTnLHalDevice
1>sysinfo.obj : error LNK2001: unresolved external symbol _IID_IDirectMusic
1>sysinfo.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusic
 
How I can fix it errors?

1>d3d_interface.obj : error LNK2001: unresolved external symbol _IID_IDirect3D7
1>d3d_interface.obj : error LNK2001: unresolved external symbol _IID_IDirect3DTnLHalDevice
1>sysinfo.obj : error LNK2001: unresolved external symbol _IID_IDirectMusic
1>sysinfo.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusic
Those are linker errors.
It means that you have to manually add a directory into your project properties under the linker section.
Search for the files that it is saying that it cannot find on your hard drive then add the parent folder to your project properties linker section.

I'm not familiar with those particular files but they all sound like something that would be found in microsoft's directx SDK
If you have not installed the directX SDK you can get it here
Run the installer and it will place the whole SDK into your program files folder.
You need to link to the libs/x86 folder for the linker. This contains all the necessary .lib files
Also link to the "includes" folder in your project "include directories" section.
 
@Purpleyouko
Do you have any news with Jiangshan?
I'm getting pretty close.
Two errors remain but they are some of the nastiest ones I ever came across.
Something in the source is causing errors in the windows SDK files by sending in erroneous data in a function call. Apparently in the 2008 pro compiler this is acceptable but in the 2010 compiler it is far more strict so it fails.
It's ridiculously difficult to figure out precisely where and precisely why it's failing.

here are the errors (just in case anyone has ever come across something like this before.
Code:
2>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\utility(163): error C2439: 'std::_Pair_base<_Ty1,_Ty2>::second' : member could not be initialized
2>          with
2>          [
2>              _Ty1=const UINT,
2>              _Ty2=CAdjustCtrl *
2>          ]
2>          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\utility(167) : see declaration of 'std::_Pair_base<_Ty1,_Ty2>::second'
2>          with
2>          [
2>              _Ty1=const UINT,
2>              _Ty2=CAdjustCtrl *
2>          ]
This error is happening when the code tries to set up a Pair_base with a "unsigned integer" and CAdjustCtrl which happens to be a class related to keyboard/mouse input.

Second error
Code:
4>ScriptFuncImpl.cpp(1431): error C2440: 'initializing' : cannot convert from 'DWORD' to 'std::bitset<_Bits>'
4>          with
4>          [
4>              _Bits=32
4>          ]
4>          No constructor could take the source type, or constructor overload resolution was ambiguous
It happens on this line of code
Code:
tagGuildPower power = GuildMgr::Inst()->GetPosPower(pLocalPlayer->GetRoleGuildPos());
            [B]std::bitset<EGPT_MAX> bitsetPower = *(DWORD*)(void*)(&power);[/B]
            lua_pushboolean(L, bitsetPower[EGPT_PUBLISHQUESTQUEST]);
What it is trying to do is take a string of bits from the structure tagGuildPower and convert them into a DWORD variable before storing them into the variable bitsetPower (which I believe is supposed to be a DWORD but with EGPT_MAX defined as 25 it doesn't quite match the 32 bits needed for a DWORD.
I tried changing its definition but it made no difference to the error.
From some research I did it appears that std::bitset may actually be bugged in 2010 so it might be necessary to code a completely new workaround for this. It's a bit of a mess anyway with all those dereferences and pointers.

Other than those two issues the client project (14 sub-projects) compiles fine. 12 of 14 are now working perfectly
 
Update:
Fixed one of the bugs.

This bug is in SciptFuncImpl.cpp

old code
Code:
int SC_HasLocalPlayerGuildPower(lua_State* L)
{
    DWORD dwPowertType = (DWORD)lua_tonumber(L, -1);
    LocalPlayer* pLocalPlayer = RoleMgr::Inst()->GetLocalPlayer();
    if( P_VALID(pLocalPlayer) ) 
    {
        DWORD dwGuildID = pLocalPlayer->GetRoleGuildID();
        if( P_VALID(dwGuildID) )
        {
            tagGuildPower power = GuildMgr::Inst()->GetPosPower(pLocalPlayer->GetRoleGuildPos());
            [B][I]std::bitset<EGPT_MAX> bitsetPower = *(DWORD*)(void*)(&power);[/I][/B]
            lua_pushboolean(L, bitsetPower[EGPT_PUBLISHQUESTQUEST]);
            return 1;
        }
    }
    
    lua_pushboolean(L, FALSE);
    return 1;
}

replace with this and it compiles in 2010 pro
Code:
int SC_HasLocalPlayerGuildPower(lua_State* L)
{
    DWORD dwPowertType = (DWORD)lua_tonumber(L, -1);
    LocalPlayer* pLocalPlayer = RoleMgr::Inst()->GetLocalPlayer();
    if( P_VALID(pLocalPlayer) ) 
    {
        DWORD dwGuildID = pLocalPlayer->GetRoleGuildID();
        if( P_VALID(dwGuildID) )
        {
            tagGuildPower power = GuildMgr::Inst()->GetPosPower(pLocalPlayer->GetRoleGuildPos());
            [I][B]DWORD tmp = (DWORD)(void*)(&power);[/B][/I]
            //std::bitset<EGPT_MAX> bitsetPower = *(DWORD*)(void*)(&power);
            [I][B]std::bitset<EGPT_MAX> bitsetPower;
            bitsetPower._Getword(tmp);[/B][/I]
            lua_pushboolean(L, bitsetPower[EGPT_PUBLISHQUESTQUEST]);
            return 1;
        }
    }
    
    lua_pushboolean(L, FALSE);
    return 1;
}
Bitset is a class in 2010 so we have to use the class function ._Getword to import the DWORD value that we pulled out of the memory location where the variable "power" (a local instance of the class tagGuildPower) was stored
one bug to go then I'm moving on to the server
 
The links in the first post are working just fine.

Still fighting the _pair_base problem but I thought i would take a quick look at the server files.
As it happens 5 of the 11 in the project are shared with the client so they were already compiled.
Out of the remaining 6, 5 of them compiled straight away (after adding in the missing library links and stuff)
I will be looking as the final one (the actual world server) today in a bit more detail. The error doesn't look like it will be too hard to fix. It's just an issue with a function called SAFE_DELETE which is attempting to modify a value which is defined as a constant after a trade event between players.
Like i said, I don't anticipate it being all that tricky to fix.
Just another case where 2008 is a lot more forgiving than 2010. They really tightened up the rules in the new compiler.
 
The links in the first post are working just fine.

Still fighting the _pair_base problem but I thought i would take a quick look at the server files.
As it happens 5 of the 11 in the project are shared with the client so they were already compiled.
Out of the remaining 6, 5 of them compiled straight away (after adding in the missing library links and stuff)
I will be looking as the final one (the actual world server) today in a bit more detail. The error doesn't look like it will be too hard to fix. It's just an issue with a function called SAFE_DELETE which is attempting to modify a value which is defined as a constant after a trade event between players.
Like i said, I don't anticipate it being all that tricky to fix.
Just another case where 2008 is a lot more forgiving than 2010. They really tightened up the rules in the new compiler.

To continue on that, its almost compiling on VS2010 Pro BUT there is one last error that looks really nasty in the client, otherwise GameServer and RUnitTest compile just fine in 2010 :)
 
To continue on that, its almost compiling on VS2010 Pro BUT there is one last error that looks really nasty in the client, otherwise GameServer and RUnitTest compile just fine in 2010 :)

The links in the first post are working just fine.

Still fighting the _pair_base problem but I thought i would take a quick look at the server files.
As it happens 5 of the 11 in the project are shared with the client so they were already compiled.
Out of the remaining 6, 5 of them compiled straight away (after adding in the missing library links and stuff)
I will be looking as the final one (the actual world server) today in a bit more detail. The error doesn't look like it will be too hard to fix. It's just an issue with a function called SAFE_DELETE which is attempting to modify a value which is defined as a constant after a trade event between players.
Like i said, I don't anticipate it being all that tricky to fix.
Just another case where 2008 is a lot more forgiving than 2010. They really tightened up the rules in the new compiler.
Great work guys, I'm waiting the new version that can be compiled on 2010 (hate old **** 2008).
 
Status
Not open for further replies.
Back