?
Solved

Compile Ntop for win32

Posted on 2008-11-18
63
Medium Priority
?
7,956 Views
Last Modified: 2013-12-14
I have been trying for the past 48 hours to get all the errors to go away and create a successful build of Ntop version 3.3.8 for Windows. I know nothing about windows compilers, I'm using the ones we have a work (Visual C++ 6.0 and C++ 2008) without much luck. 2008 seems to be more helpful than the older 6.0
I've also tried MinGW, but either it doesn't work or I can't follow along properly with what I've found online about mingw and ntop 3.2... something has change in 3.3 I guess...
According to Ntop's doc's, which are very very out dated, MinGW and or Visual C++ can be used, I can't get either to work. I would simply like a step by step instructions on how it's done. The doc's are lacking, and OpenXtra stopped porting it :( I can compile on Linux, but I have clients that refuse to let *nix on their network, they think it's some mystical thing...
0
Comment
Question by:Rich Rumble
  • 24
  • 18
  • 13
  • +1
59 Comments
 
LVL 53

Accepted Solution

by:
Infinity08 earned 0 total points
ID: 22992784
Get the stable tar file from :

        http://freshmeat.net/projects/ntop/

The docs/BUILD-MinGW.txt file contains the information needed to build from source on MingW (http://www.mingw.org/).

Make sure that the dependencies are installed correctly (WinPCAP, GD-chart, GD, PNG, Zlib, GNU database, OpenSSL). See the docs/BUILD-MinGW.txt file for information on where to get them.

Then just follow the step-by-step process described in docs/BUILD-MinGW.txt.


Can you tell me at which point you have a problem ?



Did you consider using the pre-compiled Windows binary ?

        http://www.ntop.org/download.html

More info on that pre-compiled Windows binary :

        http://www.ntop.org/support.html
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 22994017
The win32 binary is limited and registering is not free, and a donation doesn't allow you to get an unrestricted copy. http://www.nmon.net/shop/cart.php
Also, as I said, the instructions in the build-mingw file lack detail.
I've DL'd all the source code I should need, ssl, libpng,gd... etc. I do not have rm, sed, mkdir and man2html, I don't think I need them. The next step says...
1) Install and build all prerequisites.
So now I have to make(literally) each one of those too? And those fail to make for me when using the mingw make files provided by most.
Step 2, completed, I edited the paths
Step 3 and 4 , there is no "make" there is mingw32-make.exe but again doesn't work.

So if someone could get ntop compiled on their own machine, and during the process document it properly, because the Ntop team has failed to do so, that's all I need. It's just the fact that I've never "made" anything FOSS on M$, and lack the knowledge to do so properly. I know how to solve issues using make/configure on *nix, but I can't seem to on M$ :(
-rich


0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22994425
>> The win32 binary is limited and registering is not free

I know. Just asking if you considered it ;)


>> Also, as I said, the instructions in the build-mingw file lack detail.

I understand that, but I wanted to know which ones specifically cause problems.


>> 1) Install and build all prerequisites.
>> So now I have to make(literally) each one of those too?

Often, there are pre-built binaries available, that you can simply place in the library and include path. For those that aren't available for your platform, you'll indeed need to build them yourself from source.


>> And those fail to make for me when using the mingw make files provided by most.

Let's take on those problems one at a time. What's the first problem you encountered ?


>> Step 3 and 4 , there is no "make" there is mingw32-make.exe but again doesn't work.

mingw32-make.exe is ok. It won't work, because the dependencies aren't all available. You need to complete step 1 first.



>> So if someone could get ntop compiled on their own machine, and during the process document it properly, because the Ntop team has failed to do so, that's all I need.

It's really not complicated. The step-by-step process in the build txt file should be sufficient - following these steps gives you a binary, assuming there are no errors along the way.

The real problem is dealing with errors, and there's no way to cover all possible errors in a document. When you encounter an error, you need to find out what causes it, fix the problem, and try again. In case of a standard error (dependency missing or a tool missing or something), the way to resolve it is straightforward. For errors that are less easy to understand, you can look on the internet (often somebody else will have experienced the exact same error), or ask on here.

