Hello Pramod,
scons -c did the job! Thank you very much! I was able to build and then
run simpleServer and simpleClient jar .
During this, I also tried to do the same in ubuntu. I was able to build
but then when running simpleServer I got I JNI error..(but this is
another issue)
Thank you all for your answers and help.
Best Regards,
Maria
On 25-Jul-17 3:04 PM, Pramod H G wrote:
Hi Maria,
This could be due to not able to link the winsock2.h file in windows.
Please check for iotivity_config.h file in the resource\c_common
directory and check if #define HAVE_WINSOCK2_H 1 line is present
If you do not have the line in the file, please delete the file or do
a clean on the code work space(scons -c) and try.
Regards,
Pramod H G
Granite River Labs
On 7/25/2017 5:21 PM, Maria Koutli wrote:
Hello,
I decided to uninstalled VS2017 and I also had to uninstall VS 2015
Professional in order to install VS2015 Community with Visual C++
Build tools.
Now I'm getting another error:
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(624):
error C2061: syntax error: identifier 'WSAEVENT'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(625):
error C2061: syntax error: identifier 'shutdownEvent'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(625):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(638):
error C2061: syntax error: identifier 'wsaRecvMsg'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(638):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(647):
error C2059: syntax error: '}'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(668):
error C2061: syntax error: identifier 'WSAEVENT'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(675):
error C2373: 'terminate': redefinition; different type modifiers
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(633):
note: see declaration of 'terminate'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(678):
error C2059: syntax error: '}'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(681):
error C2059: syntax error: '}'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(683):
error C2061: syntax error: identifier 'caglobals'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(683):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
warning C4115: 'sockaddr_storage': named type definition in parentheses
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2146: syntax error: missing ')' before identifier 'sockAddrLen'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2081: 'socklen_t': name in formal parameter list illegal
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2061: syntax error: identifier 'sockAddrLen'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2059: syntax error: ','
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(212):
error C2059: syntax error: ')'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2146: syntax error: missing ')' before identifier 'sentLen'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2081: 'SSIZE_T': name in formal parameter list illegal
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2061: syntax error: identifier 'sentLen'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2059: syntax error: ','
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(309):
error C2059: syntax error: ')'
scons: *** [out\windows\win32\x86\debug\java\jni\JniCaInterface.obj]
Error 2
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(624):
error C2061: syntax error: identifier 'WSAEVENT'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(625):
error C2061: syntax error: identifier 'shutdownEvent'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(625):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(638):
error C2061: syntax error: identifier 'wsaRecvMsg'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(638):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(647):
error C2059: syntax error: '}'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(668):
error C2061: syntax error: identifier 'WSAEVENT'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(675):
error C2373: 'terminate': redefinition; different type modifiers
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(633):
note: see declaration of 'terminate'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(678):
error C2059: syntax error: '}'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(681):
error C2059: syntax error: '}'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(683):
error C2061: syntax error: identifier 'caglobals'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(683):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(624):
error C2061: syntax error: identifier 'WSAEVENT'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(625):
error C2061: syntax error: identifier 'shutdownEvent'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(625):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(638):
error C2061: syntax error: identifier 'wsaRecvMsg'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(638):
error C2059: syntax error:
';'D:\Vicinity\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
warning C4115: 'sockaddr_storage': named type definition in parentheses
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(647):
error C2059: syntax error:
'}'D:\Vicinity\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2146: syntax error: missing ')' before identifier 'sockAddrLen'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2081: 'socklen_t': name in formal parameter list
illegalD:\Vicinity\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(668):
error C2061: syntax error: identifier 'WSAEVENT'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2061: syntax error: identifier
'sockAddrLen'D:\Vicinity\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(675):
error C2373: 'terminate': redefinition; different type modifiers
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2059: syntax error:
';'D:\Vicinity\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(633):
note: see declaration of 'terminate'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(211):
error C2059: syntax error:
','D:\Vicinity\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(678):
error C2059: syntax error: '}'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(212):
error C2059: syntax error:
')'D:\Vicinity\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(681):
error C2059: syntax error: '}'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2146: syntax error: missing ')' before identifier
'sentLen'D:\Vicinity\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(683):
error C2061: syntax error: identifier 'caglobals'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\api\cacommon.h(683):
error C2059: syntax error:
';'D:\Vicinity\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2081: 'SSIZE_T': name in formal parameter list illegal
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2061: syntax error: identifier 'sentLen'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2059: syntax error: ';'
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(308):
error C2059: syntax error: ','
D:\Iotivity\GitHub\iotivity\resource\csdk\connectivity\inc\caadapterutils.h(309):
error C2059: syntax error: ')'
scons: *** [resource\csdk\connectivity\common\src\ulinklist.obj] Error 2
scons: *** [resource\csdk\connectivity\common\src\uqueue.obj] Error 2
scons: building terminated because of errors.
SCons failed - exiting run.bat with code 3
There might be a problem with VS versions? I m not familiar at all
with C or C++..
Thank you.
Maria
On 25-Jul-17 12:37 PM, Pramod H G wrote:
Hi Maria,
We did face similar issue using Visual Studio 2017 for windows.
We could not resolve the issue by adding the cl.exe in PATH
variable, Install or Uninstall of scons or python etc .
Older Visual Studio 2013 or 2015 works fine and we reverted to that
for building.
There is some change in Visual Studio 2017 architecture and the path
in which it puts the binaries and scons fully does not support that
and hence the failure to detect Visual Studio 2017.
Please refer to this link where there are changes being done to
support Visual Studio 2017 in scons -
https://bitbucket.org/scons/scons/pull-requests/. The patches there
might help or we need to wait for Scons release 3.0 to fully support
Visual Studio 2017.
Regards,
Pramod H G
Granite River Labs
On 7/25/2017 2:01 PM, Maria Koutli wrote:
Hello Mushfiqul and George,
Thank you very much for your replies! Your link was very helpful. I
hadn't realized that I should build the whole project in order to
create the native libraries, but now I run into another problem.
cl @c:\users\mkoutli\appdata\local\temp\tmpwidrxm.lnk
'cl' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [resource\csdk\connectivity\common\src\ulinklist.obj]
Error 1
'cl' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [resource\csdk\connectivity\common\src\uqueue.obj] Error 1
scons: building terminated because of errors.
SCons failed - exiting run.bat with code 3
I followed instructions also from here
https://wiki.iotivity.org/windows and I used Developer cmd for vs 2017.
When I enter 'cl' in the cmd I get:
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25019 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
Is it possible that the problem is because Visual Studio is in
"Program Files" Folder which has a space?
Thank you,
Maria
On 24-Jul-17 8:20 PM, Nash, George wrote:
After checking out https://wiki.iotivity.org/generic_java_binding
let me know if you are still having difficulties.
Enabling the JAVA build to work in windows was only introduced by
me 3 weeks ago so there has not been a lot of people using the
code. Same as Mushfiqul I am using Windows 7. Please let me know
if you run into any issues.
George
*From:*[email protected]
[mailto:[email protected]] *On Behalf Of
*Muhammad Mushfiqul Islam
*Sent:* Monday, July 24, 2017 6:04 AM
*To:* Maria Koutli <[email protected]>
*Cc:* [email protected]
*Subject:* Re: [dev] How to build native libraries for Iotivity in
order to load them in Java
Hello Maria,
Have you tried to set java library path as mentioned in the below
wiki page?
https://wiki.iotivity.org/generic_java_binding
I have not got the chance to build and run java samples on Windows
10, but it is working fine for me in Win7 & Ubuntu.
- Thanks & Regards,
Mushfiqul Islam Antu
--------- *Original Message* ---------
*Sender* : Maria Koutli <[email protected]>
*Date* : 2017-07-23 19:42 (GMT+6)
*Title* : [dev] How to build native libraries for Iotivity in
order to load them in Java
Hello,
I'm trying to run Iotivity Simple Clent in Java. I have cloned Iotivity
projecthttps://github.com/iotivity/iotivity and I have created an
eclipse project that includes all the required Iotivity Java classes
plus the classes for the SimpleClient from java-examples folder.
When I try to run SimpleClient.java I get
Exception in thread "main" java.lang.UnsatisfiedLinkError: no
ocstack-jni in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.iotivity.base.OcPlatform.<clinit>(OcPlatform.java:39)
at
org.iotivity.base.examples.SimpleClient.startSimpleClient(SimpleClient.java:75)
at org.iotivity.base.examples.SimpleClient.main(SimpleClient.java:524)
I have installed SCONs and Gradle but I don't know how to proceed in
order to build and create the "ocstack-jni" or any other library that is
required to be loaded. My operating system is Windows 10.
Are there any instructions on how to create the required native
libraries in order to load them in the Java classes?
Thank you.
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev
Image removed by sender.
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev
--
Thanks & Regards
*Pramod H G* | Granite River Labs.
Santa Clara | Taipei | Bangalore | Yokohama | Penang | Singapore
Mobile: +91 9448756764 | Office: +91- (0)804 218 9021
--
Thanks & Regards
*Pramod H G* | Granite River Labs.
Santa Clara | Taipei | Bangalore | Yokohama | Penang | Singapore
Mobile: +91 9448756764 | Office: +91- (0)804 218 9021
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev