Hi all,
I am trying to compile a VC++ project and it is win32 console application.When I try to compile it I get a lot of linking problems.I have included all the header files needed for the project..I have no idea of how to solve them as I am little bit new to vc++..Could anyone advice or tell me whats wrong in my program..Here are some of my errors:
(1) error LNK2019: unresolved external symbol "public: __thiscall Parser::Parser(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned short,unsigned short,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Parser@@QAE@V?$basic_string@DU?$char_traits@D@ std@@V?$allocator@D@2@@std@@0000GG00000@Z) referenced in function _main homogenity.obj
(2)error LNK2019: unresolved external symbol "public: void __thiscall Parser::usage(bool)const " (?usage@Parser@@QBEX_N@Z) referenced in function _main homogenity.obj
(3) error LNK2019: unresolved external symbol "public: static void __cdecl GM::close(void)" (?close@GM@@SAXXZ) referenced in function _main homogenity.obj
Thanks a lot in advance.
PS: Here's my Build Log file in case required
Build Log Build started: Project: homogenity, Configuration: Debug|Win32
Command Lines Creating temporary file "d:\ReconAssignments\homogenity\homogenity\Debug\R SP00000333684676.rsp" with contents
[
/OUT:"D:\ReconAssignments\homogenity\Debug\homogeni ty.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\homogenity.exe.intermediate.ma nifest" /DEBUG /PDB:"d:\ReconAssignments\homogenity\debug\homogeni ty.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\homogenity.obj"
".\Debug\stdafx.obj"
".\Debug\homogenity.res"
".\Debug\homogenity.exe.embed.manifest.res"
]
Creating command line "link.exe @d:\ReconAssignments\homogenity\homogenity\Debug\R SP00000333684676.rsp /NOLOGO /ERRORREPORT:PROMPT"
Output Window Linking...
homogenity.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Parser::parse(int,char * *)" (?parse@Parser@@QAE_NHPAPAD@Z) referenced in function _main
homogenity.obj : error LNK2019: unresolved external symbol "public: static void __cdecl GM::close(void)" (?close@GM@@SAXXZ) referenced in function _main
homogenity.obj : error LNK2019: unresolved external symbol "public: void __thiscall Parser::usage(bool)const " (?usage@Parser@@QBEX_N@Z) referenced in function _main
homogenity.obj : error LNK2019: unresolved external symbol "public: __thiscall Parser::Parser(class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,unsigned short,unsigned short,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >)" (??0Parser@@QAE@V?$basic_string@DU?$char_traits@D@ std@@V?$allocator@D@2@@std@@0000GG00000@Z) referenced in function _main
D:\ReconAssignments\homogenity\Debug\homogenity.ex e : fatal error LNK1120: 4 unresolved externals
Results Build log was saved at "file://d:\ReconAssignments\homogenity\homogenity\Debug\Bu ildLog.htm"
homogenity - 5 error(s), 0 warning(s)
8 1889 sicarie 4,677
Recognized Expert Moderator Specialist
Hi all,
I am trying to compile a VC++ project and it is win32 console application.When I try to compile it I get a lot of linking problems.I have included all the header files needed for the project..I have no idea of how to solve them as I am little bit new to vc++..Could anyone advice or tell me whats wrong in my program..Here are some of my errors:
(1) error LNK2019: unresolved external symbol "public: __thiscall Parser::Parser(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned short,unsigned short,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Parser@@QAE@V?$basic_string@DU?$char_traits@D@ std@@V?$allocator@D@2@@std@@0000GG00000@Z) referenced in function _main homogenity.obj
(2)error LNK2019: unresolved external symbol "public: void __thiscall Parser::usage(bool)const " (?usage@Parser@@QBEX_N@Z) referenced in function _main homogenity.obj
(3) error LNK2019: unresolved external symbol "public: static void __cdecl GM::close(void)" (?close@GM@@SAXXZ) referenced in function _main homogenity.obj
Thanks a lot in advance.
PS: Here's my Build Log file in case required
Build Log Build started: Project: homogenity, Configuration: Debug|Win32
Command Lines Creating temporary file "d:\ReconAssignments\homogenity\homogenity\Debug\R SP00000333684676.rsp" with contents
[
/OUT:"D:\ReconAssignments\homogenity\Debug\homogeni ty.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\homogenity.exe.intermediate.ma nifest" /DEBUG /PDB:"d:\ReconAssignments\homogenity\debug\homogeni ty.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\homogenity.obj"
".\Debug\stdafx.obj"
".\Debug\homogenity.res"
".\Debug\homogenity.exe.embed.manifest.res"
]
Creating command line "link.exe @d:\ReconAssignments\homogenity\homogenity\Debug\R SP00000333684676.rsp /NOLOGO /ERRORREPORT:PROMPT"
Output Window Linking...
homogenity.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Parser::parse(int,char * *)" (?parse@Parser@@QAE_NHPAPAD@Z) referenced in function _main
homogenity.obj : error LNK2019: unresolved external symbol "public: static void __cdecl GM::close(void)" (?close@GM@@SAXXZ) referenced in function _main
homogenity.obj : error LNK2019: unresolved external symbol "public: void __thiscall Parser::usage(bool)const " (?usage@Parser@@QBEX_N@Z) referenced in function _main
homogenity.obj : error LNK2019: unresolved external symbol "public: __thiscall Parser::Parser(class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,unsigned short,unsigned short,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >,class std::basic_string,class std::allocator >)" (??0Parser@@QAE@V?$basic_string@DU?$char_traits@D@ std@@V?$allocator@D@2@@std@@0000GG00000@Z) referenced in function _main
D:\ReconAssignments\homogenity\Debug\homogenity.ex e : fatal error LNK1120: 4 unresolved externals
Results Build log was saved at "file://d:\ReconAssignments\homogenity\homogenity\Debug\Bu ildLog.htm"
homogenity - 5 error(s), 0 warning(s)
Can you post the relevant section of code where this error came from?
Hi Sicarie,
Thank you for quick reply..parser.h is the header file already written by somebody...I am thinking its not able to link parser.h file..I am not sure abt it..Any kind of suggestions or help would be great.Thanks.
Here's my code: - #include "stdafx.h"
-
#include "parser.h"
-
-
//int _tmain(int argc, _TCHAR* argv[])
-
//validate function
-
-
int main(int argc, char **argv) //new added
-
{
-
-
Parser *cpar=NULL;
-
-
cpar=new Parser("homogenity",
-
"calculate roi",
-
"2007",
-
"e n u is w algo oi ",
-
"(e$ n$ u$ [is]$ w$ [algo]$ [oi]$)", iterations,subsets, "","","","","");
-
-
if (argc == 1) { cpar->usage(false);
-
delete cpar;
-
cpar=NULL;
-
GM::close();
-
return(EXIT_SUCCESS);
-
}
-
if (!cpar->parse(argc, argv))
-
{ delete cpar;
-
cpar=NULL;
-
GM::close();
-
return(-1);
-
}
-
return 0;
-
}
horace1 1,510
Recognized Expert Top Contributor
you are including parser.h at compile time - is there another file parser.cpp (or parser.o or parser.obj) which contains the implementation code of Parser. This would be linked with your code and hopefully the link time errors should go away.
Horace1,
Thank you for the suggestion and I will try to do that.Could you please tell me how u link .cpp file to a vc++ project and should I just build my project as usual or should I have to compile all source files included in my project separately ??Thanks.
Hi Horace1,
I just wanted to inform you that I have tried to add the .cpp file to my project and also added the header file and it remove my linking errors.Thank you for the solution..But I have been arised with the problem that there existes no stdafx.h in the parser.cpp file I added recently..When I checked in this .cpp file I did not find it..Its giving me fatal error C1010. stdafx.h and .cpp both are included in my actual source project.Thats not a problem, prob is with newly added source file which is read only..
Can you please help me with this..Thanks a lot once again for helping me out.
horace1 1,510
Recognized Expert Top Contributor
Hi Horace1,
I just wanted to inform you that I have tried to add the .cpp file to my project and also added the header file and it remove my linking errors.Thank you for the solution..But I have been arised with the problem that there existes no stdafx.h in the parser.cpp file I added recently..When I checked in this .cpp file I did not find it..Its giving me fatal error C1010. stdafx.h and .cpp both are included in my actual source project.Thats not a problem, prob is with newly added source file which is read only..
Can you please help me with this..Thanks a lot once again for helping me out.
I don't use vc++ so no idea what is going on - perhaps we have vc++ experts who can assit? You say that parser.cpp is read only - can you change it to full access - if using windows right button click the file in Windows Explorer, click properties and clear the Read Only button.
It can be done in that way but I am supposed to use it as it is without making any changes ..I have used Use precompiled header option in the project properties but still gives me the error..
Anyway thank you horace1 for your prompt replies and for your help..
I would appreciate if anyone in the group can help me in this issue.I am stuck at this point.Thanks in advance.
Hi all,
I am getting the error LNK:c1010...It says that stdafx.h is not in the source file...Actually I have added a .cpp file to my project which cannot be changed at all as it is defined by somebody and so I cannot include stdafx.h file in it.
But I have included it already in my original .cpp file and have its project properties set to use precompiled header files option so that it could be used to other source files added to my project..I am not sure if I need to change any settings..
Still I am getting the same errror when I build my project..Can anyone please help me how to solve this..I am really stuck at this point..Thank you very much..Look forward to hear from you soon.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Arturo DiDonna |
last post by:
Hello everyone. I am trying to compile someone else code and I am
stuck with compilation problems using
the g++ 3.3 compiler. Basically, when compiling the following code, I
get this error...
|
by: Henok Girma |
last post by:
Hello Gurus,
I wanted to have a very simple, strict regular expression validator for a
phone field. the only valid format is
(XXX) XXX-XXXX where X is a digit
I have the following but it always...
|
by: Dmitri Shvetsov |
last post by:
Hi All,
Did somebody have a problem compiling some solution in VS2003? I get the
error every time that some files are locked and are using by another
process. I repeat compiling again and again...
|
by: Edwin Knoppert |
last post by:
I have registered and i expected some reg code, not!
The balloon keeps appearing, how to get rid of that?
vwd-express
|
by: DraguVaso |
last post by:
Hi,
Does anybody knows how to run a *.reg-file silently on a computer? I need
this to do automatic updates of my application without user-interaction.
So I don't want the user to be asked a...
| |
by: Ryan Riehle |
last post by:
Hi All!
Trying to upgrade to Apache 2.0.49 and getting compile errors related to
mod_auth_pgsql, any clue?:
make: Entering directory `/usr/src/httpd-2.0.49'...
|
by: Anurag |
last post by:
Hi,
I have 2 related questions.
DB2 UDB ESE v8.x (8.1 till 8.2 FP2 - all fixpaks included) on AIX 5.4.x
_____________________________________________________________________________
(QUESTION 1)...
|
by: don |
last post by:
I have a string from a clearcase cleartool ls command.
/main/parallel_branch_1/release_branch_1.0/dbg_for_python/CHECKEDOUT
from /main/parallel_branch_1/release_branch_1.0/4
I want to write a...
|
by: phoolimin |
last post by:
Dear all,
I am trying to embed python into another scripting language, to do this
I need to solve a number of problems on importing or compiling python
script. First let me state what exactly I...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |