We're Hiring!

Building cpp

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Building cpp

Postby colmeirin » Thu Mar 13, 2014 10:46 am

Hello everyone!

I'm using Windows7 32bits, java 7.51, Ice 3.4.0, Python 2.6.6, Pywin 2.6 and genshi 0.61.
I succesfully run the omero-server and clients with the precompiled binary files.

Now I'm following the OMERO C++ language bindings tutorial and I'm having som trouble building the project.

I've been resolving diferents problems in the compilation process such as variables paths or genshi.

When I try to compile (build -buildcpp) I get the following message:
Image

Any thoughts?

Is there a chance that I will be able to develop and build with c#?
Is there an updated precompiled librarys for c++?

Thanks for your efforts and keep the good work!
colmeirin
 
Posts: 16
Joined: Tue Mar 11, 2014 6:16 pm

Re: Building cpp

Postby jmoore » Thu Mar 13, 2014 8:49 pm

Hi,
colmeirin wrote:When I try to compile (build -buildcpp) I get the following message:


Have you already run "build" by itself? Perhaps try "build build-all" ?

Code: Select all
Is there a chance that I will be able to develop and build with c#?


C# is currently not supported.

Code: Select all
Is there an updated precompiled librarys for c++?


Not at the moment, no.

Regards,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Building cpp

Postby colmeirin » Fri Mar 14, 2014 9:53 am

Hi Josh!
Thanks for the fast reply and the help.

I've tried to do a "build.py build-all" with visual studio 2010 and it also fails. This is segment where the error promted:
build:
Entering C:\openmicroscopy\components\tools\OmeroCpp...

build:
Building with ICE_HOME=C:\Ice
Building with SLICE2JAVA=slice2java
Building with SLICE2PY=slice2py
Building with SLICE2CPP=slice2cpp
Building with SLICE2HTML=slice2html
Building with SLICEPATH=C:\Ice/slice
Using env[ICE_HOME] = C:\Ice
Using env[SLICEPATH] = C:\Ice\slice
Using env[SLICE2JAVA] = slice2java
Using env[SLICE2PY] = slice2py
Using env[SLICE2CPP] = slice2cpp
Debug setting: True (debug)
64-Bit build: False (detect)
Fatal Error: Ice library not found

BUILD FAILED
C:\openmicroscopy\build.xml:198: The following error occurred while executing th
is line:
C:\openmicroscopy\components\antlib\resources\global.xml:434: The following erro
r occurred while executing this line:
C:\openmicroscopy\components\tools\build.xml:27: The following error occurred wh
ile executing this line:
C:\openmicroscopy\components\antlib\resources\global.xml:434: The following erro
r occurred while executing this line:
C:\openmicroscopy\components\tools\OmeroCpp\build.xml:23: The following error oc
curred while executing this line:
C:\openmicroscopy\components\antlib\resources\global.xml:572: exec returned: 1

Total time: 9 minutes 8 seconds


And this is the content of OmeroCPP/config.log

file C:\openmicroscopy\components\tools\OmeroCpp\SConstruct,line 22:
Configure(confdir = .sconf_temp)
scons: Configure: Checking whether the C++ compiler works
.sconf_temp\conftest_0.cpp <-
|
|int main()
|{
| return 0;
|}
|
Compiling .sconf_temp\conftest_0.obj
conftest_0.cpp
scons: Configure: yes

scons: Configure: Checking for C++ header file Ice\Ice.h...
.sconf_temp\conftest_1.cpp <-
|
|#include "Ice\Ice.h"
|
|
Compiling .sconf_temp\conftest_1.obj
conftest_1.cpp
scons: Configure: yes

scons: Configure: Checking for C library Ice...
.sconf_temp\conftest_2.c <-
|
|
|
|int
|main() {
|
|return 0;
|}
|
C:\PROGRA~1\MICROS~2.0\VC\BIN\cl.EXE /Fo.sconf_temp\conftest_2.obj /c .sconf_temp\conftest_2.c /nologo /DOMERO_API_EXPORTS /D_REENTRANT /DDEBUG /DWIN32_LEAN_AND_MEAN /Isrc /Itarget /IC:\openmicroscopy\components\blitz\generated /IC:\Ice\include
conftest_2.c
C:\PROGRA~1\MICROS~2.0\VC\BIN\link.EXE /nologo /OUT:.sconf_temp\conftest_2.exe /LIBPATH:. /LIBPATH:C:\Windows\Microsoft.NET\Framework\v4.0.30319 /LIBPATH:C:\Windows\Microsoft.NET\Framework\v3.5 "/LIBPATH:C:\Program Files\Microsoft Visual Studio 10.0\VC\LIB" "/LIBPATH:C:\Program Files\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB" "/LIBPATH:C:\Program Files\Microsoft SDKs\Windows\v7.0A\lib" Ice.lib .sconf_temp\conftest_2.obj
LINK : fatal error LNK1181: cannot open input file 'Ice.lib'
scons: Configure: no


It seems something related with the Ice librarys. I've done the basic "Ice hello world tutorial" to try the compilation and it seemed to work...

Any thoughts?
colmeirin
 
Posts: 16
Joined: Tue Mar 11, 2014 6:16 pm

Re: Building cpp

