473,785 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shortcut to compile a file of any type

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
Nov 24 '06 #1
5 1524

"Torben Laursen" <To****@newsgro ups.nospamwrote in message
news:uu******** ******@TK2MSFTN GP04.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

Nov 24 '06 #2
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" <rb*@nospam.nos pamwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>
"Torben Laursen" <To****@newsgro ups.nospamwrote in message
news:uu******** ******@TK2MSFTN GP04.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


Nov 24 '06 #3

"Torben Laursen" <To****@newsgro ups.nospamwrote in message
news:O8******** ******@TK2MSFTN GP04.phx.gbl...
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
"Ben Voigt" <rb*@nospam.nos pamwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>>
"Torben Laursen" <To****@newsgro ups.nospamwrote in message
news:uu******* *******@TK2MSFT NGP04.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



Nov 24 '06 #4
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" <rb*@nospam.nos pamwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>
"Torben Laursen" <To****@newsgro ups.nospamwrote in message
news:O8******** ******@TK2MSFTN GP04.phx.gbl...
>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
"Ben Voigt" <rb*@nospam.nos pamwrote in message
news:%2******* *********@TK2MS FTNGP04.phx.gbl ...
>>>
"Torben Laursen" <To****@newsgro ups.nospamwrote in message
news:uu****** ********@TK2MSF TNGP04.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



Nov 24 '06 #5

"Torben Laursen" <To****@newsgro ups.nospamwrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
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).
>
If the type of dll_setmixture is changes th "h" it links fine but then I
cannot compile the file alone

Torben
"Ben Voigt" <rb*@nospam.nos pamwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>>
"Torben Laursen" <To****@newsgro ups.nospamwrote in message
news:O8******* *******@TK2MSFT NGP04.phx.gbl.. .
>>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
"Ben Voigt" <rb*@nospam.nos pamwrote in message
news:%2****** **********@TK2M SFTNGP04.phx.gb l...

"Torben Laursen" <To****@newsgro ups.nospamwrote in message
news:uu***** *********@TK2MS FTNGP04.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
>




Nov 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
2878
by: aa | last post by:
Thought this question might be out of this NG's scope, there are always knowledgable people who might hava an answer. A hyperlink to a shortcut to a file returnes an empty screen, and the source code behind this empty screen is <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD> <BODY></BODY></HTML> Is this supposed to be like this? ...
6
17168
by: Todd Peterson | last post by:
I'm encountering some wierd behavior with a <link> tag over an HTTPS connection, vs. an HTTP connection... In an ASP/HTML page on my website, I've add a <link rel="shortcut icon"...> in order to allow the users to add a shortcut (with icon) on their desktop, as well as seeing the icon in the URL. Our development server allows both HTTP and HTTPS connections, but the icon only appears to be available when requesting the page via HTTP???...
4
4419
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create shortcut to my program/utility (2) Entry in Windows' Start --> Program Menu. Actually in my VB.Net solution I have two projects (1) MYPROGRAM (2) MYPROGRAM_INSTALLER. MYPROGRAM is a "Windows Application". MYPROGRAM_INSTALLER is a "SetUp Wizard"...
7
31267
by: GrandpaB | last post by:
I would appreciate assistance learning how to create a Desktop shortcut in my setup project. In the left pane of the Setup/File System window I right-clicked User's Desktop. From the contex menu I clicked Create Shortcut to User's Desktop. In the right pane of the setup/File System window the object Shortcut to User's Desktop appeared. When I selected the object and checked it's properties the Target and WorkingFolder are User's...
1
2747
by: Paulers | last post by:
I have been searching for example code that will create a shortcut link to a file and place it on the desktop. I have searched google and found a couple examples using the windows scripting object but they do not seem to work for me. Would someone be kind enough to post some example code? thanks!
3
1536
by: Mike Edgewood | last post by:
Is there a simple way, shortcut, or macro to create a property skeletons? I would live to be able to type a name and a type and have the property created based on that info. Private mLastName as String Public Property LastName() as String Get Return mLastName
2
4708
by: hermithead | last post by:
Hi ~ how would I go about entering a desktop shortcut into a HTML page as a link? For example if I had a shortcut to a program on my desktop that I wanted to include on a Intranet page how would this be coded in html? I've tried creating the shortcut Target path as a hyperlink but this doesnt work.
3
5858
by: KennethLundin | last post by:
Hi, i'm developing a solution in VS9/CSharp. Now I'm constructing a deployment project for my appliation (thick, database driven, winforms, standard, good old type of application). During installation I also install the PostgreSQL database and along with that I need to execute some Custom Actions. I've created a Custom Installer component in CSharp and calls it on Install/Rollback/ uninstall and everything works great (Custom Actions...
0
1934
by: vishnu1986 | last post by:
Hi guys, I saw quite a few posts regarding this but I was unable to solve this problem that I am facing. First off, when I do the following in my setup.py, windows= } ], Python crashes and I am unable to run the script using python setup.py py2exe.
0
10346
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.