Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2006

Tip: Looking for answers? Try searching our database.

Shortcut to compile a file of any type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Torben Laursen - 24 Nov 2006 14:33 GMT
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 - 24 Nov 2006 14:52 GMT
> Hi
>
[quoted text clipped - 3 lines]
> 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
Torben Laursen - 24 Nov 2006 15:03 GMT
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

>> Hi
>>
[quoted text clipped - 9 lines]
>
>> Thanks Torben
Ben Voigt - 24 Nov 2006 15:40 GMT
> 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.)?

> Torben
>
[quoted text clipped - 11 lines]
>>
>>> Thanks Torben
Torben Laursen - 24 Nov 2006 16:33 GMT
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

>> Hi Ben
>>
[quoted text clipped - 21 lines]
>>>
>>>> Thanks Torben
Ben Voigt - 24 Nov 2006 16:42 GMT
> Hi Ben
>
[quoted text clipped - 7 lines]
>
> 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).

> If the type of dll_setmixture is changes th "h" it links fine but then I
> cannot compile the file alone
[quoted text clipped - 26 lines]
>>>>
>>>>> Thanks Torben

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.