Connecting Tech Pros Worldwide Forums | Help | Site Map

Shortcut to compile a file of any type

Torben Laursen
Guest
 
Posts: n/a
#1: Nov 24 '06
Hi

Often I just want to compile one c++ file in a project the check it for
errors.
Now I can right click on a *.cpp file and select "Compile"
But is there a way and short cut to compile a file of any type. luke *.cc,
*.h, *hpp

Thanks Torben



Ben Voigt
Guest
 
Posts: n/a
#2: Nov 24 '06

re: Shortcut to compile a file of any type



"Torben Laursen" <Torben@newsgroups.nospamwrote in message
news:uuUA5V9DHHA.1012@TK2MSFTNGP04.phx.gbl...
Quote:
Hi
>
Often I just want to compile one c++ file in a project the check it for
errors.
Now I can right click on a *.cpp file and select "Compile"
But is there a way and short cut to compile a file of any type. luke *.cc,
*.h, *hpp
..cc should work just like .cpp
..h and .hpp aren't complete compilation units, compile some .cpp file that
#include the file you want to test.
Quote:
>
Thanks Torben
>

Torben Laursen
Guest
 
Posts: n/a
#3: Nov 24 '06

re: Shortcut to compile a file of any type


Hi Ben

I tryed *.cc But then I get a lot of errors from the linker like "The
function A is defined in both file X and Y"

Torben


"Ben Voigt" <rbv@nospam.nospamwrote in message
news:%23Xu$8f9DHHA.3520@TK2MSFTNGP04.phx.gbl...
Quote:
>
"Torben Laursen" <Torben@newsgroups.nospamwrote in message
news:uuUA5V9DHHA.1012@TK2MSFTNGP04.phx.gbl...
Quote:
>Hi
>>
>Often I just want to compile one c++ file in a project the check it for
>errors.
>Now I can right click on a *.cpp file and select "Compile"
>But is there a way and short cut to compile a file of any type. luke
>*.cc, *.h, *hpp
>
.cc should work just like .cpp
.h and .hpp aren't complete compilation units, compile some .cpp file that
#include the file you want to test.
>
Quote:
>>
>Thanks Torben
>>
>
>

Ben Voigt
Guest
 
Posts: n/a
#4: Nov 24 '06

re: Shortcut to compile a file of any type



"Torben Laursen" <Torben@newsgroups.nospamwrote in message
news:O87c2m9DHHA.4132@TK2MSFTNGP04.phx.gbl...
Quote:
Hi Ben
>
I tryed *.cc But then I get a lot of errors from the linker like "The
function A is defined in both file X and Y"
Linker? I thought you were just compiling.

What are files X and Y, and where is function A really (in X, in Y, in a
header file, etc.)?
Quote:
>
Torben
>
>
"Ben Voigt" <rbv@nospam.nospamwrote in message
news:%23Xu$8f9DHHA.3520@TK2MSFTNGP04.phx.gbl...
Quote:
>>
>"Torben Laursen" <Torben@newsgroups.nospamwrote in message
>news:uuUA5V9DHHA.1012@TK2MSFTNGP04.phx.gbl...
Quote:
>>Hi
>>>
>>Often I just want to compile one c++ file in a project the check it for
>>errors.
>>Now I can right click on a *.cpp file and select "Compile"
>>But is there a way and short cut to compile a file of any type. luke
>>*.cc, *.h, *hpp
>>
>.cc should work just like .cpp
>.h and .hpp aren't complete compilation units, compile some .cpp file
>that #include the file you want to test.
>>
Quote:
>>>
>>Thanks Torben
>>>
>>
>>
>
>

Torben Laursen
Guest
 
Posts: n/a
#5: Nov 24 '06

re: Shortcut to compile a file of any type


Hi Ben

Well it is nice to be able to both compile and link the project.

This is an example of the error:
Error 16 error LNK2005: _SetMixture@36 already defined in BaseCalc.obj
Dll_SetMixture.obj
Error 9 error LNK2005: _SetMixtureKij@28 already defined in BaseCalc.obj
Dll_SetMixture.obj

basecalc.cpp includes dll_setmixture.cc

If the type of dll_setmixture is changes th "h" it links fine but then I
cannot compile the file alone

Torben


