Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Compiling Boost c++ library in Mementics in QNX: (10 Items)
   
Compiling Boost c++ library in Mementics in QNX  
Hi,

Actually we have to compile a program with Boost C++ in QNX(Gcc 2.95.3) using momentics.

We have downloaded Boost C++ version 1.34.1.
In QNX the Gcc version 2.95.3 is there along with QCC.

First we have installed Boost C++ by following the commands.

1) ./configure --with-toolset = gcc, and
2) make install

Some targets are skipped, some are not built and some more are built.

In Momentics IDE(with GCC 2.95.3), we wrote one sample program with Boost C++, while compiling, it took much time and 
around 100 errors were there. These errors are from the Boost C++ library.

We wrote a small program as follows

<boost/filesystem.hpp>
int main ()
{
return 0;
}

We set the "extra include path" in the compiler option in momentics as /usr/local/include/boost-1_34_1 where we have the
 boost directory and in that we have the FileSystem.hpp file. Also in the boost directory we have the following 
directory filesystem which contains the convenience.hpp and operations.hpp.

Kindly let us know if we are heading in the right direction. The errors and the console o/p are attached.

Regards,
Lakshmi.


Attachment: Text errors.txt 257.3 KB
Re: Compiling Boost c++ library in Mementics in QNX  
> Hi,
> 
> Actually we have to compile a program with Boost C++ in QNX(Gcc 2.95.3) using 
> momentics.
> 
> We have downloaded Boost C++ version 1.34.1.
> In QNX the Gcc version 2.95.3 is there along with QCC.

I believe Boost documents that gcc 3.x and newer is required. Try switching to the gcc 3.3.5 compiler. 

I was able to compile your small testcase with 3.3.5.

Regards,

Ryan Mansfield
Re: Compiling Boost c++ library in Mementics in QNX  
> 1) ./configure --with-toolset = gcc, and
> 2) make install

Is that --with-toolset=gcc or --with-toolset=qcc?  I believe Boost has a special  configuration for QNX that uses qcc.

Regards,

Ryan Mansfield
Re: Compiling Boost c++ library in Mementics in QNX  
> Hi,
> 
> Actually we have to compile a program with Boost C++ in QNX(Gcc 2.95.3) using 
> momentics.
> 
> We have downloaded Boost C++ version 1.34.1.
> In QNX the Gcc version 2.95.3 is there along with QCC.
> 
> First we have installed Boost C++ by following the commands.
> 
> 1) ./configure --with-toolset = gcc, and
> 2) make install
> 
> Some targets are skipped, some are not built and some more are built.

Hi Lakshmi,

By the way, how many targets were skipped for your build? When I built Boost it only skipped 8  and built/updated 1171 
targets.

Please let me know if you run into any other problems with Boost. i think they're an excellent set of libraries and I'd 
like to see them work well on QNX.

Regards,

Ryan Mansfield
Re: Compiling Boost c++ library in Mementics in QNX  
> > Hi,
> > 
> > Actually we have to compile a program with Boost C++ in QNX(Gcc 2.95.3) 
> using 
> > momentics.
> > 
> > We have downloaded Boost C++ version 1.34.1.
> > In QNX the Gcc version 2.95.3 is there along with QCC.
> > 
> > First we have installed Boost C++ by following the commands.
> > 
> > 1) ./configure --with-toolset = gcc, and
> > 2) make install
> > 
> > Some targets are skipped, some are not built and some more are built.
> 
> Hi Lakshmi,
> 
> By the way, how many targets were skipped for your build? When I built Boost 
> it only skipped 8  and built/updated 1171 targets.
> 
> Please let me know if you run into any other problems with Boost. i think 
> they're an excellent set of libraries and I'd like to see them work well on 
> QNX.
> 
> Regards,
> 
> Ryan Mansfield


Hi Ryan,

Thanks for your response.

We have set default to Gcc3.3.5 by gcc -V3.3.5,gcc_ntox86 -set-default.
then configured the library by following :

