Dependancies on different computers

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Dependancies on different computers

Post by Asimov » June 29th, 2012, 10:17 pm

Hi Chilli,

The one thing I like about the Chilli framework is this. A program I write in Visual studio 2010 will work on XP, Vista and Windows 7 without having to download the redistributable package or stupid .net libraries.

Now if I write a stupid dos program, compile it and send it to another computer it asks me for libraries
eg MSVCP100.dll is missing blah blah. It was this reason I abandoned visual C++ and used Codeblocks in the first place.

So my question is. How does your framework manage to get around this problem. It has to be some compiler setting, I just don't know which one. I could go back and write the dos program in Codeblocks and I know it will work on that other computer.

I hope ya know the answer :)

Asimov

PS I managed to get a Client and Server to work, and this is what I am testing out now.
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Dependancies on different computers

Post by chili » June 30th, 2012, 2:32 am

I honestly don't know why the framework stuff is working on your other computer, but yet a console app will not work. I know that framework programs I write on my computer do not work on the one at my workplace.

That said, you should be able to get it to work if you change a setting in the project properties. It's under Properties ... > C/C++ > Code Generation > Runtime Library. Set it to /MT and then build it and try it on the other computer.
Chili

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Dependancies on different computers

Post by Asimov » June 30th, 2012, 10:34 am

Hi Chilli,

I think I have worked out the problem, but not the solution.
I think it has something to do with managed code and unmanaged code.

I think Managed code uses the CLR and unmanaged code does not.

I notice with the Chilli framework CLR is off an and it uses Multithreaded /MT.

If I run this program with those settings I get a compiler error.
Command line error D8016: '/clr' and '/MT' command-line options are incompatible
That is with Mt and CLR.

If I turn off CLR I get a different compiler error
fatal error C1190: managed targeted code requires a '/clr' option

The only way to get this console program to work is to have CLR on and have Multithreaded DLL (/MD) on. Then it needs dependencies grrrr.

So it seems the code I am using must be managed, and I don't know enough to make it unmanaged. I will attach it. Hope you don't mind as it doesn't use the Chilli framework, but I am hoping to use it in one of my games later, so that I may make a network game.

Asimov
Attachments
Server.zip
(416.72 KiB) Downloaded 138 times
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Dependancies on different computers

Post by chili » June 30th, 2012, 11:33 am

You have to choose the correct options when you first create the project Asimov, otherwise it will be very difficult to change the project settings later on. You have not used the correct options when creating your console app. Most likely, you selected CLR instead of Win32. If you're not sure what you're doing wrong, go back to my first console app tutorial (17 maybe?) and carefully watch how I set it up.
Chili

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Dependancies on different computers

Post by Asimov » June 30th, 2012, 12:05 pm

Hi Chilli,

Thankyou I will try that.
It should be easy to setup the project again and just drag in the files.

EDIT: like usual you are a genius and now it is working on my other computer. Don't know what made me click on CLR grrr LOL, but thanks anyway.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Dependancies on different computers

Post by LuX » June 30th, 2012, 3:05 pm

Cool.

Do you have a separate client program or how do I "activate" that?
I connected the program to my own IP which worked, by changing inet adress. Or at least I think that's what it did.
ʕ •ᴥ•ʔ

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Dependancies on different computers

Post by Asimov » June 30th, 2012, 3:20 pm

Hi Lux,

Yes i do have a client program.

Will post it for you later.

I have managed to get the client and server to talk to each other, but I think I should use a separate socket for each heh heh.

Give me an hour or so and I will post the client. In the meantime you can telnet into the server.

As well as 127.0.0.1 you can use localhost as well. If you want it to work on the net you have to use an external ip, but it should work the same.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Dependancies on different computers

Post by Asimov » June 30th, 2012, 3:40 pm

Hi Lux,

This server and client is a bit messy and but it works.
The server will keep on searching after you have connected. Really it should go to a different loop once you connect, or even the main game loop.

I have got it to send text back from the server when you connect and the client sends text back to the server. The reason there is strange characters is that I am using the same socket for sending and recieving. I want to improve this soon, but it is a good example of a simple client and server.

By the way I didn't write this code. I got it from a tutorial on youtube, but now I am looking into making it better.

I want to be able to use cin to input the server ip, but not sure how to change the input into a single variable yet. Working on this now.

Modern online games will have a separate server that all the clients join to, but for a small game like Battleshio chess or your game you could have both the client and server in one program, and one person takes the lead.

Asimov
Attachments
Server&Client.zip
(654.96 KiB) Downloaded 164 times
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Dependancies on different computers

Post by LuX » June 30th, 2012, 4:17 pm

Thanks, I'll take a loot at this. But I think I'll look for a detailed tutorial on the web too, I prefer to search from google, since youtube usually provides crappy tutorial dublicates of something already on the web, but in less detail. Well... chili has proven me wrong, but still...
ʕ •ᴥ•ʔ

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Dependancies on different computers

Post by Asimov » June 30th, 2012, 4:40 pm

HI Lux,

I look for tutorials all the time, and I found similar tutorials which are a lot more complex. I think it is the error checking which makes it look longer heh heh.

With your game however I think you would only need to send coordinates and maybe score to the client and vica versa.

PS just tried my server and client with an external ip and it goes wrong LOL

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

Post Reply