# DllNotFoundException with MONO's Doc2x.exe



## Satay (Jun 20, 2012)

[ Double-posted threads merged and rewritten -- Mod. ]

Hi all, 

I'm using MONO for about five months on Windows and FreeBSD (I found no problems with that until I try to use conversion of a *.doc file to *.docx file that gives me doc2x.exe tool (tool that should work fine in FreeBSD with MONO). First I've got some problem with finding zlibwapi.dll (this is an external library that another internal library - ZipUtils.dll - use to generate an XML format of output *.docx file). I read about mapping of DLL's in MONO and create ZpiUtils.dll.config file. After that doc2x.exe start to search libzlibwapi.so (library that can be used in FreeBSD). Unfortunately this library cannot by found by the tool. I've tried to compile the library under FreeBSD but with no success (manual in ReadMe.linux file). 

Then I try to use an information stored in ReadMe.linux file (source folder of zlib library).



> For using the b2xtranslator under Linux, Mono (http://www.mono-project.com/)
> is required. Additionally, the zlib must be available to mono.
> 
> ```
> ...



Unfortunately this compilation instruction didn't work. Last I found was FAQ of tool in which I found this instruction for UNIX OS:



> To compile all files and run the test program, follow the instructions given at
> the top of Makefile. In short "make test; make install" should work for most
> machines. For Unix: "./configure; make test; make install". For MSDOS, use one
> of the special makefiles such as Makefile.msc. For VMS, use make_vms.com.



Next time command stored in this instruction are not working. When I try to use this commands I saw these messages:
- *make test* (in zlib123 folder):







- *./configure*


> ./configure: Command not found.



- *make install*






I'm a beginner in Unix OS so please help me to run this tool.

This tool should be executed by this statement: `mono doc2x.exe doc_file -v 4` (-v 4 gives a debug mode in which user can see error message: 
	
	



```
System.DLLNotFoundException: libzlibwapi.so
```
). 

Here's were you can find this tool: http://sourceforge.net/projects/b2xtranslator/

Thanks for any advice.


----------



## SirDice (Jun 20, 2012)

Try gmake(1) (requires devel/gmake) instead of make(1). FreeBSD's make is different compared to GNU make and most third party software expect the GNU one.


----------



## DutchDaemon (Jun 20, 2012)

Satay, stop double-posting! When a post is held for moderation, do NOT post it again! And read the forum rules in your email/PM before you proceed.


----------



## Satay (Jun 20, 2012)

Sorry for that. As you can see, I wrote first post at 8, and after I didn't so it I wrote second one. It was not a post but a new thread which forum's method merge with old one. 

My mistake.


----------



## SirDice (Jun 20, 2012)

Read your signup email. Your first 10 posts are moderated before they appear on the board.


----------



## Satay (Jun 20, 2012)

SirDice said:
			
		

> Try gmake(1) (requires devel/gmake) instead of make(1). FreeBSD's make is different compared to GNU make and most third party software expect the GNU one.



Thanks for reply. After i try this "gmake test" or "gmake install", i've got this message:



> ', needed by 'libz.a'. Stop.rget '\



Is it right? I think there's another problem? Am I right?


----------



## DutchDaemon (Jun 20, 2012)

The forums don't merge anything. I had to manually edit four of your posts into the two new ones. Moreover: there was a message on your screen for 30 seconds in both cases (I know, I put it there) telling you to wait for a post to be moderated and to not post the same thread/post again. It's important to read stuff on these forums.


----------



## Satay (Jun 20, 2012)

Yes, I know. My fault. It will not happen again.


----------



## Satay (Jun 25, 2012)

Can anybody help me with this problem? Last I tr*ied* was [cmd=]gmake install[/cmd] After that I saw 
	
	



```
needed by 'libz.a'. Stop.rget
```
 problem. I found libz.a in the /src/lib directory. I even tr*ied* to copy it into the folder where all files of the target library are.


----------



## freethread (Jul 4, 2012)

I'm not sure if I understood the troubles you're running on. You can compile the executable? If yes then copy the file in the zip lib/libzlibwapi.so where the compiled executable is and it should works as stated by the readme file:


> # Mono looks for libraries in three places:
> # * *In the current directory*
> # * In directories specified by the $LD_LIBRARY_PATH environment variable
> # * By querying the system's dynamic linker (ldconfig)'s cache (/etc/ld.so.cache)



This is not a FreeBSD port, so it's better you keep custom executables and libraries in custom directories, i.e. /usr/local/mytools (or whatever you want that don't clash with system defaults) and copy there the executable and the library.
If it doesn't works, that is the library must be accessible by mono and not by the CLR code, than in your shell startup script add the path containing the library (in prev example /usr/local/mytools) to the variable LD_LIBRARY_PATH.

I'm not tested it, I only downloaded the zip and look into it.


----------



## Satay (Jul 5, 2012)

Yes, but if You have a look, there's an information, that libzliwapi.so library which was included to zip file was compiled for Linux. So I need to compile this library for FreeBSD.

Any other sugestions?


----------



## freethread (Jul 5, 2012)

I'm not the right person to reply to this kind of messages, due to my knowlwdge (Windows).

Anyways.

Still I only got a look to sources not try to compile it, actually I'm on a notebnook (up to next week) and cannot compile it for FreeBSD.

To compile libzlibwapi you have to compile some files in <root>/src/AdditionalTools/zlib123/contrib/minizip and link against libz.so (Makefile in the above directory).

Unless you want to make a port of this program, you can write your own Makefile that compile the library using the system zlib library located at /usr/lib/libz.so, i.e. compile the files specified by *SOURCE* variable in that Makefile and link as defined for rule *libzlibwapi.$(DLLEXT):* (in the *else* part).


----------

