Need a lot of help getting/making Java DLL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need a lot of help getting/making Java DLL

Jump to solution
2,192 Views
DaveA
Contributor III

I need to make the Java DLL for the USBDM, since I'm writing my own Java program to use the JS16 based unit that I have.  I tried following the build instructions at USBDM: Building USBDM Software. but when I finally got to where I thought I could run "make -f MakeAll.mk all" from the CMD prompt, all I get is this:

C:\Apps\USBDM_Win32_V4_10_0_Makefile>make -f MakeAll.mk all

make -C ARM_Interface all

make[1]: Entering directory `/c/Apps/USBDM_Win32_V4_10_0_Makefile/ARM_Interface'

make exe -f ProgrammerTarget.mk BUILDDIR=ARM_FlashProgrammer MODULE=programmer C

DEFS="-DTARGET=ARM -DPACK_STRUCTS=1 -DFLASH_PROGRAMMER"

make[2]: Entering directory `/c/Apps/USBDM_Win32_V4_10_0_Makefile/ARM_Interface'

make[2]: *** No rule to make target `ARM_FlashProgrammer/FlashProgramming.o', ne

eded by `ARM_FlashProgrammer.exe'.  Stop.

make[2]: Leaving directory `/c/Apps/USBDM_Win32_V4_10_0_Makefile/ARM_Interface'

make[1]: *** [ARM_FlashProgrammer] Error 2

make[1]: Leaving directory `/c/Apps/USBDM_Win32_V4_10_0_Makefile/ARM_Interface'

make: *** [build-ARM_Interface] Error 2

It looks like it is attempting to make all the various files.  I'm okay with that.  I just have no clue as to what I'm doing wrong, or how to get this to complete correctly.

Tags (1)
0 Kudos
1 Solution
1,584 Views
pgo
Senior Contributor V

Hi David,

The file that is failing to build is only used by the windows installer.  I suggest you remove it from the build.

If you want to build it you will need to install some Windows installation stuff (Windows Installer 4.5 SDK).  This is part of the  windows SDK now I believe.

bye

View solution in original post

0 Kudos
20 Replies
1,584 Views
pgo
Senior Contributor V

Hi David,

Which make are you using?

Try mingw32-make -f MakeAll.mk all or use the command file MakeAll.cmd.

I would also suggest you use the V4.10.3 sources as there were some improvements to the make files.

Also recheck the definitions at the top of the Common.mk file.  I'll have another look next time I'm running windows and see how the logs differ.

bye

1,584 Views
DaveA
Contributor III

Thanks for the next step.  I downloaded and replaced the USBDM source I had with 4.10.3 source (the building software page still points to 4.10.0, which is why I was using that), changed the common file, and ran the cmd file.  This is what I got:

C:\Apps\USBDM_Win32_V4_10_03>MakeAll.cmd

C:\Apps\USBDM_Win32_V4_10_03>mingw32-make -f MakeAll.mk all

c:/Apps/MinGW/bin/mingw32-make -C wxPlugin_DLL all

mingw32-make[1]: Entering directory `C:/Apps/USBDM_Win32_V4_10_03/wxPlugin_DLL'

c:/Apps/MinGW/bin/mingw32-make dll -f Target.mk BUILDDIR=wxPlugin CDEFS=""

mingw32-make[2]: Entering directory `C:/Apps/USBDM_Win32_V4_10_03/wxPlugin_DLL'

c:/Apps/MinGW/msys/1.0/bin/mkdir wxPlugin

c:/Apps/MinGW/msys/1.0/bin/touch wxPlugin/timestamp

Makefile Target.mk src wxPlugin Building wxPlugin/wxPlugin.d from src/wxPlugin.c

pp

c:/Apps/MinGW/bin/g++ -MM -MG -MQ wxPlugin/wxPlugin.o -O3  \   -DuseWxWidgets -D

