wood burning stoves 2.0*
The moose likes Linux / UNIX and the fly likes Creaing the binary from Makefile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Creaing the binary from Makefile" Watch "Creaing the binary from Makefile" New topic
Author

Creaing the binary from Makefile

Amit Basnak
Ranch Hand

Joined: Mar 15, 2004
Posts: 71
Dear friends

We are in the process of creating the new server binary for Systinet
Server for C++ . We have compiled the demo folder with the command
./configure CXX= /opt/aCC/bin/aCC and then also managed to compile the
hello demo with wsdl compiler. Now to run a demo we need to have the
server binary up and running also the same with the client binary.
The listing under
/export/home/amitbas/systinet/server_cpp65/share/doc/waspc/demos/server
is
$ ls -al
total 154
drwxr-xr-x 3 amitbas users 1024 Nov 10 13:25 .
drwxr-xr-x 12 amitbas users 1024 Nov 10 13:27 ..
drwxrwxrwx 2 amitbas users 96 Nov 10 13:25 .deps
-rw-rw-rw- 1 amitbas users 26058 Nov 10 13:25 Makefile
-rwxr-xr-x 1 amitbas users 1054 Nov 10 08:10 Makefile.am
-rwxr-xr-x 1 amitbas users 30361 Nov 10 08:10 Makefile.in
-rwxr-xr-x 1 amitbas users 665 Nov 10 08:10 README
-rwxr-xr-x 1 amitbas users 646 Nov 10 08:10 config-base.src.xml
-rwxr-xr-x 1 amitbas users 358 Nov 10 08:10 config.src.xml
-rwxr-xr-x 1 amitbas users 318 Nov 10 08:10
endpoints-common.xml
-rwxr-xr-x 1 amitbas users 251 Nov 10 08:10
endpoints-native.xml
-rwxr-xr-x 1 amitbas users 211 Nov 10 08:10
endpoints-openssl.xml
-rwxr-xr-x 1 amitbas users 2687 Nov 10 08:10
endpoints-stlnative.xml
-rwxr-xr-x 1 amitbas users 256 Nov 10 08:10
endpoints-wss.xml
-rwxr-xr-x 1 amitbas users 6616 Nov 10 08:10 server.cpp

We are stuck in creating the binary to run the server.
Can someone please let us know the steps in creating the binary of
server


Thanks for your time
Amit
Amit Basnak
Ranch Hand

Joined: Mar 15, 2004
Posts: 71
I did make all and I am getting error which Im posting below

