I created a custom c++ framework using XCode and overall it works like a charm. Except recently i've been having a problem with the stl library which is kind of a major drawback. So i'm wondering if anyone has ever encountered this before and has a solution for it.
Details of the implementation of a class in the framework :
CRandomUtils is a class with alot of static helper fonctions to generate different sorts of noise ( perlin, poisson, gaussian ) maps.
The code in an application using this class :
The compiling error :
I can however change the declaration of the method to use raw pointers and it all works fine except I would really like to use the stl library to do this stuff.
Did anyone ever encounter this ? What was your solution ?
Thanks for the help
Details of the implementation of a class in the framework :
Code:
namespace Odd
{
namespace Utils
{
class CRandomUtils
{
public:
... ( other methods )...
static void GenerateUnitVectors( vector<CVector3>& Samples, const int NbSamples );
private:
CRandomUtils( void ) {}
~CRandomUtils( void ) {}
};
}
}
CRandomUtils is a class with alot of static helper fonctions to generate different sorts of noise ( perlin, poisson, gaussian ) maps.
The code in an application using this class :
Code:
#include <vector>
#include <Odd/Vector3.h>
#include <Odd/OGLTexture2D.h>
#include <Odd/RandomUtils.h>
using namespace std;
using namespace Odd::Math;
using namespace Odd::OpenGL;
using namespace Odd::Utils;
...
vector<CVector3> NoiseMap;
CRandomUtils::GenerateUnitVectors( NoiseMap, 64 * 64 );
CVar::m_TextureNoise = new COGLTexture2D();
CVar::m_TextureNoise->Load( &NoiseMap[ 0 ], GL_RGB, GL_FLOAT, 64, 64, GL_LINEAR, GL_LINEAR );
The compiling error :
Code:
cd /Users/Olivier/Dev/C++/ScreenSpaceAmbientOcclusions
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/Olivier/Dev/C++/ScreenSpaceAmbientOcclusions/build/Debug -L/opt/local/lib -F/Users/Olivier/Dev/C++/ScreenSpaceAmbientOcclusions/build/Debug -F/Users/Olivier/Dev/C++/ScreenSpaceAmbientOcclusions/../Odd/build/Debug -filelist /Users/Olivier/Dev/C++/ScreenSpaceAmbientOcclusions/build/ScreenSpaceAmbientOcclusions.build/Debug/ScreenSpaceAmbientOcclusions.build/Objects-normal/i386/ScreenSpaceAmbientOcclusions.LinkFileList -mmacosx-version-min=10.5 -framework OpenGL -framework GLUT -lglew -lfreeimage -framework Odd -o /Users/Olivier/Dev/C++/ScreenSpaceAmbientOcclusions/build/Debug/ScreenSpaceAmbientOcclusions
ld warning: std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)has different visibility (hidden) in /opt/local/lib/libfreeimage.a(PluginEXR.o-i386) and (default) in /Users/Olivier/Dev/C++/ScreenSpaceAmbientOcclusions/build/ScreenSpaceAmbientOcclusions.build/Debug/ScreenSpaceAmbientOcclusions.build/Objects-normal/i386/Main.o
Undefined symbols:
"Odd::Utils::CRandomUtils::GenerateUnitVectors(__gnu_debug_def::vector<Odd::Math::CVector3, std::allocator<Odd::Math::CVector3> >&, int)", referenced from:
Initialize() in Main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
"Odd::Utils::CRandomUtils::GenerateUnitVectors(__gnu_debug_def::vector<Odd::Math::CVector3, std::allocator<Odd::Math::CVector3> >&, int)", referenced from:
Initialize() in Main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I can however change the declaration of the method to use raw pointers and it all works fine except I would really like to use the stl library to do this stuff.
Did anyone ever encounter this ? What was your solution ?
Thanks for the help