Linking errors while building JAVA bindings for YARP

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Linking errors while building JAVA bindings for YARP

Himanshu.Akolkar

Hi All,

 

Background:

I am on a windows machine. I already had Java installed on the computer and was running perfectly.

I now needed to use Matlab and Yarp together and thus the need to compile JAVA bindings for yarp.

 

Process:

So, I followed the documentation on the website…

Installed JDK (version 1.8.0) and added the java path to the environment. I also installed SWIG (version 3.0.0) and then ran cmake from the YARP_DIR.

In cmake options I checked the option YARP_COMPILE_BINDINGS and then checked CREATE_JAVA.

 

Finally, I generated the build files and tried to compile it in MSVC (-v9 2008). Everything compiles perfectly except that I get linking errors for the output file: yarpJAVA_wrap.obj.

 

Notes:  

I also tried to build YARP with nothing but the minimum setup needed, but had the same errors as below. I also checked-out the latest version of YARP from repository and performed the building process but got the same errors.

 

 

Here is the error log:

 

1>------ Skipped Build: Project: RUN_TESTS, Configuration: Debug Win32 ------

1>Project not selected to build for this solution configuration

2>------ Skipped Build: Project: uninstall, Configuration: Debug Win32 ------

2>Project not selected to build for this solution configuration

3>------ Build started: Project: jyarp, Configuration: Debug Win32 ------

3>Linking...

3>   Creating library D:\PhD\Code\yarp\build\lib\Debug\jyarpd.lib and object D:\PhD\Code\yarp\build\lib\Debug\jyarpd.exp

3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall yarp::os::Things::Things(void)" (__imp_??0Things@os@yarp@@QAE@XZ) referenced in function _Java_yarp_yarpJNI_new_1Things@8

