Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: REceive events in serial comms Pin
Trollslayer6-Mar-06 1:57
mentorTrollslayer6-Mar-06 1:57 
Questionplease read it is importent Pin
baldha rakesh6-Mar-06 0:47
baldha rakesh6-Mar-06 0:47 
AnswerRe: please read it is importent Pin
Christian Graus6-Mar-06 1:03
protectorChristian Graus6-Mar-06 1:03 
Questionproblem using NtQuerySystemInformation Pin
gamitech6-Mar-06 0:19
gamitech6-Mar-06 0:19 
QuestionDirectory Pin
sundar_mca6-Mar-06 0:17
sundar_mca6-Mar-06 0:17 
QuestionRe: Directory Pin
David Crow6-Mar-06 2:48
David Crow6-Mar-06 2:48 
QuestionProblem with SQLSetEnvAttr Pin
Amit j Patil5-Mar-06 23:49
Amit j Patil5-Mar-06 23:49 
QuestionDeclare in form1.h causes error Pin
jantimmerman5-Mar-06 23:43
jantimmerman5-Mar-06 23:43 
Hello,

I was experiencing a strange error that I tracked down to be a declaration in Form1.h
I attemped to reproduce the problem in a brand new project and to my surprise: the error appeared again.

In the new "windows forms" project

test1.cpp:
<br />
#include "stdafx.h"<br />
#include "form1.h"<br />

Added to form1.h
<br />
int test;


error:
test.obj : error LNK2005: "int test" (?test@@$$Q3HA) already defined in IncludeTest.obj
D:\VC\IncludeTest\Debug\IncludeTest.exe : fatal error LNK1169: one or more multiply defined symbols found.

I have tried int test in stdafx.h. This does compile though stdafx.h is also included in both the main and test.cpp.

Project available here (44k, created with VC++ 2005)

I thought this was according to c++ language rules, but apparently I am doing something wrong?

Best regards,
Jan Timmerman
AnswerRe: Declare in form1.h causes error Pin
Sebastian Schneider5-Mar-06 23:46
Sebastian Schneider5-Mar-06 23:46 
AnswerRe: Declare in form1.h causes error Pin
Ryan Binns5-Mar-06 23:57
Ryan Binns5-Mar-06 23:57 
GeneralRe: Declare in form1.h causes error Pin
jantimmerman6-Mar-06 1:14
jantimmerman6-Mar-06 1:14 
GeneralRe: Declare in form1.h causes error Pin
Ryan Binns6-Mar-06 3:10
Ryan Binns6-Mar-06 3:10 
QuestionVS 2005 manifest file problem. Pin
yourbuddy775-Mar-06 23:39
yourbuddy775-Mar-06 23:39 
QuestionConversion from VS 6.0 to .Net Pin
Neelesh K J Jain5-Mar-06 23:28
Neelesh K J Jain5-Mar-06 23:28 
AnswerRe: Conversion from VS 6.0 to .Net Pin
Nibu babu thomas5-Mar-06 23:36
Nibu babu thomas5-Mar-06 23:36 
AnswerRe: Conversion from VS 6.0 to .Net Pin
Christian Graus6-Mar-06 1:04
protectorChristian Graus6-Mar-06 1:04 
QuestionPower of 2 Pin
RichardS5-Mar-06 23:23
RichardS5-Mar-06 23:23 
Answer[Removed] Pin
toxcct5-Mar-06 23:28
toxcct5-Mar-06 23:28 
GeneralRe: Power of 2 Pin
RichardS5-Mar-06 23:34
RichardS5-Mar-06 23:34 
GeneralRe: Power of 2 Pin
Cedric Moonen5-Mar-06 23:44
Cedric Moonen5-Mar-06 23:44 
GeneralRe: Power of 2 Pin
toxcct5-Mar-06 23:46
toxcct5-Mar-06 23:46 
GeneralRe: Power of 2 Pin
Stephen Hewitt5-Mar-06 23:45
Stephen Hewitt5-Mar-06 23:45 
GeneralRe: Power of 2 Pin
Stephen Hewitt6-Mar-06 2:04
Stephen Hewitt6-Mar-06 2:04 
GeneralRe: Power of 2 Pin
toxcct6-Mar-06 2:06
toxcct6-Mar-06 2:06 
AnswerRe: Power of 2 Pin
Russell'5-Mar-06 23:33
Russell'5-Mar-06 23:33 

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.