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

  • Home
  • SEARCH
  • 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 7759833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:43:36+00:00 2026-06-01T13:43:36+00:00

I got some problems with the error Link error LNK2005 … already defined. The

  • 0

I got some problems with the error “Link error LNK2005 … already defined”. The files are as follows:

// File Bitmap4.cu
#include "Bitmap4.h" // header
#include "Bitmaps_cuda.h" // header with just the definitions of the kernels

..... // I call 3+2 kernel functions (3 in one method, 1 in another and 1 in another one)

Then I have this one:

// File Bitmap8.cu
#include "Bitmap8.h" // header
#include "Bitmaps_cuda.h" // the same as above

..... // I call 4 kernel functions (4 in the same method)

Then I have the kernel header:

#ifndef __BITMAPS_KERNEL__
#define __BITMAPS_KERNEL__

......  // 9 kernels definitions

#endif

And finally, I have this one:

// File Bitmaps_cuda.h
#include <cuda.h>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
#include <device_functions.h>
#include <stdio.h>

// Inside here there all the kernel functions that the files 
// Bitmap4.cu and Bitmap8.cu are using

The problem is that, if i don’t include the #include “Bitmaps_cuda.h” in one of the Bitmap*.cu, of course, the compiler will say that I missed the definitions of the kernels functions. I read a lot of posts and i already included the “Additional Dipendencies” and the required PATHs. The problems started when I added the file Bitmap8.cu with its relative kernels, because before that, the application was working properly.

Anyway, those are the error that i have:

1>Bitmap8.cu.obj : error LNK2005: "void * __cdecl big_random_block(int(?big_random_block@@YAPAXH@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "int * __cdecl big_random_block_int(int(?big_random_block_int@@YAPAHH@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "unsigned char __cdecl value(float,float,int(?value@@YAEMMH@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "void * __cdecl start_thread(unsigned int(__stdcall*)(void *),void *)" (?start_thread@@YAPAXP6GIPAX@Z0@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "void __cdecl end_thread(void *)"(?end_thread@@YAXPAX@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "void __cdecl destroy_thread(void *)"(?destroy_thread@@YAXPAX@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "void __cdecl wait_for_threads(void * const *,int)"(?wait_for_threads@@YAXPBQAXH@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "void __cdecl__device_stub__Z14float_to_colorPhPKf(unsigned char *,float const *)"(?__device_stub__Z14float_to_colorPhPKf@@YAXPAEPBM@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "void __cdecl float_to_color(unsigned char *,float_const *)" (?float_to_color@@YAXPAEPBM@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "void __cdecl__device_stub__Z14float_to_colorP6uchar4PKf(struct uchar4 *,float const *)"(?__device_stub__Z14float_to_colorP6uchar4PKf@@YAXPAUuchar4@@PBM@Z) already defined in Bitmap4.cu.obj
1>Bitmap8.cu.obj : error LNK2005: "void __cdecl float_to_color(struct uchar4 *,float_const *)" (?float_to_color@@YAXPAUuchar4@@PBM@Z) already defined in Bitmap4.cu.obj

1>C:\Users\dberdin\documents\visual studio 2010\Projects\gpuSPAM\Debug\gpuSPAM.exe : fatal error LNK1169: one or more multiply defined symbols found

I tried different solutions but with any results.

Thank you in advance!

EDIT

On the website (http://msdn.microsoft.com/en-us/library/72zdcz6f.aspx) i found that one of the causes of those errors is:
– An absolute is defined twice, with a different value in each definition.
Well, actually, as i wrote in the bottom, i have these kind of definetions, but i can’t do differently. Any idea how to solve it ?

Thank you again in advance

  • 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-01T13:43:38+00:00Added an answer on June 1, 2026 at 1:43 pm

    Those errors came because i double included a file. Problem Solved!

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

Sidebar

Related Questions

I'm trying to make a appcache file but got some problems... I've added the
got some problems deploying a java web application on jboss 7.1... Stepped through the
I got some problems with finding a bug in php/mysql application, and I wonder
I got some problems with EOF and stdio in a communication pipeline between a
We've got some problems with an external company trying in integrate into a WCF
I've got some problems on a .NET site where both Latin (åäö) and Latvian
I am just starting with C++ and got some problems in understanding how the
i'm new to java and i got some problems. i'm developping a web application
I was trying to perform a SQL statement and got some problems with encoding.
I'm having some problems with the global JNDI names of my EJB resources which

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.