Minisat in Visual studio

264 views
Skip to first unread message

shrek

unread,
Apr 18, 2009, 2:35:07 PM4/18/09
to MiniSat
Hi,

I'm trying to run Minisatv 1.14 in microsoft visual studio 2005.
Initially there were a few problems even getting it to recognize
formats, but those were solved by renaming .c to .cpp And then
downloaing zlib.h files.

But I'm still unable to compile with a small number of errors

1>Main.obj : error LNK2019: unresolved external symbol _gzclose@4
referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _gzopen@8
referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _gzdopen@8
referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _gzread@12
referenced in function "private: void __thiscall
StreamBuffer::assureLookahead(void)" (?
assureLookahead@StreamBuffer@@AAEXXZ)
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol
_WinMain@16 referenced in function ___tmainCRTStartup
1>Debug\test.exe : fatal error LNK1120: 5 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\KEDAR
\Desktop\MiniSat_v1.14\Debug\BuildLog.htm"
1>test - 6 error(s), 2 warning(s)


Any suggestions would be greatly appreciated.

Niklas Sörensson

unread,
Apr 18, 2009, 3:46:02 PM4/18/09
to min...@googlegroups.com

The "zlib.h" include file is not enough. You have to install a
corresponding library file as well.

/Niklas

shrek

unread,
Apr 19, 2009, 2:58:14 AM4/19/09
to MiniSat
Hi Niklas,

Thanks a lot for your reply. Since I didn't find the zlib library on
windows, I have switched to use Code::blocks on linux. On Linux, I can
run it from command line by compiling the Makefile, but am unable to
run it in the debugger. (Same error - undefined reference to gzopen,
gzread, gzclose etc show up, this even after installing zlib1g and
zlib-devel packages)

I'm trying to use it in a debugger so that I can make a few
modifications. Please let me know If there are any debuggers on linux/
windows that work with minisat or in case there is a trick I'm missing
w.r.to code:;blocks and minisat. I really appreciate your help.

Thanks,
Srikar.

On Apr 18, 3:46 pm, Niklas Sörensson <nikla...@gmail.com> wrote:

Niklas Sörensson

unread,
Apr 19, 2009, 11:16:26 AM4/19/09
to min...@googlegroups.com
On Sun, Apr 19, 2009 at 8:58 AM, shrek <sri...@gmail.com> wrote:
>
> Hi Niklas,
>
> Thanks a lot for your reply. Since I didn't find the zlib library on
> windows,

I know that it is possible to install zlib on windows, but I'm no
expert on that. Anybody else who has experience with this?

> I have switched to use Code::blocks on linux. On Linux, I can
> run it from command line by compiling the Makefile, but am unable to
> run it in the debugger. (Same error - undefined reference to gzopen,
> gzread, gzclose etc show up, this even after installing zlib1g and
> zlib-devel packages)

What is it that doesn't work? Is it building MiniSat or running it
within the debugger?

If you are having trouble building, it may be the case that zlib is
installed in a directory that is not available to the compiler out of
the box. Find out where the library (libz.a) is and add that directory
to be searched during linking. In the makefile, add "-L<the-dir>" to
the LFLAGS-variable.

> I'm trying to use it in a debugger so that I can make a few
> modifications. Please let me know If there are any debuggers on linux/
> windows that work with minisat or in case there is a trick I'm missing
> w.r.to code:;blocks and minisat. I really appreciate your help.

Debugging with gdb works out of the box on Linux if you have installed
zlib. I expect that codeblocks uses gdb so it probably should work
too. I can not say more since I'm not familiar with codeblocks.

Cheers,

/Niklas

shrek

unread,
Apr 24, 2009, 3:00:42 PM4/24/09
to MiniSat
Niklas,

thanks a lot I managed to compile the code after adding libz.a in the
linker settings. Interesting that although it is situated in /usr/
lib , the compiler didn't find the library.
Once again thanks,
Srikar
Reply all
Reply to author
Forward
0 new messages