Skip to main content
Filter by
Sorted by
Tagged with
4 votes
3 answers
178 views

I have started a bare-metal kernel targeting the AArch64 architecture for the purpose of education. Use a self-written libc for my kernel which includes the basic string functions. Here the functions ...
Johannes Krottmayer's user avatar
1 vote
1 answer
95 views

I am trying to build the following code on my computer but I run into a lot of errors. The error says that g_tagParams and g_loggerparams are multiply defined in many of the functions. But these two ...
user3147192's user avatar
3 votes
2 answers
222 views

It is known that some linkers do not report multiple definition errors when there are multiple definitions in static libraries. See for example here: Multiple definition within static library or here: ...
Benjamin Bihler's user avatar
1 vote
0 answers
151 views

I'm encountering a 'multiple definition' error while trying to compile a project that includes "mksquashfs". The error I'm getting are like this: /usr/bin/ld: read_fs.o:(.bss+0x0): multiple ...
Alphin Thomas's user avatar
0 votes
1 answer
379 views

Why doesn't defining void* operator new(std::size_t) at the global scope cause a multiple definition link error? E.g. the code below compiles and runs, but I imagine that libstdc++ must define a ...
StoneThrow's user avatar
  • 6,455
0 votes
1 answer
186 views

I have a header file calloc.h, where I defined calloc() function using stdlib's malloc() function. But I am getting multiple definition of 'calloc' error. calloc.h: #include <stdbool.h> #include ...
Himanshu's user avatar
-1 votes
1 answer
196 views

I am using a static library. But when I want to make a SHARED library, I can't build the projectas I get "multiple definition error"s. Library CMake: add_library(arcade-lib SHARED ...
Vinograd's user avatar
1 vote
1 answer
126 views

I have a header header.hxx like this: // header.hxx #ifndef HEADER1 #define HEADER1 typedef struct s_ringreader{ // some stuff in header } RingReader; RingReader defaultReader; #endif and ...
learning_dude's user avatar
6 votes
1 answer
1k views

I'm trying to compile a link together these simple example programs: main.cpp: #include "server.hpp" int main() { } server.hpp: #ifndef SERVER_HPP #define SERVER_HPP #include <boost/...
darkonaito_'s user avatar
0 votes
1 answer
80 views

So, I was going to demonstrate the problem of (non-template) implementation in C++ .h files to a college. But right now I can't reproduce it as expected. Here's my code: // common.h #ifndef common_h #...
jgreen81's user avatar
  • 817
1 vote
0 answers
85 views

I have been trying to get SDL2 to work in my environment but have had no luck. I am using Windows 10 Home with MinGW, working in Eclipse IDE for C/C++ Developers. I downloaded SDL2.26.4 from this ...
Jujimufoo's user avatar
0 votes
1 answer
2k views

I can't resolve this problem on my arduino project. I am using Platformio on vscode. I want to use the MFRC522_I2C library to read rfid badges so I created a class to use the libraries methods. The ...
Antoine's user avatar
  • 127
0 votes
1 answer
267 views

I am writing my own implementation of cat and using getopt_long to parse command line arguments. I have three files: one with function headers, one with function definitions, and one with main. Here ...
e7min's user avatar
  • 41
0 votes
0 answers
37 views

I have been trying to use this library in my C++ project for some time now and can't seem to figure out how to get around the issue of multiple definitions. The library contains only header files (and ...
Gabriel Bello's user avatar
1 vote
1 answer
369 views

Good morning everyone i'm posting this here because i can't figure it out on my own. I've been trying to add ISR function in my project but it doesn't compile. I work on Microship studio on an ...
XavierDes's user avatar
0 votes
0 answers
193 views

I'm new to Media Foundation, and I downloaded the code from the media session playback example, and the Windows 11 SDK. I used the following makefile to compile with MSYS2 g++: LDFLAGS = -LC:\\...
Alvin's user avatar
  • 15
0 votes
2 answers
2k views

I have some small utility functions (< 20 lines of code per function) that I am currently putting in a utils.h file with the keyword inline in front of them so I don't run into multiple definition ...
24n8's user avatar
  • 2,338
