Posted: Wed Jun 25, 2008 12:45 pm
Maybe it is because std things and c++ is used I dont know, well I've gotta give up as I think I tried everything 

I have no clue what the problem with your library is Polo, sorry.Create a Win32 Project, select Static Library and unselect Precompiled Headers
Paste this code into a new .cpp file:Select Release modeCode: Select all
extern "C" { int answer() { return 42; } };
Go to the project settings and:
Set General -> Whole Program Optimization to "No Whole Program Optimization"
Set C/C++ -> Optimization -> Optimization to "Disabled"
Compile the project
Import the library in Purebasic using ImportC
Use it
Code: Select all
#ifdef __cplusplus
extern "C"
{
#endif//__cplusplus
int __stdcall GetInt()
{
return 132;
}
#ifdef __cplusplus
}
#endif//__cplusplus
Code: Select all
Import "LibTest.lib"
GetInt.l()
EndImport
Debug GetInt()
End
Code: Select all
class CTest
{
private :
int tInt;
public:
CTest(){tInt = 132;}
~CTest();
int __stdcall GetInt(){return tInt;}
};
#ifdef __cplusplus
extern "C"
{
#endif//__cplusplus
CTest* __stdcall createTest()
{
return new CTest();
}
int __stdcall GetInt(CTest* test)
{
if (test)
{
return test->GetInt();
}
return 0;
}
/*
void __stdcall deleteTest(CTest* test)
{
if(test)
{
delete test;
}
test = 0;
}
*/
#ifdef __cplusplus
}
#endif//__cplusplus