Jump to content
TLThings

[C++] Build your lib, python.dll into your Binary


Guest Ezrekith

Recommended Posts

Guest Ezrekith

Hi folks!

With this Tutorial you are building your python dll and lib folder into your binary.


Please login or register to see this attachment. r

 

First of all download the Project.rar and place the lib into your binary libary folder, and the Python folder into your include folder.

ScriptLib/PythonUtils.cpp

Change it like this:

Please login or register to see this code.

ScriptLib/PythonUtils.h

Change it like this:

Please login or register to see this code.

 

Userinterface/UserInterface.cpp

Please login or register to see this code.

OR

Please login or register to see this code.

Change to:

Please login or register to see this code.

Delete this:

 

Please login or register to see this code.

 

Delete this:

 

Please login or register to see this code.

 

Delete this:

 

Please login or register to see this code.

 

Scriptlib/PythonLauncher.cpp
 

Please login or register to see this code.

 

Scriptlib/PythonLauncher.h

Please login or register to see this code.

 

Scriptlib/PythonMarshal.cpp

Please login or register to see this code.

 

Scriptlib/StdAfx.h

 

Please login or register to see this code.

And now you can delete the lib folder from your client (where you can find the pack, bgm etc folders) and delete the python27.dll or python22.dll whatever you use.

 

From now on you will use Python2.7 with this libary.

Here you can find what kind of dll-s do you need to start the client, the others are useless.
Please login or register to see this link.

Good luck!

Edited by Ezrekith
Link to post
Share on other sites
  • 1 month later...
  • 2 weeks later...
  • 2 months later...

When "unresolved external" shows up, usually is that the lib isnt added.

Check if you added this line:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

If it doesnt work, do a "clean solution" and re-open visual studio to have it re-index all the stuff. Then try a rebuild solution

  • Like 2
Link to post
Share on other sites

I think I've done everything correctly. Here you can take a look at my includes.

UserInterface/UserInterface.cpp

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

ScriptLib/PythonLauncher.cpp

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

ScriptLib/PythonLauncher.h

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

ScriptLib/PythonMarshal.cpp

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

ScriptLib/StdAfx.h

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

And here are folders from Extern:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Edited by Chyu ^^
  • Like 6
Link to post
Share on other sites

I just discovered a strange thing. When I compile in other mode than 'Debug', so 'Distribute' or 'Release' it compile without any problem.
But when I try to run it, it won't because of the following problems. Anyone knows what is wrong?

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

  • Like 1
  • Confused 1
Link to post
Share on other sites
  • 1 year later...
  • 4 months later...
  • 1 month later...
  • 2 weeks later...
  • 3 weeks later...
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.