LINK : fatal errors LNK1561, LNK 2001, LNK 2019 with C++ code in VS2015 (Windows 8)

Hello everyone, I typed up some code for a light simulation in skin tissue. When I try to build it I get the LNK error.

LINK : fatal error LNK1561: entry point must be defined
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(638,5): error MSB6006: "link.exe" exited with code 1561.

I read somewhere about opening a Win32 console application (with the instead of the normal empty project which has this code but it did not fix the error and even more LNK errors came:
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>MonteCarloBestConsole.obj : error L1>MonteCarloBestConsole.obj : error LNK2001: unresolved external symbol "public: static double distanceTrav::millmtrPla" (?millmtrPla@distanceTrav@@2NA)

NK2001: unresolved external symbol "public: static double distanceTrav::distCollectCyl" (?distCollectCyl@distanceTrav@@2NA)

1>gsl.lib(stream.obj) : error LNK2001: unresolved external symbol ___iob_func

1>cblas.lib(xerbla.obj) : error LNK2001: unresolved external symbol ___iob_func

1>gsl.lib(error.obj) : error LNK2019: unresolved external symbol _fprintf referenced in function _gsl_error

1>gsl.lib(stream.obj) : error LNK2001: unresolved external symbol _fprintf

The code is too big to fit here so I will make a reply and append the code below if it fits. The gsl library is for calcualting a multivariate (normal) gaussian distribution. I have some include directories added and .lib files for graphing and statistical work,so do not try to run the code as you do not have them. If you answer as to how to get rid of the errors without seeing the code fine. If not I will attach the code below. Thank you.
Sorry I could not include all the code as it was over the 8192 length limit so I only included some parts of a struct that were related to the error.
[code]
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <string>
#include "GibbsMix.h"
#include "rand_num.h"
#include "chartdir.h"
#include "MetropHMix.h"
#include <SDL.h>
#include <SDL_main.h>
#include <SDL_test.h>
#include <SDL_timer.h>
#include <C:\Users\PMbanugo\Documents\pdf_monte_carlo\unzipped_pdf\CodeCogs[PDF]\codecogs\statistics\distributions\continuous\normal\pdf.h>
//#include <armadillo>
#include <pdf.h>
#include <list>
#include <random>
#include <iterator>
#include <array>
#include <time.h>
#include <math.h>
#include <vector>
#include <complex>
#include <iomanip>
using std::string;
using std::cerr;
using std::cout;
using std::cin;
using std::endl;
using std::list;


struct distanceTrav {
//distanceTrav * travptr;
static double millmtrSph;
static double centmtrSph;
static double totalDistSph; //in millimetres
static double distCollectSph;
static double millmtrCyl;
static double centmtrCyl;
static double totalDistCyl; //in millimetres
static double distCollectCyl;
static double millmtrPla;
static double centmtrPla;
static double totalDistPla; //in millimetres
static double distCollectPla;

static void raisemillMtrSph(struct distanceTrav &d1, const double& magnitude) {//call 1st
d1.millmtrSph += magnitude;
}

static void checkDistTrvSph(struct distanceTrav &d1) { //call2nd
if (d1.millmtrSph > 10.0) {
d1.millmtrSph = 0;
d1.centmtrSph += 1;
}
}//1



static void distTrvSph(struct distanceTrav &d1) {//call 3rd
d1.totalDistSph += (d1.centmtrSph*10.0) + d1.millmtrSph;
d1.distCollectSph = d1.totalDistSph;
}//1


static void raisemillMtrCyl(struct distanceTrav &d1, const double& magnitude) {//call 1st
d1.millmtrCyl += magnitude;
}//2


static void checkDistTrvCyl(struct distanceTrav &d1) { //call2nd
if (d1.millmtrCyl > 10.0) {
d1.millmtrCyl = 0;
d1.centmtrCyl += 1;
}
}//2

static void distTrvCyl(struct distanceTrav &d1) {//call 3rd
d1.totalDistCyl += (d1.centmtrCyl*10.0) + d1.millmtrCyl;
d1.distCollectCyl = d1.totalDistCyl;
}//2

static void raisemillMtrPla(struct distanceTrav &d1, const double& magnitude) {//call 1st
d1.millmtrPla += magnitude;

}//3


static void checkDistTrvPla(struct distanceTrav &d1) { //call2nd
if (d1.millmtrPla > 10.0) {
d1.millmtrPla = 0;
d1.centmtrPla += 1;
}
}//3



static void distTrvPla(struct distanceTrav &d1) {//call 3rd
d1.totalDistPla += (d1.centmtrPla*10.0) + d1.millmtrPla;
d1.distCollectPla = d1.totalDistPla;
}//3


static void totalDistCont1(struct distanceTrav &d1, std::string setting, const int& iteration) {
cout << "Total distance travelled of photon under the " << setting << " setting on iteration" << iteration << " is " << d1.totalDistSph << " mm." << endl;
}

static void totalDistCont2(struct distanceTrav &d1, std::string setting, const int& iteration) {
cout << "Total distance travelled of photon under the " << setting << " setting on iteration" << iteration << " is " << d1.totalDistCyl << " mm." << endl;
}


static void totalDistCont3(struct distanceTrav &d1, std::string setting, const int& iteration) {
cout << "Total distance travelled of photon under the " << setting << " setting on iteration" << iteration << " is " << d1.totalDistPla << " mm." << endl;
}

static void totalDistPulsed1(struct distanceTrav &d1, std::string setting, const int& iteration) {
cout << "Total distance travelled of photon under the " << setting << " setting on iteration" << iteration << " is " << d1.totalDistSph << " mm." << endl;
}


static void totalDistPulsed2(struct distanceTrav &d1, std::string setting, const int& iteration) {
cout << "Total distance travelled of photon under the " << setting << " setting on iteration" << iteration << " is " << d1.totalDistCyl << " mm." << endl;
}

static void totalDistPulsed3(struct distanceTrav &d1, std::string setting, const int& iteration) {
cout << "Total distance travelled of photon under the " << setting << " setting on iteration" << iteration << " is " << d1.totalDistPla << " mm." << endl;
}


static void lyr1DelineateSph(struct distanceTrav &d1, double skinthicknessV1) {
double epidermalProp = 0.10*skinthicknessV1;

if (d1.totalDistSph < epidermalProp) {
cout << "Photon is still in the epidermis (spherical axis)." << endl;
}

else if (d1.totalDistSph = epidermalProp) {
cout << "Photon is still at the epidermal-dermal boundary(spherical axis)." << endl;
}

else {
cout << "Photon entered the dermis(spherical axis)." << endl;
}
}

static void lyr1DelineateCyl(struct distanceTrav &d1, double skinthicknessV1) {
double epidermalProp = 0.10*skinthicknessV1;

if (d1.totalDistCyl < epidermalProp) {
cout << "Photon is still in the epidermis (cylindrical axis)." << endl;
}

else if (d1.totalDistCyl = epidermalProp) {
cout << "Photon is still at the epidermal-dermal boundary(cylindrical axis)." << endl;
}

else {
cout << "Photon entered the dermis(cylindrical axis)." << endl;
}
}


static void lyr1DelineatePla(struct distanceTrav &d1, double skinthicknessV1) {
double epidermalProp = 0.10*skinthicknessV1;

if (d1.totalDistPla < epidermalProp) {
cout << "Photon is still in the epidermis (planar axis)." << endl;
}

else if (d1.totalDistPla = epidermalProp) {
cout << "Photon is still at the epidermal-dermal boundary(planar axis)." << endl;
}

else {
cout << "Photon entered the dermis(planar axis)." << endl;
}
}


static void lyr1lyr2DelineateSph(struct distanceTrav &d1, double skinthicknessV2) {
double epidermalProp = 0.10*skinthicknessV2;
double dermalProp = 0.90*skinthicknessV2;

if (d1.totalDistSph >epidermalProp && d1.totalDistSph<dermalProp) {
cout << "Photon in the dermis (spherical axis)." << endl;
}

if (d1.totalDistSph > dermalProp) {
cout << "Photon has entered the subcutaneous tissue (spherical axis)." << endl;
}
}


static void lyr1lyr2DelineateCyl(struct distanceTrav &d1, double skinthicknessV2) {
double epidermalProp = 0.10*skinthicknessV2;
double dermalProp = 0.90*skinthicknessV2;

if (d1.totalDistCyl >epidermalProp && d1.totalDistCyl<dermalProp) {
cout << "Photon in the dermis (spherical axis)." << endl;
}

if (d1.totalDistCyl > dermalProp) {
cout << "Photon has entered the subcutaneous tissue (spherical axis)." << endl;
}
}


static void lyr1lyr2DelineatePla(struct distanceTrav &d1, double skinthicknessV2) {
double epidermalProp = 0.10*skinthicknessV2;
double dermalProp = 0.90*skinthicknessV2;

if (d1.totalDistPla >epidermalProp && d1.totalDistPla<dermalProp) {
cout << "Photon in the dermis (spherical axis)." << endl;
}

if (d1.totalDistPla > dermalProp) {
cout << "Photon has entered the subcutaneous tissue (spherical axis)." << endl;
}
}

}
[/code]
Topic archived. No new replies allowed.