Hi, I have install boost library using this: $ sudo port install boost It seems download and compile fine on my local machine. But then i tried to compile a simple echo client example from http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/examples.html I get a bunch of compiler errors. I am using "g++ -o block_client blocking_udp_echo_client.cpp " Here are some of the errors: $ g++ -o block_client blocking_udp_echo_client.cpp blocking_udp_echo_client.cpp:68:10: error: #include expects "FILENAME" or <FILENAME> blocking_udp_echo_client.cpp:69:10: error: #include expects "FILENAME" or <FILENAME> blocking_udp_echo_client.cpp:70:10: error: #include expects "FILENAME" or <FILENAME> blocking_udp_echo_client.cpp:71:10: error: #include expects "FILENAME" or <FILENAME> blocking_udp_echo_client.cpp:83: error: stray ‘\’ in program blocking_udp_echo_client.cpp:108: error: stray ‘\’ in program blocking_udp_echo_client.cpp:112: error: stray ‘\’ in program Thank you for any help.
See reply inline On Jul 23, 2009, at 10:49 PM, n179911 wrote:
Hi,
I have install boost library using this: $ sudo port install boost It seems download and compile fine on my local machine.
But then i tried to compile a simple echo client example from http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/examples.html
I get a bunch of compiler errors. I am using "g++ -o block_client blocking_udp_echo_client.cpp "
Here are some of the errors: $ g++ -o block_client blocking_udp_echo_client.cpp blocking_udp_echo_client.cpp:68:10: error: #include expects "FILENAME" or <FILENAME>
If I'm reading this correctly, the error is on line 68 of blocking_udp_echo_client.cpp, but when I follow your link, then the link to that file, copy the example and paste it into vi, I see that the file is only 60 lines long. I would guess that the file you're compiling doesn't contain what you think it does, or you added stuff to the end of the file that isn't legal C. The error is about bad #include statementa. Maybe you should post the source you're trying to compile? - Rush
blocking_udp_echo_client.cpp:69:10: error: #include expects "FILENAME" or <FILENAME> blocking_udp_echo_client.cpp:70:10: error: #include expects "FILENAME" or <FILENAME> blocking_udp_echo_client.cpp:71:10: error: #include expects "FILENAME" or <FILENAME> blocking_udp_echo_client.cpp:83: error: stray ‘\’ in program blocking_udp_echo_client.cpp:108: error: stray ‘\’ in program blocking_udp_echo_client.cpp:112: error: stray ‘\’ in program
Thank you for any help. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
AMDG Rush Manbert wrote:
On Jul 23, 2009, at 10:49 PM, n179911 wrote:
But then i tried to compile a simple echo client example from http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/examples.html
I get a bunch of compiler errors. I am using "g++ -o block_client blocking_udp_echo_client.cpp "
Here are some of the errors: $ g++ -o block_client blocking_udp_echo_client.cpp blocking_udp_echo_client.cpp:68:10: error: #include expects "FILENAME" or <FILENAME>
If I'm reading this correctly, the error is on line 68 of blocking_udp_echo_client.cpp, but when I follow your link, then the link to that file, copy the example and paste it into vi, I see that the file is only 60 lines long.
I would guess that the file you're compiling doesn't contain what you think it does, or you added stuff to the end of the file that isn't legal C.
Perhaps you're trying to compile html? In Christ, Steven Watanabe
On Jul 24, 2009, at 8:30 AM, Steven Watanabe wrote:
AMDG
Rush Manbert wrote:
On Jul 23, 2009, at 10:49 PM, n179911 wrote:
But then i tried to compile a simple echo client example from http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/examples.html
I get a bunch of compiler errors. I am using "g++ -o block_client blocking_udp_echo_client.cpp "
Here are some of the errors: $ g++ -o block_client blocking_udp_echo_client.cpp blocking_udp_echo_client.cpp:68:10: error: #include expects "FILENAME" or <FILENAME>
If I'm reading this correctly, the error is on line 68 of blocking_udp_echo_client.cpp, but when I follow your link, then the link to that file, copy the example and paste it into vi, I see that the file is only 60 lines long.
I would guess that the file you're compiling doesn't contain what you think it does, or you added stuff to the end of the file that isn't legal C.
Perhaps you're trying to compile html?
Good catch! That would make a lot of sense. Best regards, Rush
Sorry. I copy-and-paste the wrong compile error:
$ g++ -o echo_client blocking_udp_echo_client.cpp
blocking_udp_echo_client.cpp:14:26: error: boost/asio.hpp: No such
file or directory
blocking_udp_echo_client.cpp:16: error: ‘boost’ has not been declared
blocking_udp_echo_client.cpp:16: error: expected nested-name-specifier
before ‘udp’
blocking_udp_echo_client.cpp:16: error: ‘udp’ has not been declared
blocking_udp_echo_client.cpp: In function ‘int main(int, char**)’:
blocking_udp_echo_client.cpp:30: error: ‘boost’ has not been declared
blocking_udp_echo_client.cpp:30: error: ‘io_service’ was not declared
in this scope
blocking_udp_echo_client.cpp:30: error: expected `;' before ‘io_service’
blocking_udp_echo_client.cpp:32: error: ‘udp’ has not been declared
It seems the compiler can't find the boost library on MacOS X. But I
have installed it via:
$ sudo port install boost
It seems download and compile fine on my local machine.
On Fri, Jul 24, 2009 at 8:30 AM, Steven Watanabe
AMDG
Rush Manbert wrote:
On Jul 23, 2009, at 10:49 PM, n179911 wrote:
But then i tried to compile a simple echo client example from http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/examples.html
I get a bunch of compiler errors. I am using "g++ -o block_client blocking_udp_echo_client.cpp "
Here are some of the errors: $ g++ -o block_client blocking_udp_echo_client.cpp blocking_udp_echo_client.cpp:68:10: error: #include expects "FILENAME" or <FILENAME>
If I'm reading this correctly, the error is on line 68 of blocking_udp_echo_client.cpp, but when I follow your link, then the link to that file, copy the example and paste it into vi, I see that the file is only 60 lines long.
I would guess that the file you're compiling doesn't contain what you think it does, or you added stuff to the end of the file that isn't legal C.
Perhaps you're trying to compile html?
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
It sounds like you don't have the include path for boost as part of your build environment. By default I believe it should be installed somewhere like '/opt/local/include/boost'. If you are using a compiled boost library, you may also need '/opt/local/lib'. Can you post more information on what build system you are using? (Xcode, eclipse, make, etc). Justin
On Fri, Jul 24, 2009 at 9:53 AM,
justinleona@gmail.com
It sounds like you don't have the include path for boost as part of your build environment. By default I believe it should be installed somewhere like '/opt/local/include/boost'. If you are using a compiled boost library, you may also need '/opt/local/lib'. Can you post more information on what build system you are using? (Xcode, eclipse, make, etc).
I am building it from command line: $ g++ -o block_client blocking_udp_echo_client.cpp Can you please tell me how to add include path and boost library in g++ command? Thank you.
Justin _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
n179911 wrote:
Can you please tell me how to add include path and boost library in g++ command?
If I was in a bad mood I certainly have either send you to c++.moderated or telling you to man gcc ... As it seems someone hasn't do his homework, here is some hint :o g+++ <your file> -I<path to include> -L<path to lib> -l<libname> -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35
On Fri, Jul 24, 2009 at 9:53 AM,
justinleona@gmail.com
It sounds like you don't have the include path for boost as part of your build environment. By default I believe it should be installed somewhere like '/opt/local/include/boost'. If you are using a compiled boost library, you may also need '/opt/local/lib'. Can you post more information on what build system you are using? (Xcode, eclipse, make, etc).
Thanks. I have created a XCode project and I have add Header Search Path to /opt/local/include/boost Library Search Path to /opt/local/lib. But I still have this error: "boost::system::get_generic_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o I found this thread http://www.nabble.com/installing-boost-on-Mac-OS-X-(version-10.5.5)-td200872... but it did not solve my problem.
Justin _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
n179911 wrote:
On Fri, Jul 24, 2009 at 9:53 AM, justinleona@gmail.com
wrote: It sounds like you don't have the include path for boost as part of your build environment. By default I believe it should be installed somewhere like '/opt/local/include/boost'. If you are using a compiled boost library, you may also need '/opt/local/lib'. Can you post more information on what build system you are using? (Xcode, eclipse, make, etc).
Thanks. I have created a XCode project and I have add Header Search Path to /opt/local/include/boost Library Search Path to /opt/local/lib.
But I still have this error: "boost::system::get_generic_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o
I found this thread http://www.nabble.com/installing-boost-on-Mac-OS-X-(version-10.5.5)-td200872... but it did not solve my problem.
This is because you did not link to Boost.System library. - Volodya
On Sat, Jul 25, 2009 at 12:21 AM, Vladimir
Prus
n179911 wrote:
On Fri, Jul 24, 2009 at 9:53 AM, justinleona@gmail.com
wrote: It sounds like you don't have the include path for boost as part of your build environment. By default I believe it should be installed somewhere like '/opt/local/include/boost'. If you are using a compiled boost library, you may also need '/opt/local/lib'. Can you post more information on what build system you are using? (Xcode, eclipse, make, etc).
Thanks. I have created a XCode project and I have add Header Search Path to /opt/local/include/boost Library Search Path to /opt/local/lib.
But I still have this error: "boost::system::get_generic_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o
I found this thread http://www.nabble.com/installing-boost-on-Mac-OS-X-(version-10.5.5)-td200872... but it did not solve my problem.
This is because you did not link to Boost.System library.
I have add /opt/local/lib to my LIBRARY SEARCH PATH in my xcode project info. And in my /opt/local/lib, I find this (I assume that is Boost.System library): -rw-r--r-- 2 root admin 80600 Jul 23 16:31 libboost_system-mt.a -rwxr-xr-x 2 root admin 30988 Jul 23 16:30 libboost_system-mt.dylib*
- Volodya
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On 7/25/09 12:39 AM, n179911 wrote:
On Sat, Jul 25, 2009 at 12:21 AM, Vladimir Prus
wrote: n179911 wrote:
On Fri, Jul 24, 2009 at 9:53 AM, justinleona@gmail.com
wrote: It sounds like you don't have the include path for boost as part of your build environment. By default I believe it should be installed somewhere like '/opt/local/include/boost'. If you are using a compiled boost library, you may also need '/opt/local/lib'. Can you post more information on what build system you are using? (Xcode, eclipse, make, etc).
I have created a XCode project and I have add Header Search Path to /opt/local/include/boost Library Search Path to /opt/local/lib.
But I still have this error: "boost::system::get_generic_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o
I found this thread http://www.nabble.com/installing-boost-on-Mac-OS-X-(version-10.5.5)-td200872 59.html but it did not solve my problem. This is because you did not link to Boost.System library.
I have add /opt/local/lib to my LIBRARY SEARCH PATH in my xcode project info. And in my /opt/local/lib, I find this (I assume that is Boost.System library):
-rw-r--r-- 2 root admin 80600 Jul 23 16:31 libboost_system-mt.a -rwxr-xr-x 2 root admin 30988 Jul 23 16:30 libboost_system-mt.dylib*
You need to add libboost_system-mt.dylib as an external link library for the target you are linking. See Xcode Build System Guide: Linking to a Dynamic Library in a Nonstandard Location Regards, Grant
participants (7)
-
Grant Erickson
-
joel
-
justinleona@gmail.com
-
n179911
-
Rush Manbert
-
Steven Watanabe
-
Vladimir Prus