"error: expected unqualified-id before numeric constant" after linking an external library

329 views
Skip to first unread message

Infiel

unread,
Feb 21, 2012, 7:20:58 AM2/21/12
to ns-3-...@googlegroups.com
Hello,

I was trying to port a module from ns2 to ns3 (cause earlier I was working on NS2). But that module was written with the use of ITPP libraries, so, to make a taks easier (especially the initial step). I modify the wscript with lines:

    conf.env.append_value("CXXFLAGS", ["-Wall", "-g", "-DNDEBUG", "-pipe", "-O2"])
    conf.env.append_value("LINKFLAGS", "-litpp")

flags were obtained by:
     pkg-config --cflags itpp
   pkg-config --libs itpp

After that I have added an include declaration:

#include <itpp/itbase.h>

and nothing more. During compilation, I have an error:

In file included from /usr/include/itpp/base/gf2mat.h:48,
                 from /usr/include/itpp/itbase.h:114,
                 from ../src/lte/helper/geometry-helper.cc:15:
/usr/include/itpp/base/svec.h:326: error: expected unqualified-id before numeric constant
/usr/include/itpp/base/svec.h: In copy constructor ‘itpp::Sparse_Vec<T>::Sparse_Vec(const itpp::Sparse_Vec<T>&)’:
/usr/include/itpp/base/svec.h:404: error: expected unqualified-id before numeric constant
/usr/include/itpp/base/svec.h:404: error: expected ‘;’ before numeric constant
/usr/include/itpp/base/svec.h: In member function ‘itpp::Sparse_Vec<T> itpp::Sparse_Vec<T>::get_subvector(int, int) const’:
/usr/include/itpp/base/svec.h:816: error: expected unqualified-id before numeric constant
/usr/include/itpp/base/svec.h:816: error: expected ‘;’ before numeric constant
/usr/include/itpp/base/svec.h: In member function ‘void itpp::Sparse_Vec<T>::operator=(const itpp::Sparse_Vec<T>&)’:
/usr/include/itpp/base/svec.h:840: error: expected unqualified-id before numeric constant
/usr/include/itpp/base/svec.h:840: error: expected ‘;’ before numeric constant
/usr/include/itpp/base/svec.h: In member function ‘bool itpp::Sparse_Vec<T>::operator==(const itpp::Sparse_Vec<T>&)’:
/usr/include/itpp/base/svec.h:932: error: expected unqualified-id before numeric constant

=================================

What that means and how do I can overcame this problem? Is that a name conflict with some typdef od constant definitions from current NS3 code ?

Carlo Santos

unread,
Feb 21, 2012, 9:01:12 AM2/21/12
to ns-3-...@googlegroups.com
On Tue, Feb 21, 2012 at 8:20 PM, Infiel <pank...@gmail.com> wrote:
Hello,

I was trying to port a module from ns2 to ns3 (cause earlier I was working on NS2). But that module was written with the use of ITPP libraries, so, to make a taks easier (especially the initial step). I modify the wscript with lines:

By "the wscript" are you referring to the wscript inside src and not inside the modules?
 

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/nARV9HZCBc4J.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.



--
Carlo Santos

Infiel

unread,
Feb 21, 2012, 9:30:15 AM2/21/12
to ns-3-...@googlegroups.com
Okay, I have figured it out!!!. In the file in which I had included itpp libraries, a had eps variable defined (#define eps 0.0000000001). Yeach, I love c++.

Here is the link:
http://www.nsnam.org/wiki/index.php/HOWTO_use_ns-3_with_other_libraries

I have just used code in the second box (conf.env.appen_value() ...) when I have added a proper flags (obtained by pkg-config).
Reply all
Reply to author
Forward
0 new messages