LNK4098 - Simple Data Class

Ok, so i am creating a fairly simple data class for my own kind of font file system. What i want it to do is read data from a file and input that data into a class. However, i cannot get my code to compile, i get around 9 linker errors, and i don't know what part of the code is causing the errors. What i do see is that all the errors are preceded by the warning LNK4058 which says: "defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library", that is what i think i problem is, but i do not have that much experience with linker errors. The linker errors are LNK2019 or LNK2001 errors and they are unresolved external symbols. I am using MVC++ 2008 on Windows 7. Any help is appreciated and here is the code.

header:FontData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <vector>

#ifndef FONT_DATA_H
#define FONT_DATA_H

using namespace std;

class CharacterData
{
private:
    char characterCode;
    int rowNumber;
    int startX;
    int endX;
public:
    CharacterData();
    CharacterData(char character, int row, int start, int end);
    ~CharacterData();

    char getCharacterCode();
    int getRowNumber();
    int getStartX();
    int getEndX();
};

class FontData
{
private:
    int characterCodeBeginsAt;
    int characterCodeEndsAt;
    int spaceCharacterWidth;
    int numberOfRows;
    vector<int> rowStartingYValues;
    int rowHeight;
    int newLineHeight;
    bool validData;

    vector<CharacterData> characterDataValues;

    FontData();
public:
    FontData(char* fontDataFileName);
    ~FontData();

    int getCharacterCodeBeginsAt();
    int getCharacterCodeEndsAt();
    int getSpaceCharacterWidth();
    int getNumberOfRows();
    int getRowStartingYValue(int row);
    int getRowHeight();
    int getNewLineHeight();

    CharacterData getCharacterDataValue(char characterCode);
};

#endif 


ccp:FontData.ccp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <vector>
#include <fstream>
#include "FontData.h"

using namespace std;

CharacterData::~CharacterData(){}

char CharacterData::getCharacterCode(){return characterCode;}
int CharacterData::getRowNumber(){return rowNumber;}
int CharacterData::getStartX(){return startX;}
int CharacterData::getEndX(){return endX;}

CharacterData::CharacterData()
{
    characterCode = 0;
    rowNumber = -1;
    startX = -1;
    endX = -1;
}

CharacterData::CharacterData(char character, int row, int start, int end)
  :characterCode(character),
   rowNumber(row),
   startX(start),
   endX(end)
{
    
}

FontData::FontData(){}
FontData::~FontData(){}

int FontData::getCharacterCodeBeginsAt(){return characterCodeBeginsAt;}
int FontData::getCharacterCodeEndsAt(){return characterCodeEndsAt;}
int FontData::getSpaceCharacterWidth(){return spaceCharacterWidth;}
int FontData::getNumberOfRows(){return numberOfRows;}
int FontData::getRowStartingYValue(int row){return rowStartingYValues[row];}
int FontData::getRowHeight(){return rowHeight;}
int FontData::getNewLineHeight(){return newLineHeight;}

CharacterData FontData::getCharacterDataValue(char characterCode){return characterDataValues[static_cast<int>(characterCode) - characterCodeBeginsAt];}

FontData::FontData(char* fontDataFileName)
{
    validData = 0;

    ifstream inf(fontDataFileName);

    if (inf)
    {
        inf >>    characterCodeBeginsAt
            >>    characterCodeEndsAt
            >>    spaceCharacterWidth
            >>    numberOfRows;

        vector<int> tempRowStartingYValues(numberOfRows, -1);
        rowStartingYValues = tempRowStartingYValues;

        for (int ii = 0; ii < numberOfRows; ii++)
            inf >> rowStartingYValues[ii];

        inf >>    rowHeight
            >>    newLineHeight;

        int numberOfChars = characterCodeEndsAt - characterCodeBeginsAt + 1;

        vector<CharacterData> tempCharacterDataValues(numberOfChars);
        characterDataValues = tempCharacterDataValues;

        for (int ii = 0; ii < numberOfChars; ii++)
        {
            char c;
            int rn;
            int sx;
            int ex;

            inf >>    c
                >>    rn
                >>    sx
                >>    ex;

            CharacterData charData(c, rn, sx, ex);
            characterDataValues[ii] = charData;
        }

        validData = 1;
    }
}


If you have any questions, just ask.
Topic archived. No new replies allowed.