__WXMSW__ -D__GNUWIN32__ -DUNICODE -Isrc -I../Shared_V4/src -IC:/Apps/wxWidgets-

2.9.4/lib/gcc_lib/mswu -IC:/Apps/wxWidgets-2.9.4/include src/wxPlugin.cpp >wxPlu

gin/wxPlugin.d

g++.exe: error:  : No such file or directory

Makefile Target.mk src wxPlugin Building wxPlugin/wxPlugin.o from src/wxPlugin.c

pp

c:/Apps/MinGW/bin/g++ -O3  \   -DuseWxWidgets -D__WXMSW__ -D__GNUWIN32__ -DUNICO

DE -Isrc -I../Shared_V4/src -IC:/Apps/wxWidgets-2.9.4/lib/gcc_lib/mswu -IC:/Apps

/wxWidgets-2.9.4/include -c src/wxPlugin.cpp -o wxPlugin/wxPlugin.o

g++: error:  : No such file or directory

mingw32-make[2]: *** [wxPlugin/wxPlugin.o] Error 1

mingw32-make[2]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/wxPlugin_DLL'

mingw32-make[1]: *** [wxPlugin] Error 2

mingw32-make[1]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/wxPlugin_DLL'

mingw32-make: *** [build-wxPlugin_DLL] Error 2

C:\Apps\USBDM_Win32_V4_10_03>ls -aF ..

./      USBDM_Win32_V4_10_03/  lib/      share/

../     bin/                   libexec/  var/

MinGW/  doc/                   mingw32/  wxWidgets-2.9.4/

Tcl/    include/               msys/     xerces-c-3.1.1/

So the wxWidgets directory is there under Apps.  What's possibly missing?

0 Kudos
1,584 Views
pgo
Senior Contributor V

Hi David,

Are you building this at a Windows prompt?  It would appear so from some of the above but there is something strange going on.  In the Make files there are some asterisks at the star of the echo lines.  These are being expanded which would only happen with a Linux style shell?  You are also using ls at the end.

Anyway - Whatever is happening, it's confused by the backslash '\' and looking for a directory called ' ' (a single space).

I'm very puzzled!

Just try double-clicking on the MakeAll.cmd file.

bye

0 Kudos
1,584 Views
DaveA
Contributor III

Yep. using the DOS prompt.Seems if I use either the Mingw or msys prompt, I'm limited to being in the respective directories that they were installed in.  However since mingw and msys bin directories are part of the DOS PATH variable, it allows me to use the 'ls' (and other) command(s).  System is Windows 7, 64 bit, but I try to run everything in 32 bit mode.

Double clicking on the makeall.cmd icon in the file explorer window gives me exactly the same output as quoted above.

0 Kudos
1,584 Views
pgo
Senior Contributor V

Hi Again,

Could you try removing the MSYS bin directory from your path?

bye

1,584 Views
DaveA
Contributor III

Slightly better:

C:\Apps\USBDM_Win32_V4_10_03>mingw32-make -f MakeAll.mk all

c:/Apps/MinGW/bin/mingw32-make -C wxPlugin_DLL all

mingw32-make[1]: Entering directory `C:/Apps/USBDM_Win32_V4_10_03/wxPlugin_DLL'

c:/Apps/MinGW/bin/mingw32-make dll -f Target.mk BUILDDIR=wxPlugin CDEFS=""

mingw32-make[2]: Entering directory `C:/Apps/USBDM_Win32_V4_10_03/wxPlugin_DLL'

** Building wxPlugin/wxPlugin.o from src/wxPlugin.cpp

c:/Apps/MinGW/bin/g++ -O3     -DuseWxWidgets -D__WXMSW__ -D__GNUWIN32__ -DUNICOD

E -Isrc -I../Shared_V4/src -IC:/Apps/wxWidgets-2.9.4/lib/gcc_lib/mswu -IC:/Apps/

wxWidgets-2.9.4/include -c src/wxPlugin.cpp -o wxPlugin/wxPlugin.o

In file included from C:/Apps/wxWidgets-2.9.4/include/wx/defs.h:28:0,

                 from C:/Apps/wxWidgets-2.9.4/include/wx/wx.h:15,

                 from src/wxPlugin.cpp:1:

C:/Apps/wxWidgets-2.9.4/include/wx/platform.h:154:22: fatal error: wx/setup.h: N

o such file or directory

compilation terminated.

mingw32-make[2]: *** [wxPlugin/wxPlugin.o] Error 1

mingw32-make[2]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/wxPlugin_DLL'

mingw32-make[1]: *** [wxPlugin] Error 2

mingw32-make[1]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/wxPlugin_DLL'

mingw32-make: *** [build-wxPlugin_DLL] Error 2

0 Kudos
1,584 Views
pgo
Senior Contributor V

The missing include file (wx/setup.h) should be in C:/Apps/wxWidgets-2.9.4/lib/gcc_lib/mswu/wx.

Have you built this version of wxWidgets?

bye

0 Kudos
1,584 Views
DaveA
Contributor III

I believe I built this version of wx. setup.h is in mswud/wx directory, not mswu/wx.

0 Kudos
1,584 Views
pgo
Senior Contributor V

Hi David,

mswud = microsoft windows + unicode+debug

Look through the wxWidgets instructions and try building the unicode release version.

bye

0 Kudos
1,584 Views
DaveA
Contributor III

Nowhere in the wxWidgets documentation that I saw did it state explicitly how to build the release version.  Even just doing a 'mingw32-make -f makefile.gcc' still resulted in the debug version being built by default, even with setting the debug level to zero in setup.h.  Finally, on a wild hunch I entered the command 'mingw32-make -f makefile.gcc BUILD=release', and that worked.

I then attempted the MakeAll windows command script in the USBDM directory again, and got much farther this time.  It didn't abort until it reached this point:

-- Linking Target usbdm.4.dll

c:/Apps/MinGW/bin/g++ -shared -o usbdm/usbdm.4.dll -s usbdm/armInterface.o usbdm

/ICP.o usbdm/JTAGSequence.o usbdm/low_level_usb.o usbdm/Log.o usbdm/USBDM_API.o

usbdm/USBDM_ErrorMessages.o usbdm/Names.o  usbdm/Version.o  -L../Shared_V4/lib

-lusb-static-1.0

c:/apps/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: canno

t find -lusb-static-1.0

collect2: ld returned 1 exit status

mingw32-make[2]: *** [usbdm.4.dll] Error 1

mingw32-make[2]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/USBDM_DLL'

mingw32-make[1]: *** [usbdm] Error 2

mingw32-make[1]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/USBDM_DLL'

mingw32-make: *** [build-USBDM_DLL] Error 2

0 Kudos
1,584 Views
pgo
Senior Contributor V

Hi David,

Getting there.

Run CollectSharedFiles to copy files to the shared library directory which some of the builds are linked against.  This copies various files including some created during the build.  This means that you will need to do it a couple of times when the build fails because of a missing DLL that has been built but not copied to the shared library directory. The make file should do this but I was pretty "maked-out" after restructuring the code to use Make and took the easy way out.

BUT There is a bug in this command file - If the library folder doesn't already exist it fails to create it.  It creates a file instead (this is a 'feature' from MS-DOS).  You will need to manually create the folder Shared_V4/lib once.

CollectExternalFiles copies external files but these are already present in one of the included folders.  This may seem strange but it allows building most of the files without worrying if there is some foreign version of the external DLLs.  I had some issues with apparently correct DLLs being incompatible.  Don't run this unless you really want to collect these files.  The ones included in the Zip files are know to work together,

Sorry for the stuffing around.

bye

0 Kudos
1,584 Views
DaveA
Contributor III

That helps get a lot farther.  I created the directory specified, and alternated running the CollectSharedFiles and MakeAll scripts until it would repeatedly stop at this point:

