KT on VS

Here you can talk about anything you want ;)

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

KT on VS

Postby PurpleYouko on Thu Oct 15, 2015 6:31 pm

So......
Recently I got a new work computer which upgraded it from 32bit win7 to 64bit win7 and also got rid of just about every useful application that I had.
Most of the tools i built in VB6 no longer work :(

but worst of all, none of my server code would compile in codeblocks any longer due to missing libraries such as pthreads and mysql.

This morning I had a bit of free time so I decided to fix that situation. First I did everything I could think of to make it compile in CB but every attempt failed.

"Bugger this" I thought to myself and fired up visual studio 2010. Created a new project and manually added all the files that are used in the normal project. Had a few issues with getting pthreads to play nice but eventually found that using pthreadVC2.dll worked just fine.

A few moments ago I got the KTRose worldserver to fully compile in VS2010. And it runs perfectly too :D
And i thought it was going to be difficult to do it. :lol:

so if anybody is interested I can tell yo all exactly how to convert over to VS as it's a LOT easier to use than codeblocks IMO
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: KT on VS

Postby hoegarden31 on Thu Oct 15, 2015 6:36 pm

Sure why not.
I like VS more than codeblocks. I would be interested in a world server that compiles with that.
I'm the one and only. In heaven and on earth.
Image
hoegarden31
Rackie
Rackie
 
Posts: 150
Joined: Sun Nov 13, 2011 7:13 pm

Re: KT on VS

Postby PurpleYouko on Thu Oct 15, 2015 8:05 pm

ok here goes with instructions (only for people who are already at least a little familiar with VS2010)

1) first make a copy of your existing server folder (just to be safe. Don't want to be overwriting perfectly good executables with broken ones that don't compile properly do we?)

2) create an empty VS C++ console project and call it WorldServer. (will also work for char and login)

3) import all the cpp, hpp and h files that are always used in your rose server. Right click the project name in the solution explorer, select "Add -> Existing Item". Navigate to and highlight all your cpp, hpp and h files. You can do them all at once or bit by bit. It doesn't matter
VS_Select_files.png


4) Now you need to set up links to your libraries. There are only really 2 that you need to worry about. MySQL and pthread. It also uses winsock but everybody should have that on their machine already.

include.zip
(2.06 MiB) Downloaded 736 times

Unzip this and put it in the root of your server folder.

5) Now to set up your linker and stuff
open your "project properties->Linker->Input->Additional Dependencies" and add the 3 files shown here. You will have to type the names in. there is no browse function
additional_dependencies.png


6) in "project properties->Linker->General->Additional Library Dependencies", navigate to your mysql\lib folder and select it
Additional_Directories.png


7) Now we add links to the headers in the new include folder. in "project properties->VC++ Directories->Include Directories" select the path to your new "include" folder
Include_Folder.png


8) In "project properties->VC++ Directories->Library Directories" we add links to the lib files
other includes.png


that should just about do it. Happy compiling.
It's also quite possible that i might have over linked stuff. I was messing around a bit to get it working and might have added more links than is strictly necessary.
What the heck. It works. I'll tidy it up later
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: KT on VS

Postby Circa on Fri Oct 16, 2015 12:08 am

Sweet!!!!
Circa
Clown
Clown
 
Posts: 404
Joined: Sun Aug 23, 2009 5:52 am
Location: CA

Re: KT on VS

Postby WiseGuy on Sun Oct 18, 2015 3:35 am

Greats! Thanks
It is nice to be important
but very very important to be nice
User avatar
WiseGuy
Pomic
Pomic
 
Posts: 112
Joined: Sat Nov 21, 2009 4:03 am
Location: Jakarta

Re: KT on VS

Postby hoegarden31 on Thu Oct 22, 2015 5:59 pm

Got it all setup and compiles without errors. Good stuff.
I'm the one and only. In heaven and on earth.
Image
hoegarden31
Rackie
Rackie
 
Posts: 150
Joined: Sun Nov 13, 2011 7:13 pm

Re: KT on VS

Postby PurpleYouko on Thu Oct 22, 2015 6:08 pm

nice.

it's real easy to add the login and char servers too. Just set up the projects the same way so that they link into the libs and dlls that I gave you, then set the output path so that they all compile directly into the binary folder and you're good to go. :D
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: KT on VS

Postby d00bie on Tue Oct 27, 2015 12:11 am

Thanks ! i will use this guide and try to get this up and running in VS2015 soon :) i'll post my results :D !
d00bie
Little soul
Little soul
 
Posts: 6
Joined: Fri Sep 21, 2007 12:17 am

Re: KT on VS

Postby Whathell on Wed Apr 06, 2016 1:00 pm

Hi! Would this work with the server files from the SVN? https://subversion.assembla.com/svn/ktrose-source/

I tried to compile using VS but it gives tons of errors with syntaxes.
User avatar
Whathell
Little soul
Little soul
 
Posts: 1
Joined: Mon Apr 02, 2012 2:07 pm

Re: KT on VS

Postby PurpleYouko on Wed Apr 06, 2016 3:08 pm

It was a little trickier to get KTRose to compile in VS2010.
As you said there were a lot of syntax problems. I did get it to work though.
here is a zip of the whole thing. It isn't available as a seperate entity on any repository.

https://mega.nz/#!bQkmVJxB!G_0mpjWMZpZwErwXB2sEySHIvQ3V8mNC-s5PEZEJZNU

There were some issues with this version though. It seems that codeblocks interprets badly written math in a slightly different way than VS does so a lot of the variables that I spent ages optimizing in codeblocks are now wildly wrong. :(
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Next

Return to Welcome to the bar

Who is online

Users browsing this forum: No registered users and 4 guests