How to build the dependencies will be explained in similar build txt files for those dependencies.


So, if I were to build ntop on my machine, the step-by-step process would be exactly the same as the one in the build txt file you have.
I will encounter certain errors, which I could document. But those will not necessarily be the same errors you'll get (actually most likely you'll get others), so I don't see a lot of sense in this.
A better way to approach this would be that you mention the errors you get (and don't know how to fix) here, and we can help you fix them.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 38

Author Comment

by:Rich Rumble
ID: 22994699
I don't think the instructions are correct, and the dsw/dsp files in ntop-3.3.8\packages\Win32\ntop-VC6-project.zip are too old to work for C++ compilers. This may be sarcastic, but I'd like to see you try to build it. It's probably the frustration talking...
Installed MinGW (full)... I suspect I'll need to use MSYS but the instructions don't say so.

Errors, we'll start with libpng
C:\MinGW\libpng\libpng-1.2.33>c:\MinGW\bin\mingw32-make.exe -f Makefile.mingw
process_begin: CreateProcess(NULL, cygpath -m `pwd`, ...) failed.
process_begin: CreateProcess(NULL, basename, ...) failed.
process_begin: CreateProcess(NULL, cygpath -m `pwd`, ...) failed.
process_begin: CreateProcess(NULL, basename, ...) failed.
'sed' is not recognized as an internal or external command,
operable program or batch file.
process_begin: CreateProcess(NULL, cygpath -m `pwd`, ...) failed.
process_begin: CreateProcess(NULL, basename, ...) failed.
../-src/configure --prefix="c:/progra~1/" --srcdir="../-src"
'..' is not recognized as an internal or external command,
operable program or batch file.
mingw32-make: *** [CONF] Error 1

I just want a guide that works on 3.3
http://tech.scottp.net/index.php/2006/09/14/instructions-on-how-to-build-ntop-for-windows-for-the-non-programmer/ Also lacking many many details and fails.
-rich
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 22994961
I meant to rephrase the dsw/dsp files line to say, that they are too old to support the current version, as some of the files in the list are deprecated for modern builds of png, zib etc...
-rich
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22995644
>> This may be sarcastic, but I'd like to see you try to build it. It's probably the frustration talking...

I know it's not always straightforward to build Unix code under Windows.


>> Errors, we'll start with libpng

You can get a pre-compiled libpng  for Windows from here (libpng-1.2.33-bin.zip) :

        http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16183
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22995681
>> I just want a guide that works on 3.3

Such a guide will always be lacking detail, since it's impossible to cover all problems that might occur.

It's true that a bit more documentation would be nice, but that's the general approach in the open source world ... you learn to do things yourself with very generic instructions. The more you perform such installations, the easier they get.
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 22996151
True... however you can see that for someone new to compiling on M$ would have excessive trouble with said Ntop guide. I think even a pro would, I prefer ntop on *nix and I have no problem getting it on there, I do have several clients however that would benefit from Ntop, but don't want linux, even a live-cd form of it, on their networks because they can't be convinced it's not a fad... As funny as that is, that's what I'm dealing with. I like OpenXtra's port, however they stopped sharing it, and I didn't particularly like their launcher that installs with it. I just wanted to build the latest stable build of ntop with some very much needed help.
I'll leave the question open for a week or so. I know not every scenerio or error can be resolved the same for everyone, but a MORE detailed version of an install is certainly doable. Ntop seems to have this mystic stigma for M$... the mailing lists offer no help for it, and the community as far as I can tell from my seraching doesn't either. I keep being told it will just work, but it doesn't.
DL zlib source from here: xyz.com
extract to here c:\some_folder\zlib
DL winpcap devel from here: blah blah...
extract to ...
...
cd to zlib run: mingw32-make.exe -f Makefile.mingw
cd to ... run
etc...
-rich
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23002045
>> True... however you can see that for someone new to compiling on M$ would have excessive trouble with said Ntop guide.

I understand that.


>> I think even a pro would

It's not straightforward, and it takes time indeed. That's why I suggested looking for pre-compiled binaries first, and only compile it yourself as a last resort.


>> Ntop seems to have this mystic stigma for M$... the mailing lists offer no help for it, and the community as far as I can tell from my seraching doesn't either.

Well, that's the same for pretty much every Unix application that can be compiled under Windows.



>> I keep being told it will just work

It should, if your environment is just right. The problem is, that every environment is different, which is why different errors will occur for everybody.



Anyway, I can't solve the documentation problem. What I can do, is work through the errors with you, and provide assistance where needed. If that's ok with you, then let's do it :)

If libpng is installed now, we can continue with the next dependency.
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23005098
I can compile the VSC++ stuff... here is my guide thus far...

Downloaded http://sourceforge.net/project/downloading.php?groupname=libpng&filename=lpng1233.zip
Downloaded zilb from: http://www.zlib.net/zlib-1.2.3.tar.gz
Unziped libpng to c:\mingw\libpng
untared zlib to c:\mingw\zlib
Open Visual C++ 6
File>open>(browse to: C:\MinGW\lpng\projects\visualc6) libpng.dsw
Select "Build > Set Active Configuration" ( i built pngtest release and libpng-dll release)
Select "Build > Clean"
Select "Build > Build ... (F7)"
Last lines of output were: libpng passes test / pngtest.exe - 0 error(s), 0 warning(s)
(running pngtest.exe shows failure, but things are built so I don't think it matters?)
LibPNG also seem to build zlib at the same time, so those seem to be built too.
I'm not sure how to build these with minGW, a similar guide would be easy to make, I'm not sure if MinGW can compile with the supplied makefile's for lpng and zlib.
Downloaded gdbm source: ftp://ftp.roth.net/pub/ntperl/gdbm/source/Win32_GDBM_Source.zip
This is a library, I don't think there is anything to compile...
Not sure if I need the compiled stuff... http://www.libgd.org/releases/gd-latest-win32.zip or the source: http://www.libgd.org/releases/gd-latest.tar.gz from the doc's they say I'm crazy to want to compile myself... moving on using the pre-compiled... placed in c:\mingw\gd
Downloaded openssl: http://www.openssl.org/source/openssl-0.9.8i.tar.gz
read install.w32, great now I need perl... ran this command
perl Configure VC-WIN32 --prefix=c:/some/openssl/dir
seems ok, output was Configured for VC-WIN32.
cd to the ms dir, run the various "do" batch files all fail, try the mingw compile it fails with can't find this or that dir... giving up for now, my will to live is being sucked dry...
-rich









0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23011209
>> Unziped libpng to c:\mingw\libpng
>> untared zlib to c:\mingw\zlib

Just a tip - it's easy to have a central include and lib directory. You can then place all header files for the dependencies in the include directory, and all dependency libraries in the lib directory. Your compiler has probably already set up such central directories.

If all dependencies are placed there, it makes including them in a project so much easier.


>> (running pngtest.exe shows failure, but things are built so I don't think it matters?)

Depends what the failure is. If it has nothing to do with the correct operation of the library, it's fine.


>> I'm not sure how to build these with minGW, a similar guide would be easy to make, I'm not sure if MinGW can compile with the supplied makefile's for lpng and zlib.

If you have a MingW specific makefile for it, then use that. Otherwise, revert to the gcc makefile, and port it to Windows.
But again - why do it the hard way ? Why not just use pre-compiled binaries ?


>> Downloaded gdbm source: ftp://ftp.roth.net/pub/ntperl/gdbm/source/Win32_GDBM_Source.zip
>> This is a library, I don't think there is anything to compile...

If it's source, it needs to be compiled. The library file will be the result of that compilation.

But again, you can get pre-compiled binaries here :

        http://gnuwin32.sourceforge.net/packages/gdbm.htm

(a setup application even, to make your life even easier)


>> Downloaded openssl: http://www.openssl.org/source/openssl-0.9.8i.tar.gz

Get the pre-compiled binaries here :

        http://www.slproweb.com/products/Win32OpenSSL.html



>> giving up for now, my will to live is being sucked dry...

That's because you're making your life harder than it needs to be ;) Pre-compiled binaries are your friend ;)
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23016259
I've got them installed, now what... I changed the makefile.mingw to what i think are the proper paths...
GDCHART_ROOT = C:\MinGW\gd
GD_ROOT      = C:\MinGW\gd
PNG_ROOT     = C:\MinGW\lpng
ZLIB_ROOT    = C:\MinGW\zlib
GDBM_ROOT    = C:\MinGW\gdbm
PCAP_ROOT    = C:\MinGW\pcap\WpdPack\Include
OPENSSL_ROOT = C:\MinGW\openssl\include

Attached are the errors I'm getting now, I figured out half of them, this is now whats left...
I've changed some paths and copied files to different locations basically...
-rich


make-ntop-mingw-depend.txt
make-ntop-mingw.txt
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23025603
>> I've got them installed

As I said earlier, it would be easier if you'd install them in the standard location (system include and lib folders).


>> bpf.h:68: error: syntax error before "bpf_u_int32"

What are the contents of that file ?
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23130954
I've tried for over 2 weeks now, I can't do it, I don't think anyone here can. I'll leave it open for a few more days, I've contacted the resources (bloggers/open-xtra) I found on the web and been refused out right or ignored, such a waste that no one will compile a simple guide for the latest version.
-rich
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23131163
>> such a waste that no one will compile a simple guide for the latest version.

As I explained earlier - there's no such thing as a simple guide. If everything goes well, it's straightforward, and you just have to follow teh documentation of each individual library. If there are problems, you need to find the cause and solve it. That's a simple guide, but anything more detailed quickly gets very complicated.

I offered helping you with errors you encountered, and I did ... I don't know what more I can do.
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23132326
This (link) is a simple guide, it's got typos that make it inaccurate, but I did compile the version (finally) that he did, however he left out some steps (include mysql, some typos with changing directories etc...) But I'd say it gets 3 stars out of 5 for accuracy and ease of use.
I had the making of a simple guide in my comment #23005098
http://www.experts-exchange.com/Programming/Languages/CPP/Q_23916660.html# 23005098
Perhaps this question is in the wrong TA? I appreciate your advise, I guess I'm looking for someone to do it for me at this point.
-rich
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23132423
>> I guess I'm looking for someone to do it for me at this point.

Well, I can't do that heh :)
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23132558
What I meant (by do it for me) was...
Crated fresh Xp pro Sp3 Vmware machine
downloaded this, this, this, this and this
Installed this here c:\here
extracted this to c:\here\also
ran this command
added XYZ to my path
copied that to there
copied and then renamed something.c to somethingelse.c
ran "make -some -swiches" and it compiled
That was/is the guide I speak of, I got a hold of someone (who thinks) they can do that, if it works, I'll post it here so that its easy for others to find and follow along.
-rich
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23132623
Good luck :)
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23372845
>> if it works, I'll post it here so that its easy for others to find and follow along.

If you got help elsewhere, then it might be good to post that here, and accept that as a solution.


In any case :

>> Can't be done by anyone from earth.

Is because your request is unreasonable. You ask us to do all the work for you - and even if we would it wouldn't necessarily mean that it'll work for you.
If you follow the guidelines I posted, you should be able to compile it correctly. It will take a lot of time, and you'll have to find solutions for a lot of errors, but that's the nature of the game.
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23373544
If richrumble found the help he needed elsewhere, then he can post that here, and accept that as the solution.

If he didn't (which seems to be the case), I stand by my argument that his request is unreasonable for two reasons :

1) I would be doing all of the work for him, which could take a substantial amount of time.

2) That wouldn't guarantee that it would work for him, since we are working on different platforms/environments.

Furthermore, I provided all information needed for him to do the work himself. I also offered to work through it together with him, but got no response to that.


From my point of view, the first post (http:#22992784) provides the starting point, while my other posts help answer more specific questions and solve more specific problems.
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23377510
I found no help elsewhere, I did make it further using the CVS/SVN download of the source and not what is provided as "source" on Ntop's site. This was in my own findings, nothing here on EE has been any help, so I ask for option
 2) Delete/no refund

I've spent 80+ hour's trying to get this going.. I'm through.
-rich
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23377651
It's always nice to hear that my efforts are appreciated :)
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23404653
I'm sorry, but I'd like to know the reasoning for deleting this question.  I'd expect a decision like this to be explained. I also expect my arguments to be taken seriously, and not simply ignored.

All the information I posted is valid, and should be sufficient as an answer. I'd hate to see that get thrown away because richrumble didn't make use of that information.

At least make it a PAQ/refund, so that my efforts are not entirely wasted.
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23404887
bah... unsubscribe... remove me... calgon take me away...
-rich
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23418304
(a) I don't care about the points. I never did.
(b) I no longer hope for some appreciation from richrumble for my efforts. He has shown clearly that he doesn't want to give me that.
(c) I do care about having spent all this time and effort for nothing. I don't like wasting my time.

I still stand by my argument that his request is unreasonable (see earlier for why this is so), and that I have done everything reasonable to help him.

In summary, I suggest a PAQ/refund. At least my work was not for nothing that way.
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23445329
I have followed this thread with interest as compiling ntop on win32 is something I have also tried (but failed) to achieve.

Please do not delete this question.  It stands as a valid and documented record of the very real difficulty of compiling ntop on Win32.  I can and I do assert that this is a non trivial exercise.

As an "Expert" - albeit not in answering this question - my recommendation is that Comment# 23418304 by Infinity08 be accepted as the answer to this question.

Thanks.

-Rowan
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23445348
Fine with me. PAQ/refund.
-rich
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23447354
Thanks, richrumble. I do realize that this does not solve your problem, and I'm sorry about that. The offer of working through this with you still stands.
But the value of this discussion is useful for future readers of this question, and thus for the PAQ database, which is why I insisted on a PAQ.

I'm glad we came to an agreement :)
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23447637
Well I have spent the ENTIRE day trying to get NTOP to compile in Microsoft VC++ 2008.

I am down to 8 linker errors and there is little to no gaurantee that the program will run even when I eliminate those.

Now something - somewhere - one of these pre-compiled libraries wants libc.lib .... time to find out how I track that down....
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23447706
>> one of these pre-compiled libraries wants libc.lib

libc is the standard C library. Might it be that that pre-compiled library was for a different compiler (like gcc for example) ? Which library is it ?
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23447763
I don't know which library it is and I don't know how to work it out.

The error is:

Error    2    fatal error LNK1104: cannot open file 'LIBC.lib'    NTOP-3.3.9    NTOP-3.3.9

I have written a HelloWorld program and linked it with every library that NTOP is linking with but the error does not occur, it just works :-/

I found this and have for now added a directive to ignore the library libc.lib - this now gives me a stack of new link errors (8) but they are workable ones...

http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/22f1d8b8-9abb-4a32-b5f7-565dc396e0aa/

Something to do with libc.lib existing in VC6 but not in VC2003 onwards and some backwards compatibility issues...


0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23447812
So, the lib was compiled for an older version of VC. It might be better to re-compile it for your version of VC.

>> I don't know which library it is and I don't know how to work it out.

The library you added just before this link error started appearing is likely the one. You can also work backwards by removing libraries from the link command until the error disappears.
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23447877
Wow, thanks!!  Turns out it was zlib I had linked with a statically compiled zlib, once I linked with the non statically compiled one the error went away - which makes perfect sense now that I think about it!
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23447905
This is what I have left:

Error    1    error LNK2005: __snprintf already defined in util.obj    MSVCRT.lib    NTOP-3.3.9
Error    2    error LNK2001: unresolved external symbol _handlePerlHTTPRequest    http.obj    NTOP-3.3.9
Error    3    error LNK2001: unresolved external symbol _alloca    ntop_win32.obj    NTOP-3.3.9
Error    4    error LNK2001: unresolved external symbol _VERSION    plugin.obj    NTOP-3.3.9
Error    5    error LNK2001: unresolved external symbol _release    util.obj    NTOP-3.3.9
Error    6    error LNK2001: unresolved external symbol _distro    util.obj    NTOP-3.3.9
Error    7    error LNK2001: unresolved external symbol _WinMain@16    MSVCRT.lib    NTOP-3.3.9
Error    8    fatal error LNK1120: 6 unresolved externals    C:\Users\Rowan\Documents\Visual Studio 2008\Projects\NTOP-Complete\Release\NTOP-3.3.9.exe    NTOP-3.3.9

The VERSION, release and distro look pretty simple - looks like I might have to get some perl libraries, I was trying to compile without perl support - the MSVCRT ones might be my challenge.

Working on _alloca now which I have found as:

# if defined(WIN32)
#define alloca _alloca

And is called once in the entire program:

zonestr = alloca(cp - buf + 1);

0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23447939
Well that was easy - #include <malloc.h> in the once .c file that calls _alloca().
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23448199
>> Error    1    error LNK2005: __snprintf already defined in util.obj    MSVCRT.lib    NTOP-3.3.9

It looks like ntop defines its own _snprintf function (in util.obj), which clashes with the one defined in the standard MSVCRT library.


>> Error    2    error LNK2001: unresolved external symbol _handlePerlHTTPRequest    http.obj    NTOP-3.3.9

If I'm not mistaken, handlePerlHTTPRequest is defined by ntop itself (more specifically in perl.c).
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23448282
I'm happy with any progress, which seems to be getting made! I spent waaaayy too much time with Mingw it looks like... Looks like I'll be reinstalling VC 2008.
-rich
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23448408
Yeah ok, I dumped the Perl by commenting out:

#define HAVE_PERL

But now I have these last two:

Error    374    error LNK2005: __snprintf already defined in util.obj    MSVCRT.lib    NTOP-3.3.9
Error    375    error LNK2001: unresolved external symbol _WinMain@16    MSVCRT.lib    NTOP-3.3.9
Error    376    fatal error LNK1120: 1 unresolved externals    C:\Users\Rowan\Documents\Visual Studio 2008\Projects\NTOP-Complete\Release\NTOP-3.3.9.exe    NTOP-3.3.9

This warning is consistent throughout the entire build, almost every .c file has this problem:

Warning    110    warning C4273: '_snprintf' : inconsistent dll linkage    c:\users\rowan\documents\visual studio 2008\projects\ntop-complete\ntop-3.3.9\globals-core.h    756    NTOP-3.3.9

The lines in globals-core.h look like this:

#define HAVE_SNPRINTF **************
#define snprintf _snprintf

#ifdef WIN32
extern int snprintf(char *str, size_t n, const char *fmt, ...);
#endif

I have added the entry marked *********** and this stops the Linkage error as the function is no longer now defined in util.obj as a result of HAVE_SNPRINTF being defined.

However I am worried about the warnings, I am not really sure what they mean!

The last Linkage Error has got me COMPLETELY stumped! _WinMain@16 - WTF!?!?!

-Rowan







0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23448476
>> Warning    110    warning C4273: '_snprintf' : inconsistent dll linkage

The signature used :

>> extern int snprintf(char *str, size_t n, const char *fmt, ...);

is not consistent with the "real" signature of the snprintf function. More specifically, it probably needs a __declspec(dllimport).
Or better yet, include the correct header for snprintf, ie. :

        #include <stdio.h>


>> The last Linkage Error has got me COMPLETELY stumped! _WinMain@16 - WTF!?!?!

The linker looks for the main of a console application, but the project is compiled as a windows application (not a console application).

        http://support.microsoft.com/kb/131204
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23448543
Yeah something like that :-) I needed to add an entry point for the linker - mainCRTStartup so that it will call main().

Well.... it has compiled - with 375 warnings :-)
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23448788
Well all compiled, located all the DLLs it wanted - but nothing happens when it is run... it just exits.....

