Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question::__argv ist NULL, but ::__argc is correct, why? Pin
Erik25-Sep-11 23:58
Erik25-Sep-11 23:58 
AnswerRe: ::__argv ist NULL, but ::__argc is correct, why? Pin
Madhu Nair26-Sep-11 0:29
Madhu Nair26-Sep-11 0:29 
AnswerRe: ::__argv ist NULL, but ::__argc is correct, why? Pin
jk chan26-Sep-11 3:52
jk chan26-Sep-11 3:52 
QuestionInstall LSP(Layered Service Provider) without a reboot? Pin
Syouki_kou25-Sep-11 20:28
Syouki_kou25-Sep-11 20:28 
Questionwrite multistring value to ADS key Pin
jkirkerx25-Sep-11 13:08
professionaljkirkerx25-Sep-11 13:08 
AnswerRe: write multistring value to ADS key Pin
Richard Andrew x6425-Sep-11 14:05
professionalRichard Andrew x6425-Sep-11 14:05 
GeneralRe: write multistring value to ADS key Pin
jkirkerx25-Sep-11 15:31
professionaljkirkerx25-Sep-11 15:31 
Questionreference prob with namespace C++ Pin
Schehaider_Aymen25-Sep-11 12:00
Schehaider_Aymen25-Sep-11 12:00 
Hello all,

I'm looking on the way that i could create my own namepsace and use it under C++.

i wrote a .h file

C++
#ifndef FOO_H
#define FOO_H

namespace FOO
{
	int add (int a , int b);
}
	
#endif//FOO_H


and a cxx file
C++
#include "Foo.h"

namespace FOO
{
	int add (int a , int b)
	{
		return (a+b);
	}
}


And in the main prog (test.cxx) i did as shown below

C++
#include <iostream>
#include "Foo.h"

using namespace FOO;

int main(int argc, char **argv)
{
	
	std::cout << add(5, 6) << std::endl ;
	return 0;
}


when i compile the prog it mentions no problems but when i try to execute it it said

undefined reference to `FOO::add(int, int)'Unsure | :~

i look on the net but still having that issue.

how could i make it correct ?

thank you. Wink | ;)
"The Ultimate Limit Is Only Your Imagination."

AnswerRe: reference prob with namespace C++ Pin
Schehaider_Aymen25-Sep-11 12:39
Schehaider_Aymen25-Sep-11 12:39 
GeneralRe: reference prob with namespace C++ Pin
Emilio Garavaglia25-Sep-11 21:20
Emilio Garavaglia25-Sep-11 21:20 
GeneralRe: reference prob with namespace C++ Pin
Schehaider_Aymen25-Sep-11 22:48
Schehaider_Aymen25-Sep-11 22:48 
GeneralRe: reference prob with namespace C++ Pin
Richard MacCutchan25-Sep-11 23:03
mveRichard MacCutchan25-Sep-11 23:03 
QuestionHow to use CMimeMessage to send a mail with attached file? Pin
yu-jian25-Sep-11 3:44
yu-jian25-Sep-11 3:44 
AnswerRe: How to use CMimeMessage to send a mail with attached file? Pin
André Kraak25-Sep-11 4:38
André Kraak25-Sep-11 4:38 
QuestionWatch cannot find symbol $x Pin
AlecJames24-Sep-11 4:35
AlecJames24-Sep-11 4:35 
AnswerRe: Watch cannot find symbol $x Pin
Richard MacCutchan24-Sep-11 5:56
mveRichard MacCutchan24-Sep-11 5:56 
GeneralRe: Watch cannot find symbol $x Pin
Albert Holguin24-Sep-11 6:34
professionalAlbert Holguin24-Sep-11 6:34 
GeneralRe: Watch cannot find symbol $x Pin
Richard MacCutchan24-Sep-11 6:43
mveRichard MacCutchan24-Sep-11 6:43 
QuestionVC++ Graphs. Pin
Vijay Rajanna23-Sep-11 7:08
Vijay Rajanna23-Sep-11 7:08 
AnswerRe: VC++ Graphs. Pin
Rajesh R Subramanian23-Sep-11 7:20
professionalRajesh R Subramanian23-Sep-11 7:20 
AnswerRe: VC++ Graphs. Pin
Albert Holguin23-Sep-11 8:36
professionalAlbert Holguin23-Sep-11 8:36 
AnswerRe: VC++ Graphs. Pin
Vijay Rajanna23-Sep-11 9:01
Vijay Rajanna23-Sep-11 9:01 
GeneralRe: VC++ Graphs. Pin
Software_Developer23-Sep-11 9:37
Software_Developer23-Sep-11 9:37 
AnswerRe: VC++ Graphs. Pin
Cedric Moonen25-Sep-11 20:31
Cedric Moonen25-Sep-11 20:31 
QuestionCan I use a SetTimer() API in a console c++ app. Pin
JosephJohnAllen23-Sep-11 5:57
JosephJohnAllen23-Sep-11 5:57 

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.