3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall yarp::os::Things::~Things(void)" (__imp_??1Things@os@yarp@@QAE@XZ) referenced in function "public: void * __thiscall yarp::os::Things::`scalar deleting destructor'(unsigned int)" (??_GThings@os@yarp@@QAEPAXI@Z)

3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall yarp::os::Things::setPortWriter(class yarp::os::PortWriter *)" (__imp_?setPortWriter@Things@os@yarp@@QAEXPAVPortWriter@23@@Z) referenced in function _Java_yarp_yarpJNI_Things_1setPortWriter@32

3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class yarp::os::PortWriter * __thiscall yarp::os::Things::getPortWriter(void)" (__imp_?getPortWriter@Things@os@yarp@@QAEPAVPortWriter@23@XZ) referenced in function _Java_yarp_yarpJNI_Things_1getPortWriter@20

3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall yarp::os::Things::setConnectionReader(class yarp::os::ConnectionReader &)" (__imp_?setConnectionReader@Things@os@yarp@@QAE_NAAVConnectionReader@23@@Z) referenced in function _Java_yarp_yarpJNI_Things_1setConnectionReader@32

3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall yarp::os::Things::write(class yarp::os::ConnectionWriter &)" (__imp_?write@Things@os@yarp@@QAE_NAAVConnectionWriter@23@@Z) referenced in function _Java_yarp_yarpJNI_Things_1write@32

3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall yarp::os::Things::reset(void)" (__imp_?reset@Things@os@yarp@@QAEXXZ) referenced in function _Java_yarp_yarpJNI_Things_1reset@20

3>D:\PhD\Code\yarp\build\lib\Debug\jyarpd.dll : fatal error LNK1120: 7 unresolved externals

3>Build log was saved at "file://d:\PhD\Code\yarp\build\bindings\jyarp.dir\Debug\BuildLog.htm"

3>jyarp - 8 error(s), 0 warning(s)

4>------ Skipped Build: Project: PACKAGE, Configuration: Debug Win32 ------

4>Project not selected to build for this solution configuration

5>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------

5>Project not selected to build for this solution configuration

========== Build: 0 succeeded, 1 failed, 25 up-to-date, 4 skipped ==========

 

It skips most of the other file compilation as they are already built.

 

 

Also attached is the build log created in the process…

 

Any ideas how I  can fix this???

 

I hope I haven’t missed any information!

 

 

Thanks in advance!

 

 

Best regards,

Himanshu Akolkar

 


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers

BuildLog.htm (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Linking errors while building JAVA bindings for YARP

paulfitz
Administrator
Hi Himanshu,

Thanks for reporting this. The linker errors you mention all relate to
the newly introduced yarp::os::Things class. I think I saw the problem
and committed a possible fix:
https://github.com/robotology/yarp/commit/e47897d7d2c48c7e7de6fc314d46a5325d65a906
If that was not the problem, could you file an issue so we can work
through this?
https://github.com/robotology/yarp/issues/new

Thanks,
Paul

On 04/17/2014 03:40 PM, Himanshu Akolkar wrote:

>
> Hi All,
>
> Background:
>
> I am on a windows machine. I already had Java installed on the
> computer and was running perfectly.
>
> I now needed to use Matlab and Yarp together and thus the need to
> compile JAVA bindings for yarp.
>
> Process:
>
> So, I followed the documentation on the website…
>
> Installed JDK (version 1.8.0) and added the java path to the
> environment. I also installed SWIG (version 3.0.0) and then ran cmake
> from the YARP_DIR.
>
> In cmake options I checked the option YARP_COMPILE_BINDINGS and then
> checked CREATE_JAVA.
>
> Finally, I generated the build files and tried to compile it in MSVC
> (-v9 2008). Everything compiles perfectly except that I get linking
> errors for the output file: yarpJAVA_wrap.obj.
>
> Notes:
>
> I also tried to build YARP with nothing but the minimum setup needed,
> but had the same errors as below. I also checked-out the latest
> version of YARP from repository and performed the building process but
> got the same errors.
>
> Here is the error log:
>
> 1>------ Skipped Build: Project: RUN_TESTS, Configuration: Debug Win32
> ------
>
> 1>Project not selected to build for this solution configuration
>
> 2>------ Skipped Build: Project: uninstall, Configuration: Debug Win32
> ------
>
> 2>Project not selected to build for this solution configuration
>
> 3>------ Build started: Project: jyarp, Configuration: Debug Win32 ------
>
> 3>Linking...
>
> 3> Creating library D:\PhD\Code\yarp\build\lib\Debug\jyarpd.lib and
> object D:\PhD\Code\yarp\build\lib\Debug\jyarpd.exp
>
> 3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: __thiscall
> yarp::os::Things::Things(void)" (__imp_??0Things@os@yarp@@QAE@XZ)
> referenced in function _Java_yarp_yarpJNI_new_1Things@8
>
> 3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: __thiscall
> yarp::os::Things::~Things(void)" (__imp_??1Things@os@yarp@@QAE@XZ)
> referenced in function "public: void * __thiscall
> yarp::os::Things::`scalar deleting destructor'(unsigned int)"
> (??_GThings@os@yarp@@QAEPAXI@Z)
>
> 3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: void __thiscall
> yarp::os::Things::setPortWriter(class yarp::os::PortWriter *)"
> (__imp_?setPortWriter@Things@os@yarp@@QAEXPAVPortWriter@23@@Z)
> referenced in function _Java_yarp_yarpJNI_Things_1setPortWriter@32
>
> 3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: class yarp::os::PortWriter * __thiscall
> yarp::os::Things::getPortWriter(void)"
> (__imp_?getPortWriter@Things@os@yarp@@QAEPAVPortWriter@23@XZ)
> referenced in function _Java_yarp_yarpJNI_Things_1getPortWriter@20
>
> 3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: bool __thiscall
> yarp::os::Things::setConnectionReader(class yarp::os::ConnectionReader
> &)"
> (__imp_?setConnectionReader@Things@os@yarp@@QAE_NAAVConnectionReader@23@@Z)
> referenced in function _Java_yarp_yarpJNI_Things_1setConnectionReader@32
>
> 3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: bool __thiscall
> yarp::os::Things::write(class yarp::os::ConnectionWriter &)"
> (__imp_?write@Things@os@yarp@@QAE_NAAVConnectionWriter@23@@Z)
> referenced in function _Java_yarp_yarpJNI_Things_1write@32
>
> 3>yarpJAVA_wrap.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: void __thiscall
> yarp::os::Things::reset(void)" (__imp_?reset@Things@os@yarp@@QAEXXZ)
> referenced in function _Java_yarp_yarpJNI_Things_1reset@20
>
> 3>D:\PhD\Code\yarp\build\lib\Debug\jyarpd.dll : fatal error LNK1120: 7
> unresolved externals
>
> 3>Build log was saved at
> "file://d:\PhD\Code\yarp\build\bindings\jyarp.dir\Debug\BuildLog.htm"
>
> 3>jyarp - 8 error(s), 0 warning(s)
>
> 4>------ Skipped Build: Project: PACKAGE, Configuration: Debug Win32
> ------
>
> 4>Project not selected to build for this solution configuration
>
> 5>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32
> ------
>
> 5>Project not selected to build for this solution configuration
>
> ========== Build: 0 succeeded, 1 failed, 25 up-to-date, 4 skipped
> ==========
>
> It skips most of the other file compilation as they are already built.
>
> Also attached is the build log created in the process…
>
> Any ideas how I can fix this???
>
> I hope I haven’t missed any information!
>
> Thanks in advance!
>
> Best regards,
>
> Himanshu Akolkar
>
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
>
>
> _______________________________________________
> Robotcub-hackers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/robotcub-hackers


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers