Problems compiling with Boost
Hello, I am a newbie. I am currently implementing some interprocess functionality into my program which must reside on both a windows and linux operating system. I have completed the windows integration ( this is where the code originally resided) and am now moving it to the linux platform : Debian 4.1.1-21 -- I have created my makefile and am using gcc version 4.1.2. I get the following output on my make and cannot figure out how to fix this issue: GNU C++ version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) (i486-linux-gnu) compiled by GNU C version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129583 Compiler executable checksum: 183d42a838ed2b7313bffcb8f2f2fda7 /usr/include/sys/mman.h:141: error: reference to 'mode_t' is ambiguous /usr/include/sys/types.h:72: error: candidates are: typedef __mode_t mode_t /usr/local/boost_1_41_0/boost/interprocess/detail/os_file_functions.hpp:317: error: typedef enum boost::interprocess::mode_t boost::interprocess::mode_t /usr/include/sys/mman.h:141: error: reference to 'mode_t' is ambiguous /usr/include/sys/types.h:72: error: candidates are: typedef __mode_t mode_t /usr/local/boost_1_41_0/boost/interprocess/detail/os_file_functions.hpp:317: error: typedef enum boost::interprocess::mode_t boost::interprocess::mode_t /usr/include/sys/mman.h:141: error: 'mode_t' has not been declared Common/Src/shmem.cpp: In member function 'void CShDBStorage::Close()': Common/Src/shmem.cpp:443: warning: statement has no effect Common/Src/shmem.cpp:452: warning: unused variable 'hdr' make: *** [Common/Src/shmem.o] Error 1 I found a thread regarding this issue on the internet but did not see a solution. http://lists.boost.org/boost-users/2009/06/49236.php Can anybody help? Carla Strembicke Software Developer [cid:imageb2f4fa.jpg@d8df2841.2d3d4834] SUBNET Solutions Inc. www.SUBNET.comhttp://www.subnet.com/ Making Substations More Intelligent T: 403.270.8885 F: 403.270.9631 #100, 4639 Manhattan Road SE, Calgary, Alberta, Canada; T2G 4B3 Follow SUBNET: Twitterhttp://twitter.com/subnetsolutions | Facebookhttp://www.facebook.com/subnetsolutions | Linkedlnhttp://www.linkedin.com/groups?gid=2733031&trk=hb_side_g Visit the all new SUBNET website at http://www.SUBNET.comhttp://www.subnet.com/ CONFIDENTIAL INFORMATION NOTICE: The information contained in this e-mail is privileged, confidential and intended solely for the use of the addressee named above. If the reader of this e-mail is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail is strictly prohibited. If you received this in error, please contact the sender and destroy all copies of this e-mail. Thank you.
AMDG Carla Strembicke wrote:
I am currently implementing some interprocess functionality into my program which must reside on both a windows and linux operating system. I have completed the windows integration ( this is where the code originally resided) and am now moving it to the linux platform : Debian 4.1.1-21 -- I have created my makefile and am using gcc version 4.1.2. I get the following output on my make and cannot figure out how to fix this issue:
GNU C++ version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) (i486-linux-gnu) compiled by GNU C version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129583 Compiler executable checksum: 183d42a838ed2b7313bffcb8f2f2fda7 /usr/include/sys/mman.h:141: error: reference to 'mode_t' is ambiguous /usr/include/sys/types.h:72: error: candidates are: typedef __mode_t mode_t /usr/local/boost_1_41_0/boost/interprocess/detail/os_file_functions.hpp:317: error: typedef enum boost::interprocess::mode_t boost::interprocess::mode_t /usr/include/sys/mman.h:141: error: reference to 'mode_t' is ambiguous /usr/include/sys/types.h:72: error: candidates are: typedef __mode_t mode_t /usr/local/boost_1_41_0/boost/interprocess/detail/os_file_functions.hpp:317: error: typedef enum boost::interprocess::mode_t boost::interprocess::mode_t /usr/include/sys/mman.h:141: error: 'mode_t' has not been declared Common/Src/shmem.cpp: In member function 'void CShDBStorage::Close()': Common/Src/shmem.cpp:443: warning: statement has no effect Common/Src/shmem.cpp:452: warning: unused variable 'hdr' make: *** [Common/Src/shmem.o] Error 1
I found a thread regarding this issue on the internet but did not see a solution. http://lists.boost.org/boost-users/2009/06/49236.php
Can anybody help?
Do you have using namespace boost::interprocess; somewhere by any chance? In Christ, Steven Watanabe
Yes I do.
I have it in my header file (Common/Src/shmem.h) where I declare an boost interprocess object.
#include
I am currently implementing some interprocess functionality into my program which must reside on both a windows and linux operating system. I have completed the windows integration ( this is where the code originally resided) and am now moving it to the linux platform : Debian 4.1.1-21 -- I have created my makefile and am using gcc version 4.1.2. I get the following output on my make and cannot figure out how to fix this issue:
GNU C++ version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) (i486-linux-gnu) compiled by GNU C version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129583 Compiler executable checksum: 183d42a838ed2b7313bffcb8f2f2fda7 /usr/include/sys/mman.h:141: error: reference to 'mode_t' is ambiguous /usr/include/sys/types.h:72: error: candidates are: typedef __mode_t mode_t /usr/local/boost_1_41_0/boost/interprocess/detail/os_file_functions.hpp:317: error: typedef enum boost::interprocess::mode_t boost::interprocess::mode_t /usr/include/sys/mman.h:141: error: reference to 'mode_t' is ambiguous /usr/include/sys/types.h:72: error: candidates are: typedef __mode_t mode_t /usr/local/boost_1_41_0/boost/interprocess/detail/os_file_functions.hpp:317: error: typedef enum boost::interprocess::mode_t boost::interprocess::mode_t /usr/include/sys/mman.h:141: error: 'mode_t' has not been declared Common/Src/shmem.cpp: In member function 'void CShDBStorage::Close()': Common/Src/shmem.cpp:443: warning: statement has no effect Common/Src/shmem.cpp:452: warning: unused variable 'hdr' make: *** [Common/Src/shmem.o] Error 1
I found a thread regarding this issue on the internet but did not see a solution. http://lists.boost.org/boost-users/2009/06/49236.php
Can anybody help?
Do you have using namespace boost::interprocess; somewhere by any chance? In Christ, Steven Watanabe _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
AMDG Carla Strembicke wrote:
I have it in my header file (Common/Src/shmem.h) where I declare an boost interprocess object.
#include
#include #include using namespace boost::interprocess;
That's probably your problem. It's generally a bad idea to put using directives in header files. If you don't want to type out boost::interprocess:: everywhere, use a namespace alias. In Christ, Steven Watanabe
Thank you. That fixed the issue. Apparently windows compiler doesn't mind the namespace in the header file but the GNU compiler, not so much. Cheers Carla -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: February-08-10 12:57 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Problems compiling with Boost AMDG Carla Strembicke wrote:
I have it in my header file (Common/Src/shmem.h) where I declare an boost interprocess object.
#include
#include #include using namespace boost::interprocess;
That's probably your problem. It's generally a bad idea to put using directives in header files. If you don't want to type out boost::interprocess:: everywhere, use a namespace alias. In Christ, Steven Watanabe _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Carla Strembicke
-
Steven Watanabe