Page 1 of 1

Linking wxPDFView error

Posted: Tue Jan 01, 2019 12:14 pm
by dkaip
Hello.
After so time finaly i made wxPDFView lib at C:\wxPDFView\build\Debug folder(files wxPDFView.lib and wxPDFView.pdb) following the instruction exactly.

Now i am try to build Simple.cpp sample.
mingw32-g++.exe -w -std=c++14 -g -D__WXDEBUG__ -std=c++14 -IC:\wxWidgets-3.0.4\include -IC:\wxWidgets-3.0.4\lib\gcc_lib\mswu -I..\..\include -c C:\wxPDFView\samples\simple\Simple.cpp -o obj\Debug\Simple.o

ok produce Simple.o at C:\wxPDFView\samples\simple\obj\Debug folder.

But trying linker ...
mingw32-g++.exe -LC:\wxWidgets-3.0.4\lib\gcc_lib -o bin\Debug\Sample.exe obj\Debug\Simple.o -static C:\wxWidgets-3.0.4\lib\gcc_lib\libwxexpat.a C:\wxWidgets-3.0.4\lib\gcc_lib\libwxjpeg.a C:\wxWidgets-3.0.4\lib\gcc_lib\libwxmsw30u.a C:\wxWidgets-3.0.4\lib\gcc_lib\libwxmsw30u_gl.a C:\wxWidgets-3.0.4\lib\gcc_lib\libwxpng.a C:\wxWidgets-3.0.4\lib\gcc_lib\libwxregexu.a C:\wxWidgets-3.0.4\lib\gcc_lib\libwxscintilla.a C:\wxWidgets-3.0.4\lib\gcc_lib\libwxtiff.a C:\wxWidgets-3.0.4\lib\gcc_lib\libwxzlib.a ..\..\build\Debug\wxPDFView.lib -mwindows
i am taking ...
Warning: corrupt .drectve at end of def file
..\..\build\Debug\wxPDFView.lib(wxPDFView.dir/Debug/PDFViewThumbnailListBox.obj):(.text$mn+0x26): undefined reference to `__security_cookie'
..\..\build\Debug\wxPDFView.lib(wxPDFView.dir/Debug/PDFViewThumbnailListBox.obj):(.text$mn+0x55): undefined reference to `?
Create@wxVListBox@@QAE_NPAVwxWindow@@HABVwxPoint@@ABVwxSize@@JABVwxString@@@Z'
.....................
What i am doing wrong?
Thank's
Jim

Re: Linking wxPDFView error

Posted: Tue Jan 01, 2019 3:35 pm
by doublemax
Is wxVListBox the only reference missing or are there more errors?
That would be strange because is defined in the "core" library that should always be included.

Regarding the missing "__security_cookie":
https://stackoverflow.com/questions/216 ... ity-cookie

Regarding "Warning: corrupt .drectve at end of def file":
After some Googling it seems that this happens when you use MSVC libraries with GCC. Are you doing that? That could explain the other errors, too.

Re: Linking wxPDFView error

Posted: Tue Jan 01, 2019 5:06 pm
by dkaip
Yes, that is exactly, i use MSVC libraries with GCC...
I always use CodeBlocks and GCC. In Linux i connect pdfium with gcc easy.
But in windows compilation process use MSVC, that is i hate, the using of vs and ms tools.
But there is need to have a pdfiewer in windows, so i just build wxPDFView following exactly the instructions.
But this building depends from MSVC libraries and the connection is the problem.
There is some way to over this?
Thank you
Jim.

Re: Linking wxPDFView error

Posted: Wed Jan 02, 2019 10:49 am
by doublemax
After Googling a bit, it seems impossble to link MSVC libs with GCC. So you either need to find a way to build pdfium with GCC or use the MSVC compiler for everything. I don't know if pdfium supports that, but another option could be to use MSVC to create a pdfium DLL instead of a static library.