1) ./configure --with-toolset=qcc
2) make install.

So thus around 30 targets are not built, around 80 targets skipped and more than 5000 are updated.

We built the same program in momentics after building the boost library with GCC 3.3.5. Instead of 100 errors now we are
 getting only 20 errors. 

We have attached the errors with this posting.

The momentics project settings are as given below

c++ extra include directories /usr/cln/include/boost-1_34_1
linker extra library path /usr/cln/lib
linker extra libraries libboost_filesystem-d.so


Regards,
Lakshmi
Attachment: Text error.txt 7.55 KB
Re: Compiling Boost c++ library in Mementics in QNX  
> We built the same program in momentics after building the boost library with 
> GCC 3.3.5. Instead of 100 errors now we are getting only 20 errors. 
> 
> We have attached the errors with this posting.

> The momentics project settings are as given below
> 
> c++ extra include directories /usr/cln/include/boost-1_34_1
> linker extra library path /usr/cln/lib
> linker extra libraries libboost_filesystem-d.so

Can you attach the console output instead of the problems tab? The problems output is truncated and difficult to read.

The only problem I could properly identify from the output you attached was:

ld: cannot find -llibboost_filesystem-d.so		Ex	line 0	1206449011983	69

Try changing the name in extra libraries from libboost_filesystem-d.so to boot_filesystem-d. Then -lboost_filesystem-d 
will be passed down to the linker, and the linker prepends lib to the archive being searched and appends .so and .a 
looking for appropriate  matching library. By default, linker will use the dynamic variant of the library. The way you 
have it configured right now, the linker is searching for liblibboost_filesystem-d.so.so

Regards,

Ryan Mansfield

Re: Compiling Boost c++ library in Mementics in QNX  
> > We built the same program in momentics after building the boost library with
>  
> > GCC 3.3.5. Instead of 100 errors now we are getting only 20 errors. 
> > 
> > We have attached the errors with this posting.
> 
> > The momentics project settings are as given below
> > 
> > c++ extra include directories /usr/cln/include/boost-1_34_1
> > linker extra library path /usr/cln/lib
> > linker extra libraries libboost_filesystem-d.so
> 
> Can you attach the console output instead of the problems tab? The problems 
> output is truncated and difficult to read.
> 
> The only problem I could properly identify from the output you attached was:
> 
> ld: cannot find -llibboost_filesystem-d.so		Ex	line 0	1206449011983	69
> 
> Try changing the name in extra libraries from libboost_filesystem-d.so to 
> boot_filesystem-d. Then -lboost_filesystem-d will be passed down to the linker
> , and the linker prepends lib to the archive being searched and appends .so 
> and .a looking for appropriate  matching library. By default, linker will use 
> the dynamic variant of the library. The way you have it configured right now, 
> the linker is searching for liblibboost_filesystem-d.so.so
> 
> Regards,
> 
> Ryan Mansfield
> 


Hi Ryan,

The program is:

#include <cstdlib>
#include <iostream>
#include <boost/filesystem.hpp> 

namespace fs = boost::filesystem;

int main(int argc, char *argv[]) 
{       
        fs::path pa("/aaa.xml");
        if( !fs::exists(pa))
              std::cout<<"File does not exist"<<endl;
        else
              std::cout<<"File exists"<<endl;

        return EXIT_SUCCESS;
}

I changed the linker libraries from libboost_filesystem-d.so to boot_filesystem-d, and built the project.

In the first attempt of building, in console of  Momentics, the make was successful , but shown 20 errors and 20 
warnings in problem tab and when I ran the same program it has shown message "Errors exist in required project. Continue
 launch?" , then clicked OK, and got the output as

"File does not exists"

and I built the project twice sequentially, then build successful and it shown no errors and warnings


Inspite of errors how can I able to run the program in the first attempt?
and How can I resolve those 20 errors? 


