943,714 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 386
  • C++ RSS
Apr 9th, 2009
0

From VC++ to GNU++

Expand Post »
Hello,

I developed an application in VC++ an now I want to compile it using GNU++ to be run on a ubuntu server (where I am actually trying tocompile it). After some syntax/usage corrections I get an error which I totally don't understand (and I don't have it in VC++, of course).
The error is
C++ Syntax (Toggle Plain Text)
  1. Utils.h: In static member function âstatic void brickheuristics::TL2FunV<TList, SearchFun>::FillVector(std::vector<SearchFun, std::allocator<_Tp> >&)â:
  2. Utils.h:43: error: expected `;' before âhâ
  3.  

Now, the function it refers to is the following (error at the 4th line)

C++ Syntax (Toggle Plain Text)
  1. template< class TList, class SearchFun >
  2. struct TL2FunV{
  3. static void FillVector( std::vector< SearchFun >& v ){
  4. TList::Head h;
  5. v.push_back( SearchFun(h) );
  6. TL2FunV<typename TList::Tail, SearchFun>::FillVector( v );
  7. }
  8. };

This application uses the Loki library, which is provided in /usr/lib and the includes in /usr/include.
Head is a typedef in Loki::TypeList, which is the type that is being provided to the function.
Does anyone know what the problem is/may be? Can someone identify a known difference between compilers? I would appreciate if someone could head me in the right direction to solve this.

Thank you in advance
Rui
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
rmlopes is offline Offline
31 posts
since Sep 2008
Apr 9th, 2009
0

Re: From VC++ to GNU++

Because it is a template parameter derived type it needs the typename keyword before.. For some reason VC++ compiles anyway...
Reputation Points: 10
Solved Threads: 0
Light Poster
rmlopes is offline Offline
31 posts
since Sep 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: How to return map iterator to the vector
Next Thread in C++ Forum Timeline: Locating upper case letters within html tags?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC