Author Topic: SwigSample build error  (Read 18545 times)

camka-dev

  • Not-a-newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
SwigSample build error
« on: July 20, 2012, 04:45:12 AM »
Hi.

trying to build and run SwigWindowsCSharpSample.

Downloaded Swig and it is compiled fine.

But when i build Sample from 'DependentExtensions\Swig\SwigWindowsCSharpSample' i have this:
Quote
Error   1   The type or namespace name 'SWIGTYPE_p_DataStructures__ListT_RakNet__RakNetStatistics_t' could not be found (are you missing a using directive or an assembly reference?)   C:\RakNet_PC-4.05\DependentExtensions\Swig\SwigWindowsCSharpSample\SwigTestApp\SwigFiles\RakPeer.cs   520   105   SwigTestApp
Error   2   The type or namespace name 'SWIGTYPE_p_DataStructures__ListT_RakNet__RakNetStatistics_t' could not be found (are you missing a using directive or an assembly reference?)   C:\RakNet_PC-4.05\DependentExtensions\Swig\SwigWindowsCSharpSample\SwigTestApp\SwigFiles\RakPeerInterface.cs   533   104   SwigTestApp

What to do to run it ?

swig version: 2.0.7
visual studio version: 10.0.40219.1 SP1

Thanks.
« Last Edit: July 20, 2012, 07:22:44 AM by camka-dev »

camka-dev

  • Not-a-newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: RakNetSample build error
« Reply #1 on: July 20, 2012, 07:20:48 AM »
ok, just did some research and found that file is exists but not included into project, i added it and compilation ends fine.

next i run project and see
Quote
DLL issue
Make sure RakNetWrap.cxx is included in the DLL project.
Press enter to quit.
what this mean?

p.s. RakNet.dll is in output directory of sample project.

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: SwigSample build error
« Reply #2 on: July 21, 2012, 07:13:08 PM »
When you built the dll, was that file part of the project?

camka-dev

  • Not-a-newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: SwigSample build error
« Reply #3 on: July 22, 2012, 04:58:56 AM »
i cant find it anywhere

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: SwigSample build error
« Reply #4 on: July 22, 2012, 02:21:40 PM »
Are you building the DLL at all? This is in the manual under http://www.raknet.com/raknet/manual/swigtutorial.html

camka-dev

  • Not-a-newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: SwigSample build error
« Reply #5 on: July 23, 2012, 12:24:19 AM »
first of all: thank you for response.

"Are you building the DLL at all?"
sure, as writed at instruction.

i find cxx file (DependentExtensions\Swig\SwigOutput\CplusDLLIncludes) and included it with header file, but after compilation there is error
Quote
Error   2   error C2039: 'SrcAndDest' : is not a member of 'RakNet::UDPForwarder'   C:\RakNet_PC-4.05\DependentExtensions\Swig\SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx   418   1   RakNet
Error   3   error C2146: syntax error : missing ';' before identifier 'SrcAndDest'   C:\RakNet_PC-4.05\DependentExtensions\Swig\SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx   418   1   RakNet
Error   4   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   C:\RakNet_PC-4.05\DependentExtensions\Swig\SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx   418   1   RakNet
   7   IntelliSense: class "RakNet::UDPForwarder" has no member "SrcAndDest"   c:\raknet_pc-4.05\dependentextensions\swig\swigoutput\cplusdllincludes\raknet_wrap.cxx   418   31   RakNet

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: SwigSample build error
« Reply #6 on: July 23, 2012, 12:41:58 PM »
I'll check this tonight. If you don't hear back please bump the post.

camka-dev

  • Not-a-newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: SwigSample build error
« Reply #7 on: July 24, 2012, 08:21:24 AM »
bump

still need help.

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: SwigSample build error
« Reply #8 on: July 24, 2012, 10:41:09 AM »
Sorry, use the attached file

camka-dev

  • Not-a-newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: SwigSample build error
« Reply #9 on: July 25, 2012, 12:22:19 AM »
Hi.

anyway problems.

i put your file into "DependentExtensions\Swig\Swig1.3.4InterfaceFiles"
Clean and Rebuild project "DependentExtensions\Swig\DLL_Swig\RakNet.sln" and after build i have same error:
Quote
Error   2   error C2039: 'SrcAndDest' : is not a member of 'RakNet::UDPForwarder'   C:\RakNet_PC-4.05\DependentExtensions\Swig\SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx   418   1   RakNet
Error   3   error C2146: syntax error : missing ';' before identifier 'SrcAndDest'   C:\RakNet_PC-4.05\DependentExtensions\Swig\SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx   418   1   RakNet
Error   4   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   C:\RakNet_PC-4.05\DependentExtensions\Swig\SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx   418   1   RakNet

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: SwigSample build error
« Reply #10 on: July 25, 2012, 12:57:35 AM »
Put it in DependentExtensions\Swig\SwigInterfaceFiles

camka-dev

  • Not-a-newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: SwigSample build error
« Reply #11 on: July 25, 2012, 01:03:39 AM »
does not compile, same error.

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: SwigSample build error
« Reply #12 on: July 25, 2012, 08:48:55 PM »
You have to run MakeSwig.bat too

camka-dev

  • Not-a-newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: SwigSample build error
« Reply #13 on: July 26, 2012, 12:16:13 AM »
does not have effect

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: SwigSample build error
« Reply #14 on: July 26, 2012, 10:11:33 AM »
This is the change I made:

From:

Code: [Select]
//RakPeer only
//Swig doesn't know how to handle friend functions, so even if it is in the protected section
//They must be explicitly ignored
//This Specific case is somehow placed in the RakNet namespace rather than RakNet::RakPeer
//Ignore both to be safe
%ignore RakNet::RakPeer::ProcessOfflineNetworkPacket;
%ignore RakNet::RakPeer::ProcessNetworkPacket;
%ignore RakNet::ProcessOfflineNetworkPacket;
%ignore RakNet::ProcessNetworkPacket;

To:

Code: [Select]
//RakPeer only
//Swig doesn't know how to handle friend functions, so even if it is in the protected section
//They must be explicitly ignored
//This Specific case is somehow placed in the RakNet namespace rather than RakNet::RakPeer
//Ignore both to be safe
%ignore RakNet::RakPeerInterface::GetStatisticsList;
%ignore RakNet::RakPeer::GetStatisticsList;
%ignore RakNet::RakPeer::ProcessOfflineNetworkPacket;
%ignore RakNet::RakPeer::ProcessNetworkPacket;
%ignore RakNet::ProcessOfflineNetworkPacket;
%ignore RakNet::ProcessNetworkPacket;