0

I am trying to build an application from under Linux for windows, using M cross environment (MXE), that is to say, Mingw. However I have run into a problem: references to functions from the library that I am trying to use remained unresolved.

Here is command line output:

i686-pc-mingw32-g++ -Wl,-s -mthreads -Wl,-subsystem,windows -o
release/LPR_Demo.exe object_script.LPR_Demo.Release 
-L'/home/truskov/mxe/usr/i686-pc-mingw32/qt/lib' -lmingw32 -lqtmain -L/home/truskov/development/lprsdk/LPR/bin/ -lliblpr -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lmng -llcms -L/home/truskov/mxe/usr/i686-pc-mingw32/lib -ltiff -llzma -ljpeg -lQtCore -lpng -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz 

./release/main.o:main.cpp:(.text+0x6): undefined reference to `lpr::ILPR::getLicenseData()'
./release/main.o:main.cpp:(.text+0x15): undefined reference to
`lpr::ILPR::createInstance()' ./release/main.o:main.cpp:(.text+0x38):
undefined reference to `lpr::ILPR::getLicenseData()'
./release/main.o:main.cpp:(.text+0x42): undefined reference to
`lpr::ILPR::createInstance()'
/home/truskov/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.0/../../../../i686-pc-mingw32/bin/ld:
./release/main.o: bad reloc address 0x19 in section
 `.text$_ZN7QStringD1Ev[__ZN7QStringD1Ev]'
/home/truskov/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.0/../../../../i686-pc-mingw32/bin/ld:
final link failed: Invalid operation

Meanwhile in /home/truskov/development/lprsdk/LPR/bin/ are liblpr.lib and liblpr.dll, that do contain desired functions (in visual studio there is no problem in linking to them). What could be the reason for this? Could msvc compiler be to blame for it? (.lib and .dll were compiled in Visual Studio).

tshepang
  • 12,111
  • 21
  • 91
  • 136
Srv19
  • 3,458
  • 6
  • 44
  • 75

1 Answers1

0

In Visual Studio go to Project Properties - General - Project Defaults - Character Set and turn off UniCode option and re-build the related library.

fatihk
  • 7,789
  • 1
  • 26
  • 48