Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8786403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:37:04+00:00 2026-06-13T21:37:04+00:00

The error is generated when a Makefile attempts to compile a .cu (CUDA) file.

  • 0

The error is generated when a Makefile attempts to compile a .cu (CUDA) file.

We were able to compile this by itself with an .hpp made specifically for it. When we try to get it to compile under an existing header with it’s own a .cpp (in other words .hpp, .cpp plus a .cu), we keep getting this strange compilation error.

For the sake of readability, all the follow messages where prefixed with this directory:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4/tr1_impl/

Messages:

type_traits(226): error: expected an identifier
type_traits(227): error: expected a ")"
type_traits(227): error: a template argument list is not allowed in a declaration of a primary template

type_traits(229): error: expected an identifier
type_traits(230): error: expected a ")"
type_traits(230): error: a template argument list is not allowed in a declaration of a primary template

type_traits(232): error: expected an identifier
type_traits(233): error: expected a ")"
type_traits(233): error: expected a ">"

type_traits(235): error: expected an identifier
type_traits(236): error: expected a ")"
type_traits(236): error: expected a ">"

type_traits(238): error: expected an identifier
type_traits(239): error: expected a ")"
type_traits(239): error: expected a ">"

type_traits(241): error: expected an identifier
type_traits(242): error: expected a ")"
type_traits(242): error: expected a ">"

type_traits(244): error: expected an identifier
type_traits(245): error: expected a ")"
type_traits(245): error: expected a ">"

type_traits(247): error: expected an identifier
type_traits(248): error: expected a ")"
type_traits(248): error: expected a ">"

Is it possible to have a single .hpp with a .cu and a .cpp behind it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:37:05+00:00Added an answer on June 13, 2026 at 9:37 pm

    Yes it is possible, and in fact very common, but if the .hpp includes files that nvcc can’t build, then you can’t include it from the .cu.

    You could use #ifndef __CUDACC__ around those files so they don’t get included when compiling the .cu with nvcc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the full error report that is generated when tried to compile my
I get this 'error' when running PEVerify on a custom generated assembly. [MD](0x8013124C): Error:
I get this error when i try to run following command sudo pecl install
Update : The error seems to be generated by this line: *line = color;
The following code: with open(J:\\python\\.data) as data: self.data=pickle.load(data) generated the following error: File J:\python\code.py,
I have a makefile with multiple targets that are generated by copying a file
The error generated is Conditional Compilation is turned off. Conditional Compilation hack from MSDN
When developing a .Net web application, if a run time error is generated, it
@Override public void onCancel() { // TODO Auto-generated method stub ERROR:The method onCancel() of
I do not understand this error, do not generate error in JsonResult Test (),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.