c:/Apps/MinGW/bin/mingw32-make exe -f ../ProgrammerTarget.mk BUILDDIR=ARM_FlashP

rogrammer MODULE=programmer CDEFS="-DTARGET=ARM -DPACK_STRUCTS=1 -DFLASH_PROGRAM

MER -DUSE_ICON"

mingw32-make[2]: Entering directory `C:/Apps/USBDM_Win32_V4_10_03/ARM_Interface'

** Building ARM_FlashProgrammer/DeviceData.o from ../Shared_V4/src/DeviceData.cp

p

c:/Apps/MinGW/bin/g++ -O3  -DTARGET=ARM -DPACK_STRUCTS=1 -DFLASH_PROGRAMMER -DUS

E_ICON   -DuseWxWidgets -D__WXMSW__ -D__GNUWIN32__ -DUNICODE  -Isrc -I../Shared_

V4/src -IC:/Apps/wxWidgets-2.9.4/lib/gcc_lib/mswu -IC:/Apps/wxWidgets-2.9.4/incl

ude -IF:/Apps/xerces-c-3.1.1/src/ -c ../Shared_V4/src/DeviceData.cpp -o ARM_Flas

hProgrammer/DeviceData.o

In file included from ../Shared_V4/src/DeviceData.cpp:45:0:

../Shared_V4/src/DeviceXmlParser.h:13:47: fatal error: xercesc/parsers/XercesDOM

Parser.hpp: No such file or directory

compilation terminated.

mingw32-make[2]: *** [ARM_FlashProgrammer/DeviceData.o] Error 1

mingw32-make[2]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/ARM_Interface'

mingw32-make[1]: *** [ARM_FlashProgrammer] Error 2

mingw32-make[1]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/ARM_Interface'

mingw32-make: *** [build-ARM_Interface] Error 2

Checking the file C:\Apps\USBDM_Win32_V4_10_03\Shared_V4\src\DeviceXmlParser I see it has this line in it:

#include <xercesc/parsers/XercesDOMParser.hpp>

Obviously this doesn't match a file there. What is it supposed to be?

0 Kudos
1,584 Views
pgo
Senior Contributor V

Check the value of XERCES_INC in the Common.mk file.  It should point to the Xerces-C 3.1 XML installation.

bye

0 Kudos
1,584 Views
DaveA
Contributor III

Common.mk has: XERCES_INC     := -IF:/Apps/xerces-c-3.1.1/src/

This dir does exist.  It contains the files xercesc/parsers/XercesDOMParser.cpp and xercesc/parsers/XercesDOMParser.hpp. If the file is there, why is it complaining?

0 Kudos
1,587 Views
pgo
Senior Contributor V

Hi,

The line quoted refers to the F: drive.  Have you missed this?  I suspect it should be C:

bye

0 Kudos
1,587 Views
DaveA
Contributor III

Ah, okay that makes sense.  When I looked at this, all I saw was 'IF', and didn't think anything else of it.  As an FYI, I also changed this line a few lines below in the same file, since it showed the same thing:

XERCES_STATIC_LIBDIRS := -LF:/Apps/xerces-c-3.1.1/src/.libs

With that, we come to the next stopping point:

** Building ARM_FlashProgrammer/DeviceData.o from ../Shared_V4/src/DeviceData.cpp

c:/Apps/MinGW/bin/g++ -O3  -DTARGET=ARM -DPACK_STRUCTS=1 -DFLASH_PROGRAMMER -DUS

E_ICON   -DuseWxWidgets -D__WXMSW__ -D__GNUWIN32__ -DUNICODE  -Isrc -I../Shared_

V4/src -IC:/Apps/wxWidgets-2.9.4/lib/gcc_lib/mswu -IC:/Apps/wxWidgets-2.9.4/incl

ude -IC:/Apps/xerces-c-3.1.1/src/ -c ../Shared_V4/src/DeviceData.cpp -o ARM_Flas

hProgrammer/DeviceData.o

In file included from C:/Apps/xerces-c-3.1.1/src/xercesc/dom/DOMDocument.hpp:25:0,

                 from C:/Apps/xerces-c-3.1.1/src/xercesc/parsers/AbstractDOMParser.hpp:25,

                 from C:/Apps/xerces-c-3.1.1/src/xercesc/parsers/XercesDOMParser.hpp:26,

                 from ../Shared_V4/src/DeviceXmlParser.h:13,

                 from ../Shared_V4/src/DeviceData.cpp:45:

C:/Apps/xerces-c-3.1.1/src/xercesc/util/XercesDefs.hpp:46:51: fatal error: xerce

sc/util/Xerces_autoconf_config.hpp: No such file or directory

compilation terminated.

Looking at the contents of C:\Apps\xerces-c-3.1.1\src\xercesc\util I do not see a file there called Xerces_autoconf_config.hpp.  The files with the closest names are Xerces_autoconf_config.hpp.in, Xerces_autoconf_config.borland.hpp, and Xerces_autoconf_config.msvc.hpp.

0 Kudos
1,587 Views
pgo
Senior Contributor V

At a guess the .hpp file is produced from the .in file when doing autoconf before building xerces.

I thought that you would be able to avoid having to build xerces but based on the missing file it would appear that you will need to at least run autoconf on your system.

Try the build instructions at Build Instructions

bye

0 Kudos
1,587 Views
DaveA
Contributor III

Just to let you know, following the build instructions for creating the xerces stuff doesn't work either.  See, those instructions were probably written back when they were using GCC 4.5.  However Mingw now comes with GCC 4.6, so it breaks.  The correct sequence, I found, is as follows:

Start up the Mingw shell, as the DOS CMD prompt will not work for this.  Enter:

cd /c/Apps/xerces-c-3.1.1/

./configure LDFLAGS=-Wl,-no-undefined

make

The LDFLAGS has a 'W' with a small 'el' letter, not a one number.  That got xerces to build.  Then I was able to finally get the USBDM MakeAll command script to run for quite a long time.  However, it finally did stop at this point:

mingw32-make[2]: Entering directory `C:/Apps/USBDM_Win32_V4_10_03/MyCustomAction