"Ben Voigt" <rbv@nospam.nospamwrote in message
news:%23uePE79DHHA.3600@TK2MSFTNGP06.phx.gbl...
Quote:
>
"Torben Laursen" <Torben@newsgroups.nospamwrote in message
news:O87c2m9DHHA.4132@TK2MSFTNGP04.phx.gbl...
Quote:
>Hi Ben
>>
>I tryed *.cc But then I get a lot of errors from the linker like "The
>function A is defined in both file X and Y"
>
Linker? I thought you were just compiling.
>
What are files X and Y, and where is function A really (in X, in Y, in a
header file, etc.)?
>
Quote:
>>
>Torben
>>
>>
>"Ben Voigt" <rbv@nospam.nospamwrote in message
>news:%23Xu$8f9DHHA.3520@TK2MSFTNGP04.phx.gbl...
Quote:
>>>
>>"Torben Laursen" <Torben@newsgroups.nospamwrote in message
>>news:uuUA5V9DHHA.1012@TK2MSFTNGP04.phx.gbl...
>>>Hi
>>>>
>>>Often I just want to compile one c++ file in a project the check it for
>>>errors.
>>>Now I can right click on a *.cpp file and select "Compile"
>>>But is there a way and short cut to compile a file of any type. luke
>>>*.cc, *.h, *hpp
>>>
>>.cc should work just like .cpp
>>.h and .hpp aren't complete compilation units, compile some .cpp file
>>that #include the file you want to test.
>>>
>>>>
>>>Thanks Torben
>>>>
>>>
>>>
>>
>>
>
>

Ben Voigt
Guest
 
Posts: n/a
#6: Nov 24 '06

re: Shortcut to compile a file of any type



"Torben Laursen" <Torben@newsgroups.nospamwrote in message
news:%23TNIHZ%23DHHA.4280@TK2MSFTNGP04.phx.gbl...
Quote:
Hi Ben
>
Well it is nice to be able to both compile and link the project.
>
This is an example of the error:
Error 16 error LNK2005: _SetMixture@36 already defined in BaseCalc.obj
Dll_SetMixture.obj
Error 9 error LNK2005: _SetMixtureKij@28 already defined in BaseCalc.obj
Dll_SetMixture.obj
>
basecalc.cpp includes dll_setmixture.cc
..cc files are standalone, not meant to be #include from other files.

C++ source files are usually .cpp on windows or multi-platform projects, and
..C or .cc on unix. But they are all the same (except .C can't be used on
windows because of case insensitivity).
Quote:
>
If the type of dll_setmixture is changes th "h" it links fine but then I
cannot compile the file alone
>
Torben
>
>
"Ben Voigt" <rbv@nospam.nospamwrote in message
news:%23uePE79DHHA.3600@TK2MSFTNGP06.phx.gbl...
Quote:
>>
>"Torben Laursen" <Torben@newsgroups.nospamwrote in message
>news:O87c2m9DHHA.4132@TK2MSFTNGP04.phx.gbl...
Quote:
>>Hi Ben
>>>
>>I tryed *.cc But then I get a lot of errors from the linker like "The
>>function A is defined in both file X and Y"
>>
>Linker? I thought you were just compiling.
>>
>What are files X and Y, and where is function A really (in X, in Y, in a
>header file, etc.)?
>>
Quote:
>>>
>>Torben
>>>
>>>
>>"Ben Voigt" <rbv@nospam.nospamwrote in message
>>news:%23Xu$8f9DHHA.3520@TK2MSFTNGP04.phx.gbl.. .
>>>>
>>>"Torben Laursen" <Torben@newsgroups.nospamwrote in message
>>>news:uuUA5V9DHHA.1012@TK2MSFTNGP04.phx.gbl...
>>>>Hi
>>>>>
>>>>Often I just want to compile one c++ file in a project the check it
>>>>for errors.
>>>>Now I can right click on a *.cpp file and select "Compile"
>>>>But is there a way and short cut to compile a file of any type. luke
>>>>*.cc, *.h, *hpp
>>>>
>>>.cc should work just like .cpp
>>>.h and .hpp aren't complete compilation units, compile some .cpp file
>>>that #include the file you want to test.
>>>>
>>>>>
>>>>Thanks Torben
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Closed Thread