Failure to compile helloworld_simple in C++

7 posts / 0 new
Last post
Offline
Last seen: 10 years 7 months ago
Joined: 08/05/2013
Posts: 4
Failure to compile helloworld_simple in C++

Hello,

I'm new to RTI and I'm trying to run compile helloworld_simple (Hello-x64Win64VS2010.sln) in MS Visual Studio Express 2010.  I believe I have followed the instructions correctly in the Getting Started guide, to add the proper environment variables & path directories, etc.  When I attempt to "Build Solution" in MSVSE, I get the following errors:

1>------ Build started: Project: HelloPublisher, Configuration: Release x64 ------
2>------ Build started: Project: HelloSubscriber, Configuration: Release x64 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(146,5): error MSB6003: The specified task executable "CL.exe" could not be run. The process cannot access the file 'E:\RTIexample\CPP\Hello_simple\objs\x64Win64VS2010\cl.read.1.tlog' because it is being used by another process.
2> HelloSubscriber.cpp
2>..\src\HelloSubscriber.cpp(10): fatal error C1083: Cannot open include file: 'ndds/ndds_cpp.h': No such file or directory
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

Any thoughts on what I might have configured incorrectly will be greatly appreciated.  Please help!

Thank you very much,

Elliot

Gerardo Pardo's picture
Offline
Last seen: 1 day 14 hours ago
Joined: 06/02/2010
Posts: 601

Hello Elliot,

This error could be indicative that you have not set the environment variable NDDSHOME correctly.  See the Connext Getting Started for details. The environment must be set in your system prior to you starting VisualStudio, otherwise VisualStudio will not pick it up and pass it to the the compilation process.

Gerardo

 

Offline
Last seen: 10 years 7 months ago
Joined: 08/05/2013
Posts: 4

Thank you for getting back to me.  I have the environment variable NDDSHOME set to "C:\Program Files (x86)\RTI\ndds.5.0.0".  This is the directory on my system that contains the "class", "doc", "example", "include", "jre", "lib", etc. directories.  Do you have any other thoughts on where I might be going wrong?

Thank you!

Elliot

Gerardo Pardo's picture
Offline
Last seen: 1 day 14 hours ago
Joined: 06/02/2010
Posts: 601

Hello Elliot,

This seems right. And if you look there under the $(NDDSHOME)/include  there should be the file  ndds\ndds_cpp.h  so the error you are seeing is quite odd.

I am still suspecting that somehow VisualStudio is not picking up your environment. Can you bring up the Project Properties and look at the resulting command-line options?   To do this in VisualStudio right-click on the HelloSubscriber project, then open the " Configuration Properties" and within that select the " C/C++"  adn there the  "Command Line" entry.

You should see window similar to the screenshot below (this is for Visual Studio 2008, but it should not look too different in vs 2010).

Notice that the command line options show the different include paths following the /I directive. For example im my case it shows:  /I "Z:\dom\apps_rti\RTI500_win32\ndds.5.0.0\include"  this is becuse for me $NDDSHOME is set to point to Z:\dom\apps_rti\RTI500_win32\ndds.5.0.0  you should see something similar but using "C:\Program Files (x86)\RTI\ndds.5.0.0\include" instead given how you installed RTI DDS it in your system.

Visual Studio Properties

If your properties do not include the "/I" directives with the proper paths to the location where RTI DDS is installed, then I would look at the "General" Properties to make sure the " Additional Include Paths" entry are referencing $(NDDSHOME) similar to what is shown in the screenshot below:

Visual studio general properties

Gerardo

 

 

rip
rip's picture
Offline
Last seen: 1 day 14 hours ago
Joined: 04/06/2012
Posts: 324

Hi All,

The Express versions of MS VS are 32 bit only! 

I get burnt by this fairly often, indeed I've had to explicitly add it to my list of things to check when preparing a classroom for a quick-start class...

Try all the steps with architecture i86Win32VS2010 instead.

Regards,

rip

Offline
Last seen: 10 years 7 months ago
Joined: 08/05/2013
Posts: 4

Hello Gerardo and Rip,

The include directories appear to be correct in my configuration, in the windows pictured in Gerardo's reply.  I also tried changing the environment variables for NDDSHOME and RTI_LICENSE_FILE so that the paths were enclosed by quotes (""), to no effect.  (I thought the spaces in the paths might be causing trouble somewhere.)  

The possibility that it's a 32bit vs. 64bit incompatibility sounds promising.  I will try using the 32 bit version of the software tomorrow and I'll let you know how it goes.

Thank you both!

Elliot

Offline
Last seen: 10 years 7 months ago
Joined: 08/05/2013
Posts: 4

It works!  I uninstalled the 64bit RTI package and installed the 32bit.  I found that I needed to remove the quotes that I added around the environment variables for the include statements to work.  I had to logout and log back in for the changes to the environment variables to take effect. (There may be a more elegant way to do this, but I don't know how.)  I also had to rename or remove the log file "cl.read.1.tlog" in objs\i86Win32VS2010, because I was getting an error saying that HelloPublisher was unable to create that log file.

Thanks very much for your help!

Elliot