'

** Building MyCustomAction/MyCustomAction.o from src/MyCustomAction.cpp

c:/Apps/MinGW/bin/g++ -O3      -Isrc -I../Shared_V4/src -IC:/"Program Files (x86

)"/"Windows Installer 4.5 SDK"/INCLUDE -c src/MyCustomAction.cpp -o MyCustomActi

on/MyCustomAction.o

src/MyCustomAction.cpp:5:17: fatal error: msi.h: No such file or directory

compilation terminated.

mingw32-make[2]: *** [MyCustomAction/MyCustomAction.o] Error 1

mingw32-make[2]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/MyCustomAction'

mingw32-make[1]: *** [MyCustomAction] Error 2

mingw32-make[1]: Leaving directory `C:/Apps/USBDM_Win32_V4_10_03/MyCustomAction'

mingw32-make: *** [build-MyCustomAction] Error 2

We are so, so close to finishing....

0 Kudos
1,585 Views
pgo
Senior Contributor V

Hi David,

The file that is failing to build is only used by the windows installer.  I suggest you remove it from the build.

If you want to build it you will need to install some Windows installation stuff (Windows Installer 4.5 SDK).  This is part of the  windows SDK now I believe.

bye

0 Kudos
1,587 Views
DaveA
Contributor III

Right.  Since I'm not interested in MS Installer stuff, I took out the reference then to MyCustomAction in MakeAll.mk in the DIRS list.  That got it to finish the MakeAll script.  Now that I finally have UsbdmJniWrapper.dll to go with Usbdm.java, let me play with this then and see what I can get it to do.  Thanks for all your help!  Hopefully this long thread will be a good resource for others to follow to get this working for them as well.

0 Kudos