User forums > Using Code::Blocks
Issues in importing a MS Visual C++ .NET 2003 solution
Michael:
Ok, I see. Thanks for the explanation. Personally, I have always installed MS Visual Studio .NET 2002 and later 2003, so I could not really notice it.
Anyway, let me congratulate again for the good job you are doing with CodeBlocks :D and I hope that you will continue in the future. Until now it is the best alternative after MS Visual Studio .NET 2003.
Best wishes,
Michael
alixia:
I´m still having the problem:
error LNK2019: unresolved external symbol __ftol2
I´ve proved to put the next lines of code in my c file:
#if (_MSC_VER >= 1300) && (WINVER < 0x0500)
//VC7 or later, building with pre-VC7 runtime libraries
extern "C" long _ftol( double ); //defined by VC6 C libs
extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#endif
but now the problem is the string "C", it isn´t recognized by the compiler maybe. I´ve installed the microsotf c++ 2003 toolkit.
I don´t understand.
Urxae:
--- Quote from: alixia on October 19, 2005, 06:31:36 pm ---I´m still having the problem:
error LNK2019: unresolved external symbol __ftol2
I´ve proved to put the next lines of code in my c file:
#if (_MSC_VER >= 1300) && (WINVER < 0x0500)
//VC7 or later, building with pre-VC7 runtime libraries
extern "C" long _ftol( double ); //defined by VC6 C libs
extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#endif
but now the problem is the string "C", it isn´t recognized by the compiler maybe. I´ve installed the microsotf c++ 2003 toolkit.
I don´t understand.
--- End quote ---
It should be, unless you're not compiling it as C++. (note: C doesn't support extern "<language>" declarations, that's a C++ addition)
If you're trying to compile it as both C and C++, try something this:
--- Code: ---#if (_MSC_VER >= 1300) && (WINVER < 0x0500)
#ifdef __cplusplus
extern "C" {
#endif
//VC7 or later, building with pre-VC7 runtime libraries
long _ftol( double ); //defined by VC6 C libs
long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#ifdef __cplusplus
} // extern "C"
#endif
#endif
--- End code ---
or this:
--- Code: ---#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C
#endif // __cplusplus
#if (_MSC_VER >= 1300) && (WINVER < 0x0500)
//VC7 or later, building with pre-VC7 runtime libraries
EXTERN_C long _ftol( double ); //defined by VC6 C libs
EXTERN_C long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#endif
--- End code ---
alixia:
No, those possible solutions don´t work. The message is the next:
error LNK2001: unresolved external symbol __ftol@8
error LNK2001: unresolved external symbol __ftol2
I don´t know what to do because I need solve this problem to continue my program! :,(
rickg22:
it seems you forgot to add a library to the link libraries list in your project. You need to find out which VC6 library has these contained in, and link it.
Code::Blocks does NOT add the libraries for you! You need to figure them out on your own.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version