I have 2 projects. I'm using VC++ 2010 express.
The first is a static library which generates a lib file called stdlib.lib.
The second is a dll project which links to stdlib.lib.
When I try to compile, I get linker errors that say unresolved reference and they refer
to functions that are inside stdlib.lib. I have no idea why this is happening because
I've linked in stdlib.lib.
This is some of the code from stdlib.lib(too much to show all):
#ifndef KEYVALUE_H
#define KEYVALUE_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
#include "ifilesystem.h"
#define MAX_IDENTIFIER_LENGTH 256
#define MAX_VALUE_LENGTH 1024
class KeyValue{
char m_pIdentifier[MAX_IDENTIFIER_LENGTH];
char m_pValue[MAX_VALUE_LENGTH];
bool m_bParseSubKeys;
CUtlVector< KeyValue > m_SubKeys;
public:
KeyValue( void );
KeyValue( char *pFilename, IBaseFileSystem *pFileSystem );
KeyValue( int nFileHandle, IBaseFileSystem *pFileSystem );
~KeyValue( void );
void Reset( void );
void Cleanup( void );
char *GetIdentifier( void );
char *GetValue( void );
CUtlVector< KeyValue > &GetSubKeys( void );
bool ParseFromFile( int nFileHandle, IBaseFileSystem *pFileSystem );
bool ParseFromFile( char *pFilename, IBaseFileSystem *pFileSystem );
bool ParseFromFileManual( char *pFilename, IBaseFileSystem *pFileSystem );
bool ParseFromString( char *pString, bool *bGetNext = NULL );
KeyValue GetSubKey( char *pSubKeyName );
KeyValue GetSubKey( int nIndex );
char *GetSubKeyValue( char *pSubKeyName );
char *GetSubKeyValue( int nIndex );
int IndexOf( char *pSubKeyName );
int NumSubKeys( void );
bool IsParsingSubKeys( void );
bool operator==( KeyValue &other );
bool IsValidIndex( int nIndex );
bool ValidateKeyname( char *pName );
};
#endif
Here is some code that uses it from the dll:
KeyValue kGameData;
kGameData.ParseFromFileManual( "gameinfo.txt", filesystem );
char *pGameDir = kGameData.GetSubKeyValue( "game" );
if( !pGameDir )
pGameDir = "charge";