$ make all
cd .. && make am--refresh
No suffix list.
No suffix list.
source='server.cpp' object='server.o' libtool=no \
depfile='.deps/server.Po' tmpdepfile='.deps/server.TPo' \
depmode=none /bin/sh ../depcomp \
/opt/aCC/bin/aCC -DPACKAGE_NAME=\"Systinet\ Server\ for\ C++\ Demos\" -DPACKAGE_TARNAME=\"systinet-server-cpp-demos\" -DPACKAGE_VERSION=\"6.5\" -DPACKAGE_STRING=\"Systinet\ Server\ for\ C++\ Demos\ 6.5\" -DPACKAGE_BUGREPORT=\"support@systinet.com\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1 -DWASP_HAVE_NEW_STL_HEADERS=1 -DWASP_HAVE_WSTRING=1 -DWASP_HAVE_STL=1 -DHAVE_DLFCN_H=1 -I. -I. -I/opt/systinet/server_cpp65/include -I../advanced/attachments -I../basic/arrays -I../interop/interopA -I../interop/msInterop/dotnetToWasp/cpTypes/docLit -I../interop/msInterop/dotnetToWasp/cpTypes/rpcEnc -I../interop/msInterop/dotnetToWasp/xsdTypes/docLit -I../interop/msInterop/dotnetToWasp/xsdTypes/rpcEnc -I../security/openssl -I../security/wssecurity/runtime -I./../advanced/attachments -I./../basic/arrays -I./../interop/interopA -I./../security/openssl -g -c -o server.o server.cpp
Error 112: "../interop/java/impl.h", line 12 # Include file "../java/barnImpl.h" not found.
#include "../java/barnImpl.h"
^^^^^^^^^^^^^^^^^^^^
Error 419: "../interop/java/impl.h", line 14 # 'Barn_BarnServiceImpl' is used as a type, but has not been defined as a
type.
class BarnServerImpl : public Barn_BarnServiceImpl {
^^^^^^^^^^^^^^^^^^^^
Error 376: "../interop/java/impl.h", line 14 # Class name expected.
class BarnServerImpl : public Barn_BarnServiceImpl {
^^^^^^^^^^^^^^^^^^^^
Error 419: "../interop/java/impl.h", line 16 # 'Barn_CowArray' is used as a type, but has not been defined as a type.
Barn_CowArray *cows;
^^^^^^^^^^^^^
Error 20: "../interop/java/impl.h", line 18 # '[' expected before '*'.
Barn_Cow *findCowWithID (Barn_CowArray *where, WASP_LongLong id);
^
Error 19: "../interop/java/impl.h", line 18 # Unexpected 'WASP_LongLong'.
Barn_Cow *findCowWithID (Barn_CowArray *where, WASP_LongLong id);
^^^^^^^^^^^^^
Error 24: "../interop/java/impl.h", line 18 # '(' expected instead of ';'.
Barn_Cow *findCowWithID (Barn_CowArray *where, WASP_LongLong id);
^
Error 22: "../interop/java/impl.h", line 19 # Syntax error.
Barn_Cow *cloneCow (Barn_Cow *cow);
^
Error 419: "../interop/java/impl.h", line 25 # 'Barn_ArrayOflong' is used as a type, but has not been defined as a type.
virtual void slaughterCows (Barn_ArrayOflong * p0);
^^^^^^^^^^^^^^^^
Error 20: "../interop/java/impl.h", line 26 # ':' expected before '*'.
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
^
Error 172: "../interop/java/impl.h", line 26 # Undeclared variable 'Barn_ArrayOflong'.
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
^^^^^^^^^^^^^^^^
Error 335: "../interop/java/impl.h", line 26 # ANSI C and C++ do not allow named bitfield with zero width.
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
^^^^^^^^^^^^^^^^^^
Error 699: "../interop/java/impl.h", line 26 # Error limit reached; halting compilation.
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
^^^^^^^^^^^^^^^^^^
*** Error exit code 2
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Well, there seem to be a bunch of undefined C++ classes that look as though they're mapped to Java classes, somehow. Something is supposed to be generating the file "../java/barnImpl.h", but it's not getting done. You need to examine the Makefile and see if you can figure out where that was supposed to happen.


[Jess in Action][AskingGoodQuestions]
Amit Basnak
Ranch Hand

Joined: Mar 15, 2004
Posts: 71
Ernest Friedman-Hill
Thanks for the reply
I performed the WSDL compilation from the directory /systinet/server_cpp65/share/doc/waspc/demos/interop/java
And it successfully generated the file barnImpl.h under the above path.
Again I tried to did make and got the errors which I am posting here
Error 419: "../interop/java/impl.h", line 14 # 'Barn_BarnServiceImpl' is used as a type, but has not been defined as a type.
class BarnServerImpl : public Barn_BarnServiceImpl {
^^^^^^^^^^^^^^^^^^^^
Error 376: "../interop/java/impl.h", line 14 # Class name expected.
class BarnServerImpl : public Barn_BarnServiceImpl {
^^^^^^^^^^^^^^^^^^^^
Error 419: "../interop/java/impl.h", line 16 # 'Barn_CowArray' is used as a type, but has not been defined as a type.
Barn_CowArray *cows;
^^^^^^^^^^^^^
Error 20: "../interop/java/impl.h", line 18 # '[' expected before '*'.
Barn_Cow *findCowWithID (Barn_CowArray *where, WASP_LongLong id);
^
Error 19: "../interop/java/impl.h", line 18 # Unexpected 'WASP_LongLong'.
Barn_Cow *findCowWithID (Barn_CowArray *where, WASP_LongLong id);
^^^^^^^^^^^^^
Error 24: "../interop/java/impl.h", line 18 # '(' expected instead of ';'.
Barn_Cow *findCowWithID (Barn_CowArray *where, WASP_LongLong id);
^
Error 22: "../interop/java/impl.h", line 19 # Syntax error.
Barn_Cow *cloneCow (Barn_Cow *cow);
^
Error 419: "../interop/java/impl.h", line 25 # 'Barn_ArrayOflong' is used as a type, but has not been defined as a type.
virtual void slaughterCows (Barn_ArrayOflong * p0);
^^^^^^^^^^^^^^^^
Error 20: "../interop/java/impl.h", line 26 # ':' expected before '*'.
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
^
Error 172: "../interop/java/impl.h", line 26 # Undeclared variable 'Barn_ArrayOflong'.
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
^^^^^^^^^^^^^^^^
Error 335: "../interop/java/impl.h", line 26 # ANSI C and C++ do not allow named bitfield with zero width.
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
^^^^^^^^^^^^^^^^^^
Error 334: "../interop/java/impl.h", line 26 # Bitfield width cannot be larger than the size of its type '<no type>'.
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
^^^^^^^^^^^^^^^^^^
Error 699: "../interop/java/impl.h", line 26 # Error limit reached; halting compilation.
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
^^^^^^^^^^^^^^^^^^
*** Error exit code 2
---------------------------------------------------------------------------
impl.h file which is giving problems looks OK to me

#ifndef __WASP_DEMO_BARN_SERVICE_H
#define __WASP_DEMO_BARN_SERVICE_H

#include <waspc/config/config.h>

#include <waspc/util/exceptions.h>

// Generated code includes
#include "../java/barnImpl.h"

class BarnServerImpl : public Barn_BarnServiceImpl {

Barn_CowArray *cows;

Barn_Cow *findCowWithID (Barn_CowArray *where, WASP_LongLong id);
Barn_Cow *cloneCow (Barn_Cow *cow);

public:
BarnServerImpl();
virtual ~BarnServerImpl();

virtual void slaughterCows (Barn_ArrayOflong * p0);
virtual Barn_ArrayOfdouble * actualMilkYield (Barn_ArrayOflong * p0);
virtual Barn_ArrayOfCow * cowsForSlaughter ();
virtual Barn_ArrayOfCow * getCows (Barn_ArrayOflong * p0);
virtual double barnRating ();
virtual Barn_Cow * theBestCow ();
virtual Barn_ArrayOfCow * getAllCows ();

};

#endif // __WASP_DEMO_BARN_SERVICE_H

Is it that the JNI package installed which is required for building that module is missing thats why its throwing such errors ?

Thanks
Amit
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Originally posted by Amit Basnak:
....
Error 376: "../interop/java/impl.h", line 14 # Class name expected.
class BarnServerImpl : public Barn_BarnServiceImpl {
^^^^^^^^^^^^^^^^^^^^
....


OK, so you found impl.h.

Is that header hand coded or generated???

I read this as Barn_BarnServiceImpl has not been properly forward declared (in that header).

Forward declarations: see Stroustrup, C++ Programming Language, 2nd edition, page 278.

Guy

[ November 20, 2006: Message edited by: Guy Allard ]
[ November 20, 2006: Message edited by: Guy Allard ]
Amit Basnak
Ranch Hand

Joined: Mar 15, 2004
Posts: 71
Guy and Ernest Friedman-Hill

I managed to get rid of those errors now what I got so far is
I did run configure script again with the parameters as
/opt/systinet/server_cpp65/share/doc/waspc/demos> ./configure CXX=/opt/aCC/bin/aCC LD=/opt/aCC/bin/aCC

and it was successul and I used aCC compiler as the linker instead of system default (/usr/ccs/bin/ld) now doing make Im getting the following error
$ make all
No suffix list.
Making all in basic
No suffix list.
Making all in arrays
cd ../.. && make am--refresh
No suffix list.
No suffix list.
/bin/sh ../../libtool --mode=link /opt/aCC/bin/aCC -g -o
arrays client.o arrays.lo arraysStructs.lo
/opt/systinet/server_cpp65/lib/libwasp.la
/opt/systinet/server_cpp65/lib/libwasp_stl.la
/opt/aCC/bin/aCC -g -o arrays client.o .libs/arrays.o
.libs/arraysStructs.o /opt/systinet/server_cpp65/lib/libwasp_stl.sl
/opt/systinet/server_cpp65/lib/libwasp.sl -lm -ldl -lpthread -Wl,+b
-Wl,/opt/systinet/server_cpp65/lib -Wl,+s
/usr/ccs/bin/ld: Can't find library: "dl"
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.


/usr/ccs/bin/ld: Can't find library: "dl" => checked dl library is not present on the HP-UX system . also having specified aCC compiler as linker while running ./configure , the error shows still is uses system default linker /usr/ccs/bin/ld. Im not sure why .

All the 64 bit libraries of HP-UX are under /usr/lib/pa20_64 directory .

Any idea How do I get rid of the error ??

Thanks for your time

Amit
Amit Basnak
Ranch Hand

Joined: Mar 15, 2004
Posts: 71
I do have the said library at: /usr/lib/pa20_64/libdl.1
but adding it to the Make file did not work.
Amit Basnak
Ranch Hand

Joined: Mar 15, 2004
Posts: 71
I understand that in Makefile -ldl needs to be replaced by -ldld
I did a grep for ldl and here is what I have
here are the files that contains ldl

$ find ./ -exec grep -l ldl {} \;
./.sh_history
./systinet/server_cpp65/lib/libwasp.la
./systinet/server_cpp65/lib/libwasp_wsdl.la
./systinet/server_cpp65/lib/libwasp_dii.la
./systinet/server_cpp65/lib/libwasp_security.la
./systinet/server_cpp65/lib/libwasp_stl.la
./systinet/server_cpp65/lib/libwasp_validator.la
./systinet/server_cpp65/lib/mod_13_wasp.la
./systinet/server_cpp65/lib/mod_wasp.la
./systinet/server_cpp65/share/waspc/src/STLSupport/aclocal.m4
./systinet/server_cpp65/share/waspc/src/STLSupport/configure
./systinet/server_cpp65/share/waspc/src/STLSupport/config.guess
./systinet/server_cpp65/share/waspc/src/STLSupport/ltmain.sh
./systinet/server_cpp65/share/doc/waspc/demos/basic/arrays/.libs/libwaspdem��o_arrays.la
./systinet/server_cpp65/share/doc/waspc/demos/basic/arrays/libwaspdemo_arra��ys.la
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/aclocal.m4
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/configure
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/config.guess
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/ltmain.sh
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/libtool
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/aclocal.m4
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/configure
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/config.guess
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/ltmain.sh
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/libtool
./systinet/server_cpp65/share/doc/waspc/demos/aclocal.m4
./systinet/server_cpp65/share/doc/waspc/demos/configure
./systinet/server_cpp65/share/doc/waspc/demos/config.guess
./systinet/server_cpp65/share/doc/waspc/demos/ltmain.sh
./systinet/server_cpp65/share/doc/waspc/demos/libtool
./systinet/server_cpp65/share/doc/waspc/doc/waspc/html/js/searchData.js
./systinet/server_cpp65/include/waspc/config/configAuto.h

So there is no Makefile yet which has ldl in it.
Also the configure file which is used to build Makefile has the following

# if libdl is installed we need to link against it
echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"

if test $ac_cv_lib_dl_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else


lt_cv_dlopen="dyld"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes


fi
---------------------------------------------------------------------------��------------------------------------------------


For -ldld


if test $ac_cv_lib_svld_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
if test "${ac_cv_lib_dld_dld_link+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
-------------------------------------------
Also if I configure al over again like

CXX=/opt/aCC/bin/aCC LD=/opt/aCC/bin/aCC -L /usr/lib/pa20_64 -ldld

the files in my /usr/lib/pa20_64 directory are
libdl.1
libdl.sl
libdld.1
libdld.sl

there is no libdl.a file in pa20_64

Thanks for all your help and time
Amit
 
 
subject: Creaing the binary from Makefile