Click here to Skip to main content
14,930,017 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Why isn't the copy constructor called - Solved Pin
Greg Utas24-Sep-20 1:00
mvaGreg Utas24-Sep-20 1:00 
GeneralRe: Why isn't the copy constructor called - Solved Pin
Mircea Neacsu24-Sep-20 2:51
mvaMircea Neacsu24-Sep-20 2:51 
GeneralRe: Why isn't the copy constructor called - Solved Pin
Greg Utas24-Sep-20 3:20
mvaGreg Utas24-Sep-20 3:20 
Questioncompilers for pure assembly code Pin
CalinNegru(fearless_)19-Sep-20 0:46
MemberCalinNegru(fearless_)19-Sep-20 0:46 
AnswerRe: compilers for pure assembly code Pin
Richard MacCutchan19-Sep-20 2:24
mveRichard MacCutchan19-Sep-20 2:24 
AnswerRe: compilers for pure assembly code Pin
Joe Woodbury22-Sep-20 11:38
professionalJoe Woodbury22-Sep-20 11:38 
AnswerRe: compilers for pure assembly code Pin
CalinNegru(fearless_)24-Sep-20 1:00
MemberCalinNegru(fearless_)24-Sep-20 1:00 
QuestionWhy do I get "undefined reference to..." when trying to call a C-function inside a .cpp-file? Pin
arnold_w10-Sep-20 4:54
Memberarnold_w10-Sep-20 4:54 
I am writing code for an ARM processor and compiling with GCC inside Eclipse IDE. My project has 3 files, main.c, myDummyFile.h and myDummyFile.cpp. myDummyFile.h:
#ifndef MYDUMMYFILE_H_
#define MYDUMMYFILE_H_

#ifdef __cplusplus
extern "C" {
#endif

int myDummyFunction();

#ifdef __cplusplus
} //end extern "C"
#endif

#endif /* MYDUMMYFILE_H_ */
myDummyFile.cpp:
#include <functional>
using namespace std;

// Throw in some C++ syntax to make sure this file is compiled as a C++ file and not as C-file
using cPlusPlusCallback_t = function <int(int myParam)>;

volatile int preventOptimizationDummy = 0;

int myDummyFunction() {
	return preventOptimizationDummy++;
}
main.c:
#include <stdio.h>
#include <stdlib.h>
#include "myDummyFile.h"

int main(int argc, char* argv[]) {
	return myDummyFunction();
}
Does anybody know why I get the error message "undefined reference to `myDummyFunction'" when I try to compile this? If I remove the call to myDummyFunction() then it compiles fine so the compiler does seem to be able to compile .cpp-files.
AnswerRe: Why do I get "undefined reference to..." when trying to call a C-function inside a .cpp-file? PinPopular
Richard MacCutchan10-Sep-20 5:30
mveRichard MacCutchan10-Sep-20 5:30 
QuestionIcons for Executable Files - SOLVED Pin
Richard Andrew x649-Sep-20 14:55
professionalRichard Andrew x649-Sep-20 14:55 
QuestionWhat's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w9-Sep-20 8:16
Memberarnold_w9-Sep-20 8:16 
AnswerRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Mircea Neacsu9-Sep-20 11:20
mvaMircea Neacsu9-Sep-20 11:20 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w9-Sep-20 11:33
Memberarnold_w9-Sep-20 11:33 
AnswerRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Mircea Neacsu9-Sep-20 12:11
mvaMircea Neacsu9-Sep-20 12:11 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w9-Sep-20 12:28
Memberarnold_w9-Sep-20 12:28 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Randor 9-Sep-20 12:44
professional Randor 9-Sep-20 12:44 
AnswerRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Joe Woodbury9-Sep-20 12:38
professionalJoe Woodbury9-Sep-20 12:38 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w9-Sep-20 14:35
Memberarnold_w9-Sep-20 14:35 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Joe Woodbury9-Sep-20 15:14
professionalJoe Woodbury9-Sep-20 15:14 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Stefan_Lang15-Sep-20 3:34
mveStefan_Lang15-Sep-20 3:34 
AnswerRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w11-Sep-20 12:46
Memberarnold_w11-Sep-20 12:46 
QuestionCWinThread for background processing Pin
Richard Andrew x645-Sep-20 10:13
professionalRichard Andrew x645-Sep-20 10:13 
AnswerRe: CWinThread for background processing Pin
Mircea Neacsu5-Sep-20 16:18
mvaMircea Neacsu5-Sep-20 16:18 
GeneralRe: CWinThread for background processing Pin
Richard Andrew x645-Sep-20 17:03
professionalRichard Andrew x645-Sep-20 17:03 
AnswerRe: CWinThread for background processing Pin
Randor 5-Sep-20 16:44
professional Randor 5-Sep-20 16:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.