Can't build deal ii tutorials or program which uses deal ii libraries due to unresolved external symbol _compress2 and _compressBound errors

76 views
Skip to first unread message

mbranag

unread,
Mar 15, 2017, 10:31:54 AM3/15/17
to deal.II User Group
Hi all,

I am new to trying to work with deal II and have had trouble getting it working. I currently have been able to compile the deal ii libraries but when I try to build either the first tutorial (step-1) or my own code which is just creating a simple grid mesh similar to that found in step-1 one I get the following error: 

1>deal_II.g.lib(data_out_base.obj) : error LNK2019: unresolved external symbol _compress2 referenced in function "void __cdecl dealii::`anonymous namespace'::write_compressed_block<unsigned char>(class std::vector<unsigned char,class std::allocator<unsigned char> > const &,struct dealii::DataOutBase::VtkFlags const &,class std::basic_ostream<char,struct std::char_traits<char> > &)" (??$write_compressed_block@E@?A0xd9bac495@dealii@@YAXABV?$vector@EV?$allocator@E@std@@@std@@ABUVtkFlags@DataOutBase@1@AAV?$basic_ostream@DU?$char_traits@D@std@@@3@@Z)
1>deal_II.g.lib(data_out_base.obj) : error LNK2019: unresolved external symbol _compressBound referenced in function "void __cdecl dealii::`anonymous namespace'::write_compressed_block<unsigned char>(class std::vector<unsigned char,class std::allocator<unsigned char> > const &,struct dealii::DataOutBase::VtkFlags const &,class std::basic_ostream<char,struct std::char_traits<char> > &)" (??$write_compressed_block@E@?A0xd9bac495@dealii@@YAXABV?$vector@EV?$allocator@E@std@@@std@@ABUVtkFlags@DataOutBase@1@AAV?$basic_ostream@DU?$char_traits@D@std@@@3@@Z)

I have google extensively for similar problems but am unable to come up with any solutions. Any help would be greatly appreciated.

Please let me know if you need any more information.

Thanks,
Michael

Jean-Paul Pelteret

unread,
Mar 15, 2017, 11:12:18 AM3/15/17
to deal.II User Group
Hi Michael,

That output looks very strange. Which operating system and compiler are you using?

Kind regards,
Jean-Paul

mbranag

unread,
Mar 15, 2017, 11:20:31 AM3/15/17
to deal.II User Group
I am compiling on Windows 10 using Visual Studios so Microsoft C/C++ Compiler. For deal ii and step-1, I used cmake and then built using VS.

Jean-Paul Pelteret

unread,
Mar 15, 2017, 11:31:00 AM3/15/17
to deal.II User Group
Ah ok, I suspected as much. Windows support is still "experimental"  (although some work is being done in this regard). However, I understand that installing deal.II though the bash subsystem is possible. Maybe others who use Windows could offer some additional advice. If you don't have much luck then there's also a virtual machine that you could run in Windows.

Wolfgang Bangerth

unread,
Mar 15, 2017, 3:25:59 PM3/15/17
to dea...@googlegroups.com
On 03/15/2017 08:31 AM, mbranag wrote:
>
> 1>deal_II.g.lib(data_out_base.obj) : error LNK2019: unresolved external symbol
> _compress2 referenced in function "...

This is a function in zlib, a compression library. We only call it if we could
find zlib during the run of cmake, and have the following code at the top of
the file:

#ifdef DEAL_II_WITH_ZLIB
# include <zlib.h>
#endif

The fact that this code compiled to begin with means that the header file
zlib.h exists on your system. It's not clear to me, however, why it doesn't link.

When you compile the tutorial program, can you do
make VERBOSE=1
to get the complete command line for the linker? Or get this information in
some other way when linking the tutorial? I'm asking because there should be
an indication that it actually links with the zlib and I'd like to understand
how exactly it does that and what may go wrong in the process.

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

mbranag

unread,
Mar 15, 2017, 6:51:00 PM3/15/17
to deal.II User Group, bang...@colostate.edu
I added the verbose statement and then compiled. I have attached the resulting output file.

Thanks,
Michael
Step1FailedLink.txt

mbranag

unread,
Mar 15, 2017, 6:55:06 PM3/15/17
to deal.II User Group, bang...@colostate.edu
I am also currently installing it through the bash subsystem so I can give feedback on that when that occurs.

Thanks,
Michael
Reply all
Reply to author
Forward
0 new messages