Jump to content
  • Advertisement
Sign in to follow this  
ncasebee

Difference between Build and Compile/Solution and Project?

This topic is 5092 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Difference between Build and Compile/Solution and Project? What's the difference between build project, build source file(.cpp), and compile in Visual Studio.net? Also what's the difference between a Solution and a Project. I always created a project then add source files. Never do I create a solution. I'm asking this because I just had a project that would not build, but would compile. This was also the first time using objects and and external include file. Compile worked, build (.cpp) didn't. Now I'm wondering. Actually it's still not working.
Quote:
Compiling... time1.cpp Linking... time1.obj : error LNK2019: unresolved external symbol "public: int __thiscall Time::get_hours(void)const " (?get_hours@Time@@QBEHXZ) referenced in function _main time1.obj : error LNK2019: unresolved external symbol "public: int __thiscall Time::get_minutes(void)const " (?get_minutes@Time@@QBEHXZ) referenced in function _main time1.obj : error LNK2019: unresolved external symbol "public: int __thiscall Time::get_seconds(void)const " (?get_seconds@Time@@QBEHXZ) referenced in function _main time1.obj : error LNK2019: unresolved external symbol "public: void __thiscall Time::add_seconds(int)" (?add_seconds@Time@@QAEXH@Z) referenced in function _main time1.obj : error LNK2019: unresolved external symbol "public: __thiscall Time::Time(int,int,int)" (??0Time@@QAE@HHH@Z) referenced in function _main Debug/p83.exe : fatal error LNK1120: 5 unresolved externals Build log was saved at "file://c:\Documents and Settings\access\My Documents\Visual Studio Projects\p83\Debug\BuildLog.htm" p83 - 6 error(s), 0 warning(s)
If you need me to post source file and include file I can.

Share this post


Link to post
Share on other sites
Advertisement
I never used VC, but from your errors it looks like you did compile the program but not LINKED it, because you didn't specify (or are missing) some required libraries.

Share this post


Link to post
Share on other sites
To answer part of your question here is a snippet from a book called "Programming with Visual C++" by O'Reilly:

In a Visual C++ .NET project, a text-format project file (with a VCPROJ extension) maintains the dependencies between project parts. A separate text-format solution file (with an SLN extension) has an entry for each project in the solution. The solution file organizes projects, project items, and solution items into a single solution by providing the environment with references to their locations on disk. It's possible to have multiple projects in a solution, but all the examples in this book have just one project per solution. To work on an existing project, you tell Visual C++ .NET to open the SLN file, and then you can edit and build the project.

Visual C++ will make these files for you automatically so you do not have to create them yourself.

The compiler will translate your source code and header files into an Object file which is then linked through the Linker to the actual Windows/runtime/MFC libraries and made into an EXE. Your errors appear to be a result of not including a certain library file. I am a beginner myself so I can't tell you which file but if you figure out which library is missing goto (in Visual STudios)

1)Projects Menu option
2)Options (preceded with the name of your project)
3)Click the Linker tab
4)Click input
5)Where it says additional dependancies type in the library name. If there are more than one separate each one with a space

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I was missing an include file.

Don't why I need to include two additional include files to use objects, but the chapter I'm on just teaches how to use them, not make them. I suppose when I make them I'll know.


I had to include.
both #include "ccc_time.h" and #include "ccc_time.cpp". Don't know why just one wouldn't work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!