I have traced it with procmon - it loads all the DLL's and a gazillion otherthings and then it just exits - no errors no nothing...
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23448893
Well I changed things around a bit and made it a console application, instead of whatever it was which I think was an empty project.

At least now I can type ntop --help and get the help display - still got quite a bit of work to do, but I think I will get their!  Thanks for your help Infinity!

-Rowan
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23449114
>> Well I changed things around a bit and made it a console application

That was indeed the best idea - the project settings somehow got messed up, so it was best to start over.
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23449291
Ok I have stayed awake I am going to pay tomorrow when the kids wake me up given it is no 3:41AM!!

It seems their is a fundamental difference in the way the VC2008 passes argv[][] to the program from what I am used to... they appear to be wchars[][] or whatever those wide things are, this is resulting in stricmp and printf(%s) failing all over the place so that is my hurdle for tommorrow, either work out how to get it to keep them as normal char *'s or rewrite the code to use thewchar equiv :-)

I am hoping that their is a way to do this generically throughout the whole program or I might have other problems....

....

Good night folks!
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23449436
>> they appear to be wchars[][]

Did you create a unicode project ?
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23455258
Yeah, changing it to MBCS solved the problem.

It dosn't work however - seems to crash when RDD creates the databases and then after the databases are created it seems to crash upon trying to open them with each subsequent run...

I am getting gdbm to compile in VisualStudio and once I have that I will link against that and see if I can determine what the problem is by debugging the libgdbm - cause I am not smart enough to know how to compile in gcc/cygwin and debug these in VStudio....
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23456612
@richrumble : I'm sorry you didn't get the solution you wanted, but I hope it eventually works for you. Do not hesitate to ask me if you want to take me up on my offer to work through this together with you.

@rowansmith : if you need more assistance with this, feel free to post your own (related) question.

@Vee_Mod : thank you for "Mod Magic" ;)
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 23456901
Me too, I'll watch rowan's question closely... and or reask a related q.
-rich
0
 
LVL 11

Expert Comment

by:rowansmith
ID: 23458512
YAY!  I got it to compile, link and even run!

Identity08, you can answer this one for me :-)  http://www.experts-exchange.com/Programming/Editors_IDEs/C_CPP_CS/Visual_CPP/Q_24079558.html

Turns out it was nothing to do with gdbm, but to do with linking with different CRT RunTime libraries.  And well I now have a fully working and MSVC++ integrated version of gdbm :-/

Still have many many warnings, so I am not convinced that the application is 100% stable.  But it is now running....

This is such a non trivial task it is not funny!

Thanks for your help!

-Rowan
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 23458795
>> This is such a non trivial task it is not funny!

I know :) And the worst things is that someone else will most likely encounter completely different problems.
0
 
LVL 2

Expert Comment

by:brian_appliedcpu
ID: 24045640
did you ever get it to compile?
I tried to buy it and my bank won't allow the euro transaction.
I am desperate to find something that will work on a windows 2008 platform x64 and ntop keeps crashing.
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 24045908
It'd be great if you could attach the files you did get to compile, as long as all the GPL credit is left unchanged, and the original source is included you could place it here or on a site of your choosing.
-rich
0
 
LVL 2

Expert Comment

by:brian_appliedcpu
ID: 24045970
I sent the source to one of my developers and asked him to compile.  Hopefully he will be able to and yes I will post them based on your criteria.
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 24474590
It's me again :) Rowan, or anyone have the source/files that we could try to compile?
Thanks!
-rich
0
 
LVL 2

Expert Comment

by:brian_appliedcpu
ID: 24474739
My developer looked at it and could not get even the supporting packages to compile.
sorry.

bkl
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 24474935
Yeah I was hoping Rowan would post what he says he got to compile... ntop32 is such an elusive beast ;)
It's almost mythical...
-rich
0
 
LVL 2

Expert Comment

by:brian_appliedcpu
ID: 24474980
what do you want to run it on?
0
 
LVL 38

Author Comment

by:Rich Rumble
ID: 24475428
Title:Compile Ntop for win32
um... windows... I have no problem compiling on *nix.
-rich
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question