Here I am attaching the console tab .

Attachment: Text Console.txt 53.85 KB
Re: Compiling Boost c++ library in Mementics in QNX  
> > > We built the same program in momentics after building the boost library 
> with
> >  
> > > GCC 3.3.5. Instead of 100 errors now we are getting only 20 errors. 
> > > 
> > > We have attached the errors with this posting.
> > 
> > > The momentics project settings are as given below
> > > 
> > > c++ extra include directories /usr/cln/include/boost-1_34_1
> > > linker extra library path /usr/cln/lib
> > > linker extra libraries libboost_filesystem-d.so
> > 
> > Can you attach the console output instead of the problems tab? The problems 
> 
> > output is truncated and difficult to read.
> > 
> > The only problem I could properly identify from the output you attached was:
> 
> > 
> > ld: cannot find -llibboost_filesystem-d.so		Ex	line 0	1206449011983	69
> > 
> > Try changing the name in extra libraries from libboost_filesystem-d.so to 
> > boot_filesystem-d. Then -lboost_filesystem-d will be passed down to the 
> linker
> > , and the linker prepends lib to the archive being searched and appends .so 
> 
> > and .a looking for appropriate  matching library. By default, linker will 
> use 
> > the dynamic variant of the library. The way you have it configured right now
> , 
> > the linker is searching for liblibboost_filesystem-d.so.so
> > 
> > Regards,
> > 
> > Ryan Mansfield
> > 
> 
> 
> Hi Ryan,
> 
> The program is:
> 
> #include <cstdlib>
> #include <iostream>
> #include <boost/filesystem.hpp> 
> 
> namespace fs = boost::filesystem;
> 
> int main(int argc, char *argv[]) 
> {       
>         fs::path pa("/aaa.xml");
>         if( !fs::exists(pa))
>               std::cout<<"File does not exist"<<endl;
>         else
>               std::cout<<"File exists"<<endl;
> 
>         return EXIT_SUCCESS;
> }
> 
> I changed the linker libraries from libboost_filesystem-d.so to 
> boot_filesystem-d, and built the project.
> 
> In the first attempt of building, in console of  Momentics, the make was 
> successful , but shown 20 errors and 20 warnings in problem tab and when I ran
>  the same program it has shown message "Errors exist in required project. 
> Continue launch?" , then clicked OK, and got the output as
> 
> "File does not exists"
> 
> and I built the project twice sequentially, then build successful and it shown
>  no errors and warnings
> 
> 
> Inspite of errors how can I able to run the program in the first attempt?
> and How can I resolve those 20 errors? 

From the console log you posted, there are only 20 warnings, not errors which explains why you're able to execute your 
program.  It  looks like the IDE error parser is getting confused and treating the template instantiation locations as 
errors instead of being part of the signed/unsigned comparison warning. One thing you could try is using the -fmessage-
length=n option where n equals the number of characters. The default value for c++ is 72 characters; try specifying a 
long limit and see if the IDE parsers the error message any better.

Can you also specify-Wno-sign-compare and rebuild to confirm there are actually 20 warnings, instead of 20 errors? 

Regards,

Ryan Mansfield
Re: Compiling Boost c++ library in Mementics in QNX  
If you set -fmessage-length=0 it would not truncate at all. This is
recommended setting for 3.3.5.
You can launch program if build is failed, this is user preference, which
you can turn on/off.





Attachment: Text elaskavaia.vcf 94 bytes
Re: Compiling Boost c++ library in Mementics in QNX  
> If you set -fmessage-length=0 it would not truncate at all. This is
> recommended setting for 3.3.5.
> You can launch program if build is failed, this is user preference, which
> you can turn on/off.
> 
> 
> 
> 
> 


Hi Ryan,

I changed the compiler Other options as

fmessage-length=0  -Wno-sign-compare,

now it is working with out any errors or warnings.

Thanks Ryan for the inputs.

Regards,
Lakshmi.