The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
December 11, 2024, 02:43:00 pm
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Compiling 6.2 on VSC++
« previous next »
Pages: [1] Print
Author Topic: Compiling 6.2 on VSC++  (Read 10844 times)
DwD
Zebranky food
*
Offline Offline

Gender: Male
Posts: 21


ancay ouyay eakspay igpay atinlay?


View Profile
Compiling 6.2 on VSC++
« on: December 10, 2008, 08:20:25 pm »

Let me start by saying, I am lousy wiht C++.  That said, here's my problem.  Compiling with VSC++, I am getting an error I don't know how to fix.  Here's the error straight from the compiler;

D:\visual studio\vc08\VC\include\stdio.h(358) : error C3163: '_vsnprintf': attributes inconsistent with previous declaration
       D:\visual studio\vc08\VC\include\stdio.h(350) : see declaration of '_vsnprintf'

and the related lines of code;

_Check_return_opt_ _CRT_INSECURE_DEPRECATE(vsnprintf_s) _CRTIMP int __cdecl vsnprintf(_Out_cap_(_MaxCount) char * _DstBuf, _In_ size_t _MaxCount, _In_z_ _Printf_format_string_ const char * _Format, va_list _ArgList);

__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _CRTIMP, _snprintf, _vsnprintf, _Pre_notnull_ _Post_maybez_ char, _Out_cap_(_Count) _Post_maybez_, char, _Dest, _In_ size_t, _Count, _In_z_ _Printf_format_string_ const char *, _Format)



HELP!?
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Compiling 6.2 on VSC++
« Reply #1 on: December 10, 2008, 10:55:06 pm »

Hmm... I don't think anyone here has tried to compile it on MSVC08 yet. Could you try to comment out the following lines in src/port.h and src/sc2code/libs/uio/uioport.h:
#ifdef _MSC_VER
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif

Please let me know whether this works.
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Poquito Mal
Zebranky food
*
Offline Offline

Posts: 3



View Profile
Re: Compiling 6.2 on VSC++
« Reply #2 on: December 11, 2008, 03:35:04 am »

I had the same problem and got around it by commenting out the line:

#define vsnprintf _vsnprintf

in both port.h and uioport.h, but then I got some more errors:

Error   384   error LNK2019: unresolved external symbol _WspiapiFreeAddrInfo@4 referenced in function _ConnectState_close   connect.obj   UrQuanMasters

Error   385   error LNK2001: unresolved external symbol _WspiapiFreeAddrInfo@4   listen.obj   UrQuanMasters

Error   386   error LNK2019: unresolved external symbol _WspiapiGetNameInfo@28 referenced in function _acceptSingleConnection   listen.obj   UrQuanMasters

Error   387   error LNK2019: unresolved external symbol _WspiapiGetAddrInfo@16 referenced in function _getaddrinfoAsync   resolve.obj   UrQuanMasters

Error   388   fatal error LNK1120: 3 unresolved externals   c:\Build\sc2\uqmdebug.exe   UrQuanMasters

Haven't had the energy to fight with it since...
Just tried again commenting out all the lines you mentioned and still get the same errors as well as several:

error LNK2001: unresolved external symbol _snprintf

errors and one:

Error   375   error LNK2019: unresolved external symbol _snprintf referenced in function _starPresenceString   uqmdebug.obj   UrQuanMasters
Logged
DwD
Zebranky food
*
Offline Offline

Gender: Male
Posts: 21


ancay ouyay eakspay igpay atinlay?


View Profile
Re: Compiling 6.2 on VSC++
« Reply #3 on: December 11, 2008, 03:21:18 pm »

I commented the lines you suggested with similar results to Poquito Mal.  If i comment only  the vsnprintf definition, I get 4 errors.

1>connect.obj : error LNK2019: unresolved external symbol _WspiapiFreeAddrInfo@4 referenced in function _ConnectState_close
1>listen.obj : error LNK2001: unresolved external symbol _WspiapiFreeAddrInfo@4
1>listen.obj : error LNK2019: unresolved external symbol _WspiapiGetNameInfo@28 referenced in function _acceptSingleConnection
1>resolve.obj : error LNK2019: unresolved external symbol _WspiapiGetAddrInfo@16 referenced in function _getaddrinfoAsync

BTW
I want to express my gratitude to those of you who updated this excellent old game and added the network support for melee.
« Last Edit: December 11, 2008, 03:33:20 pm by DwD » Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Compiling 6.2 on VSC++
« Reply #4 on: December 12, 2008, 08:25:34 pm »

Could you try editing src/sc2code/libs/network/wspiapiwrap.h, replacing the section:
Code:
// HACK. See wspiapiwrap.c
#   define getaddrinfo WspiapiGetAddrInfo
#   define getnameinfo WspiapiGetNameInfo
#   define freeaddrinfo WspiapiFreeAddrInfo
void WINAPI WspiapiFreeAddrInfo (struct addrinfo *ai);
int WINAPI WspiapiGetAddrInfo(const char *nodename, const char *servname,
        const struct addrinfo *hints, struct addrinfo **res);
int WINAPI WspiapiGetNameInfo (const struct sockaddr *sa, socklen_t salen,
        char *host, size_t hostlen, char *serv, size_t servlen, int flags);
by
Code:
#include <wspiapi.h>
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
DwD
Zebranky food
*
Offline Offline

Gender: Male
Posts: 21


ancay ouyay eakspay igpay atinlay?


View Profile
Re: Compiling 6.2 on VSC++
« Reply #5 on: December 13, 2008, 05:12:25 am »

I commented the line

#define vsnprintf _vsnprintf

in port.h and made the changes you suggested.  I got a compile.

It's late here and I have no one to test the networking with right now.  I'll try it tomorrow and let you know.

Thanks!


EDIT

I have still not tested the networking, but I have found a strange bug with this compile.  In the storyline, when the Precursor vessel enters hyperspace, on auto-pilot, it will travel for a few seconds then stops with the menu active, like the computer has registered a keystroke.  I can select navigate and the ship will continue on course for a few seconds more then stops again with the menu active.  This continues in a loop.

I have checked this against the original uqm.exe and it is not my keyboard sticking.


EDIT

I have checked the melee network, it works.  For now, I can use 6.2 for network melee with my edited ships and 5.0 for the game with my edited ships. 
« Last Edit: December 13, 2008, 08:19:12 pm by DwD » Logged
Wisp
Zebranky food
*
Offline Offline

Posts: 1



View Profile
Re: Compiling 6.2 on VSC++
« Reply #6 on: September 19, 2009, 06:02:26 pm »

I know there has been time since the last post, but anyway I thought about sharing my solution. I just compiled uqm 0.6.2 on msvc++ 9.0. To work around the stdio.h that is giving errors, I simply used an older stdio.h and all compiled perfectly.
Logged
DukHunter
Zebranky food
*
Offline Offline

Posts: 3



View Profile
Re: Compiling 6.2 on VSC++
« Reply #7 on: June 22, 2016, 12:41:20 pm »

Trying to compile under MS VS 2008 and got lot of linker errors (below). It's crazy. When I tried it before I didn't get so many problems. How to exclude Network part from compilation??

"Creating library ../../uqmdebug.lib and object ../../uqmdebug.exp
1>connect.obj : error LNK2019: unresolved external symbol _WspiapiFreeAddrInfo@4 referenced in function _ConnectState_close
1>listen.obj : error LNK2001: unresolved external symbol _WspiapiFreeAddrInfo@4
1>listen.obj : error LNK2019: unresolved external symbol _WspiapiGetNameInfo@28 referenced in function _acceptSingleConnection
1>resolve.obj : error LNK2019: unresolved external symbol _WspiapiGetAddrInfo@16 referenced in function _getaddrinfoAsync
1>netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function _closeWSAEvent
1>netport.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
1>netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSACloseEvent@4 referenced in function _closeWSAEvent
1>netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSAEventSelect@12 referenced in function _NetManager_addDesc
1>netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSACreateEvent@0 referenced in function _NetManager_addDesc
1>netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSAWaitForMultipleEvents@20 referenced in function _NetManager_process
1>netmanager_win.obj : error LNK2019: unresolved external symbol __imp__WSAEnumNetworkEvents@12 referenced in function _NetManager_processEvent
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function _Socket_openNative
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function _Socket_close
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function _Socket_connect
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function _Socket_bind
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__listen@8 referenced in function _Socket_listen
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__accept@12 referenced in function _Socket_accept
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__send@16 referenced in function _Socket_send
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function _Socket_recv
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__ioctlsocket@12 referenced in function _Socket_setNonBlocking
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function _Socket_setReuseAddr
1>socket_win.obj : error LNK2019: unresolved external symbol __imp__getsockopt@20 referenced in function _Socket_getError
1>network_win.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _Network_init
1>network_win.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _Network_init"
Logged
JHGuitarFreak
Enlightened
*****
Offline Offline

Posts: 1374



View Profile WWW
Re: Compiling 6.2 on VSC++
« Reply #8 on: June 24, 2016, 05:58:06 pm »

Dude, this post was from 9 years ago.

Anyways, you need WindowsSDK, specifically the wspiapi.h header file.

And because I am such a nice guy and don't care for copyright laws you can download it from my DropBox.

Copy that to wherever you're storing your headers and off you go.
Logged

The artist once again known as Kohr-Ah Death 213.

Get your MegaMod HERE
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!