简体   繁体   中英

Libiconv C++ Builder

I'm currently trying to integrate the ZBar library to an application built in C++ Builder (XE6). However, the ZBar library depends on iconv which is not originally available in Windows, so I managed to get a static library of iconv for windows : "libiconvStatic.lib".

Then I tried to import it to my project this way (I'm not sure the first line is necessary though) :

#define USING_STATIC_LIBICONV
#include <iconv.h>

#pragma comment (lib, "libiconvStatic.lib")

The functions from iconv which are called in the file are iconv_open() , iconv() and iconv_close() .

I get through the compilation but get an error from the linker :

[ilink64 Error] Fatal : Invalid object file '/72'

I already tried with both 32bits and 64bits versions of the libiconvStatic.lib .

Do you know why the .lib is not recognized and how to solve this problem? Or any other way to make use of iconv in Windows (and C++ Builder) ?

Thank you.

As mentioned in comments: you should build the library with C++Builder directly, as the object file format is different between MSVC and C++Builder.

Alternatively, you could build a dynamic version of the library with MSVC, and just do implib libiconv.lib libiconv.dll to generate a C++Builder compatible library from the DLL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM