I'm distributing a binary that users are required to install the following:

Microsoft Visual C++ 2005 Redistributable Package (x86)
Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)

If they don't have them the program puts up a ambiguous error message. I'm not really sure how static linking works, but I started compiling it with /MT instead of /MD. Will this include all the necessary stuff from those 2 packages?


Here is the include portion for the project

#ifdef _WIN32
#define UNIXWIN
#define socklen_t int
#define strcasecmp _stricmp
#pragma comment(lib,"wsock32.lib")
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#include <winsock.h>
#define WS_MAJOR  1
#define WS_MINOR  1
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <time.h>

#include <sys/types.h>

#ifndef __USE_XOPEN
#define __USE_XOPEN // Very important in RH 5.2 - gets proper signal support
#endif

#include <signal.h>

I'm just not really sure what libraries are included in windows normally. I googled the hell out of it and I found material saying I needed to add references for the #includes, but from what I understood those are only for .lib files. I also found material saying I just needed to use the /MT flag to get the thing to compile with static libraries.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.