Postby jmoore » Fri Mar 14, 2014 10:12 am

What's the value of %PATH% in your environment?

Have you tried setting LIBPATH as well? See "Further build configuration for more information.

Cheers,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Building cpp

Postby colmeirin » Fri Mar 14, 2014 10:41 am

Hi Josh,

I've tried a build.py build-cpp and this is the message:
Entering C:\openmicroscopy\components\tools\OmeroCpp...

build:
Building with ICE_HOME=C:Ice
Building with SLICE2JAVA=slice2java
Building with SLICE2PY=slice2py
Building with SLICE2CPP=slice2cpp
Building with SLICE2HTML=slice2html
Building with SLICEPATH=C:Ice\slice
Using env[ICE_HOME] = C:\openmicroscopy\components\tools\OmeroCpp\Ice
Using env[SLICEPATH] = C:\openmicroscopy\components\tools\OmeroCpp\Ice\slice
Using env[SLICE2JAVA] = slice2java
Using env[SLICE2PY] = slice2py
Using env[SLICE2CPP] = slice2cpp
Debug setting: True (debug)
64-Bit build: False (detect)
Fatal Error: Ice/Ice.h not found

BUILD FAILED
C:\openmicroscopy\build.xml:266: The following error occurred while executing th
is line:
C:\openmicroscopy\components\antlib\resources\global.xml:434: The following erro
r occurred while executing this line:
C:\openmicroscopy\components\tools\OmeroCpp\build.xml:23: The following error oc
curred while executing this line:
C:\openmicroscopy\components\antlib\resources\global.xml:572: exec returned: 1



The contento of the %PATH% variable on the VS2010 command promt is:

C:\openmicroscopy>echo %PATH%
C:\Program Files\Microsoft F#\v4.0\;C:\Program Files\Microsoft Visual Studio 10.
0\VSTSDB\Deploy;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\;C:\Pr
ogram Files\Microsoft Visual Studio 10.0\VC\BIN;C:\Program Files\Microsoft Visua
l Studio 10.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Win
dows\Microsoft.NET\Framework\v3.5;C:\Program Files\Microsoft Visual Studio 10.0\
VC\VCPackages;C:\Program Files\HTML Help Workshop;C:\Program Files\Microsoft Vis
ual Studio 10.0\Team Tools\Performance Tools;C:\Program Files\Microsoft SDKs\Win
dows\v7.0A\bin\NETFX 4.0 Tools;C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin
;C:\Python26;C:\Program Files\Git\bin;C:\Program Files\Java\jdk1.7.0_51\bin;C:\W
indows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsP
owerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MATLAB\MATLAB
Compiler Runtime\v715\runtime\win32;C:\Program Files\Microsoft SQL Server\100\To
ols\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Ice\bin


I will try to follow your directions and check and set all the variables in the "Further configuration" part.

Regards, Javier.
colmeirin
 
Posts: 16
Joined: Tue Mar 11, 2014 6:16 pm

Re: Building cpp

Postby jmoore » Fri Mar 14, 2014 10:55 am

In this latest run, it looks like your ICE_HOME has been corrupted:
Code: Select all
Building with ICE_HOME=C:Ice

(no slash).

Do you know how that happened?

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Building cpp

Postby colmeirin » Fri Mar 14, 2014 11:03 am

Hi josh.

Under the "Prepare to build" section it's scpecified that if you are using a visual studio enviroment you have to "set ICE_HOME=C:Ice"
First time I read it i found it odd but who knows... Is that a typo?
colmeirin
 
Posts: 16
Joined: Tue Mar 11, 2014 6:16 pm

Re: Building cpp

Postby jmoore » Fri Mar 14, 2014 11:10 am

Ah, thank you. Yes, it's a typo. We migrated our documentation system and it ate our Windows paths! I've just updated it now: https://github.com/openmicroscopy/ome-documentation/pull/698

Many thanks,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Building cpp

Postby colmeirin » Fri Mar 14, 2014 2:07 pm

I've checked all the envyroment variables such as SLICEPATH, CPPPATH and LIBPATH in the visual studio command promt and seted them properly and I finally been able to compile it!(77minutes building it!)

Thank you for all your help!

Keep the good work!

Regards, Javier.
colmeirin
 
Posts: 16
Joined: Tue Mar 11, 2014 6:16 pm

Re: Building cpp

Postby colmeirin » Tue Mar 25, 2014 4:42 pm

Hi again.

I have been exploring other components of Omero and I wanted to give another try to build in cpp.

After building the sample VS project with "build -f components\tools\OmeroCpp\build.xml msproj" I oppened the project.

I followed the OMERO C++ language bingings and when I build the example "yourcode.cpp" I get the following error:
Code: Select all
Error   1   error MSB3073: The command "echo Starting SCons && "C:\Python26\python.exe" -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-2.1.0'), join(sys.prefix, 'scons-2.1.0'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" -C "C:\openmicroscopy\components\tools\OmeroCpp" -f SConstruct "C:\openmicroscopy\components\tools\OmeroCpp\omero_client.dll"" exited with code 1.   C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets   38   6   omero_client

Any thoughts?

Thank you for your time!
colmeirin
 
Posts: 16
Joined: Tue Mar 11, 2014 6:16 pm

Next

Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 0 guests