0 votes
1 answer
445 views

I'm trying to implement singielton design, but unfortunately this error of multiple definiton occurrs. Everything seems to be alright I cannot find multiple definiton nowhere. I tried to compile it ...
Gameriker's user avatar
0 votes
1 answer
2k views

I have this c++ project with classes' definitions inside .hpp files and methods' declarations inside .cpp files. The project uses a makefile to build and run. The program ran without errors before but ...
Iaco's user avatar
  • 1
5 votes
1 answer
976 views

I faced a situation where different order of linking librdkafka and the Pulsar C++ client does matter, because both of them include their version of LZ4 compression. The linking fails because of ...
János Benjamin Antal's user avatar
0 votes
1 answer
420 views

I've been trying to solve this issue and nothing seems to work, tryed clean the project, run qmake, made sure there was no recursive includes between files, but still showing the error. Also there is ...
Dain's user avatar
  • 63
0 votes
0 answers
26 views

I am a bit new to operator overloading like this. Very simple code: #ifndef QTRIGONOMETRY_H #define QTRIGONOMETRY_H struct Real { double m; }; double operator-( int n, const Real m ) { return n -...
Anon's user avatar
  • 2,531
0 votes
1 answer
1k views

I am getting error: /usr/bin/ld: /tmp/ccCbt8ru.o: in function `some_function()': Thing.cpp:(.text+0x0): multiple definition of `some_function()'; /tmp/ccc0uW5u.o:main.cpp:(.text+0x0): first defined ...
Thuong Vo's user avatar
0 votes
1 answer
273 views

I wanna compiling tftp-hpa from source code but i get following error: gcc tftp.o main.o ../common/libcommon.a -lreadline -ltermcap /home/ali/programming/c/opensource/tftp-hpa/lib/libxtra.a -o tftp ...
alirezaarzehgar's user avatar
1 vote
1 answer
733 views

I'm trying to do a simple program in Contiki to generate a random number between two numbers and then flash it on a Zolertia module. My code is: #include <stdio.h> #include <stdlib.h> #...
João Sacramento's user avatar
0 votes
2 answers
417 views

I am using CodeBlocks. In C++, I have 3 header files and 3 cpp files like below. Base.h class Base { public: virtual int funky(int x, int y); }; Base.cpp int funky(int x, int y) { return x+y; }...
MMT's user avatar
  • 27
0 votes
0 answers
336 views

While implementing three files (tree.h, tree.cpp, and node.h) into an existing project, I've run into "multiple definition of" errors when trying to reference them in my parser.h and parser....
Exho's user avatar
  • 133
0 votes
3 answers
959 views

I'm currently writing a C program with multiple header and source files. I have been running into the problem of multiple definition of function foo. I understand that I am violating the One ...
Stephen Wong's user avatar
1 vote
1 answer
2k views

Why would I want this? I'd like to use a C package that was initially built in 2007 and last updated in 2016 according to the Changelog. I gather that it would have compiled cleanly back than. Sadly, ...
0range's user avatar
  • 2,176
3 votes
1 answer
2k views

I have these two classes (let's call them A and B) that both include boost/archive and boost/serialization files. These includes are in my hpp files (with header guards) for each of the two classes. ...
A.D's user avatar
  • 470
0 votes
1 answer
338 views

I'm working on a set of function templates and the compile just fine. You can see them working here on Compiler Explorer... The issue is when I try to use it with T = float within my project, it is ...
Francis Cugler's user avatar
0 votes
1 answer
477 views

I am currently working on a project that has files (generalFunctions.h and 1x generalFunctions.cpp) that are used by multiple .cpp files. In these files is written #include "generalFunctions.h&...
PietR26's user avatar
  • 25
-2 votes
2 answers
1k views

Suppose I have a header only library. I have simplified it to something like this. Header only library Foo.hpp #ifndef FOO_HPP #define FOO_HPP struct Foo{ static const int A; }; const int Foo::A ...
Bharata's user avatar
  • 747
1 vote
1 answer
155 views

Good morning This is big problem for me to link all files (main.c, myFunc.c, myFuncHeaders.h and MakeFile). Problem is multiple definition when I don't know what should I do with it. I used global ...
Sanetro's user avatar
  • 48
1 vote
0 answers
337 views

Recently updated to Marlin 2.0.6.1, because the compiler won't work with 2.0.6 anymore. Updated the platformio as well. Now when I compile I get these errors, mostly multiple defination kinds, before ...
Bigjonyz's user avatar
1 vote
1 answer
2k views

I was using https://github.com/jdduke/three_cpp as a header-only mode but faced some issues while compiling the same with my project. The issue happens when I include the following matrix4.hpp header (...
user avatar
6 votes
0 answers
462 views

I have 2 static libraries, that were compiled differently. At this point, I don't understand the difference. I just want to understand, for the same symbol in one library, the address of the symbol is ...
user3518295's user avatar
0 votes
0 answers
145 views

I am new to programming in C++ and was wondering if you guys could help me solve this problem. I am doing a program where I have a class for an object that will act as an array. When I try to compile ...
user avatar
0 votes
3 answers
468 views

I am getting error 'multiple definition of swap' from swap function. This code is for selection sort. #include <stdio.h> #include <string.h> static void BiDirectionalSelectionSort(int ...
user avatar
1 vote
0 answers
145 views

For example, in some single C++ file, the definitions shown for a simple symbol x relate to many other irrelevant includePaths: Screenshot How could this be fixed?
SnzFor16Min's user avatar
-2 votes
1 answer
2k views

Basically I'm trying to create a makefile for the project I'm currently working on. The error suggests that I've defined the same function twice in two different files. The error repeats throughout ...
sergih123's user avatar
0 votes
2 answers
83 views

Okay I know "One Definition Rule", but when I try to declare a variable with different types subsequently in source code, I run into some mistake like following: int fkc(); void fkc(); enter image ...
ibrahimkoz's user avatar
1 vote
2 answers
290 views

I'm compiling some C++ code into a library. Suppose my source files are mylib.cpp and util.cpp. The code in util.cpp is used in the library implementation, but is not part of the library in the sense ...
einpoklum's user avatar
  • 138k
2 votes
1 answer
2k views

made a struct, compiled my program, worked perfectly, didn't change anything, closed vm, restarted vm and vsc, and then did make in console again and it came up with this error 1 warning generated. ...
m e m e's user avatar
  • 105
2 votes
1 answer
417 views

In the example given in §14.4.1 "Accelerated C++, A. Koenig and B. E. Moo" I have problems if I implement the template specialization like it is presented in the book. The minimum working example (...
Daniel's user avatar
  • 69
1 vote
0 answers
665 views

context OS: Ubuntu 18.04 Build: CMake 3.10.2 Compiler: gcc-9 (Ubuntu 9.2.1-17ubuntu1~18.04.1) 9.2.1 20191102 Configuration: x86_64, debug action I upgraded to the aforementioned gcc version and ...
MABVT's user avatar
  • 1,360
2 votes
1 answer
212 views

I'm facing a problem with GetPot (http://getpot.sourceforge.net/), namely the fact that when I include it more than once I get a multiple definition error by the linker. Here's a MWE: file main.cpp: ...
Mattia Tamellini's user avatar
0 votes
0 answers
97 views

I have use 1 header file and 2 code files. One of "multiple definition..." function is duplicate because I use "#ifdef _WIN32 ..." and "#ifdef unix...". I have error "multiple definition..." in "...
Peter Roman's user avatar
0 votes
2 answers
1k views

I'm trying to do a Merge Sort code in C++, and to avoid a lot of memory use, I want to declare the auxiliary vector as a global variable. As you might know, using the global variable strategy the ...
Joao Filho's user avatar
0 votes
1 answer
2k views

I am trying to compile an empty project using MPLAB X IDE. I have just used mcc (microchip code configurator) to make the first configuration of the clock only. mcc generated a bunch of header files ...
Ashraf Almubarak's user avatar

1
2 3 4 5