Jump to content

Build Error in C++


Ashar

Recommended Posts

Hi,I am using VC++ 2005 Express edition in windows XP. While i compilin i got a error "can not open advapi32.lib"file. But when i give the full path for the library in the project properties that issue is solved . but now i get a new error "fatal error LNK1104: cannot open file '.obj' ".What can i do for that.Anybody knows reply please.Thanks,

Link to comment
Share on other sites

you cannot have a file named .obj perhaps this program generates the filename to go with this extension. If the program failed to generate a filename and put an empty string witht he extention that would cause the program to look for a file called .objBeyond that I can't tell you anything else and I don't want to sift through 300 C++ files.When you say there 300 files does this include everything for the program? How many .cpp and .h files are there...if that is a reasonable number I could search through them.

Link to comment
Share on other sites

An object file (.obj) is an intermediate result of building your project. The source code gets compiled to object files, and then the linker links your object files with things like libraries and DLLs to build the executable. I think this is your problem:While i compilin i got a error "can not open advapi32.lib"You are trying to use the advapi32.lib library, and it is not able to find the library at compile time, so the object file is not even getting created. I don't know what advapi32 is, so you need to figure out if you are referencing it with an include or something like that:#include "advapi32.h"And put the library where it needs to be for the compiler to find it. Try searching your computer for advapi32. If you find it, then try putting it in the same folder as your source files. If you don't find it, then search online and see if you can download it.

Link to comment
Share on other sites

Hi,The library errors are solved when i give full path for the library in project settings. Now when build the project i get the following lind errors. I include all libraries and i dont know whether i miss any libraries.1>Linking...1>LINK : D:/Vembu/StoreGrid/bin/StoreGrid.Net.SP.exe not found or not built by the last incremental link; performing full link1>ServerBackupObject.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VersionBasedRetentionCheckThread::Run(void)" (?Run@VersionBasedRetentionCheckThread@@UAEXXZ)1>VSSApi.obj : error LNK2019: unresolved external symbol "void * __cdecl CreateVSSApiInstance(void)" (?CreateVSSApiInstance@@YAPAXXZ) referenced in function "public: void __thiscall VSSApi::Initialize(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?Initialize@VSSApi@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)1>VSSApi.obj : error LNK2019: unresolved external symbol "void __cdecl DeleteVSSApiInstance(void *)" (?DeleteVSSApiInstance@@YAXPAX@Z) referenced in function "public: void __thiscall VSSApi::DeInitialize(void)" (?DeInitialize@VSSApi@@QAEXXZ)1>BackupScheduler.obj : error LNK2001: unresolved external symbol _SQLFreeHandle@81>BackupScheduleConfiguration.obj : error LNK2019: unresolved external symbol _SQLFreeHandle@8 referenced in function "private: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall BackupScheduleConfiguration::GetBackupReportDetails(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetBackupReportDetails@BackupScheduleConfiguration@@AAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@@Z)1>DatabaseInfo.obj : error LNK2001: unresolved external symbol _SQLFreeHandle@81>ConnectionObject.obj : error LNK2001: unresolved external symbol _SQLFreeHandle@81>SQLServerLocator.obj : error LNK2001: unresolved external symbol _SQLFreeHandle@81>BackupScheduleConfiguration.obj : error LNK2019: unresolved external symbol _SQLFetch@4 referenced in function "private: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall BackupScheduleConfiguration::GetBackupReportDetails(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetBackupReportDetails@BackupScheduleConfiguration@@AAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@@Z)1>DatabaseInfo.obj : error LNK2001: unresolved external symbol _SQLFetch@41>BackupScheduler.obj : error LNK2001: unresolved external symbol _SQLFetch@41>BackupScheduleConfiguration.obj : error LNK2019: unresolved external symbol _SQLBindCol@24 referenced in function "private: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall BackupScheduleConfiguration::GetBackupReportDetails(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetBackupReportDetails@BackupScheduleConfiguration@@AAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@@Z)1>DatabaseInfo.obj : error LNK2001: unresolved external symbol _SQLBindCol@241>BackupScheduler.obj : error LNK2001: unresolved external symbol _SQLBindCol@241>BackupScheduleConfiguration.obj : error LNK2019: unresolved external symbol _SQLNumResultCols@8 referenced in function "private: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall BackupScheduleConfiguration::GetBackupReportDetails(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetBackupReportDetails@BackupScheduleConfiguration@@AAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@@Z)1>DatabaseInfo.obj : error LNK2001: unresolved external symbol _SQLNumResultCols@81>BackupScheduler.obj : error LNK2001: unresolved external symbol _SQLNumResultCols@81>BackupScheduleConfiguration.obj : error LNK2019: unresolved external symbol _SQLExecDirect@12 referenced in function "private: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall BackupScheduleConfiguration::GetBackupReportDetails(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetBackupReportDetails@BackupScheduleConfiguration@@AAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@@Z)1>DatabaseInfo.obj : error LNK2001: unresolved external symbol _SQLExecDirect@121>BackupScheduler.obj : error LNK2001: unresolved external symbol _SQLExecDirect@121>BackupScheduler.obj : error LNK2019: unresolved external symbol _SQLAllocHandle@12 referenced in function "public: void __thiscall BackupScheduler::UpdateBackupReport(void)" (?UpdateBackupReport@BackupScheduler@@QAEXXZ)1>BackupScheduleConfiguration.obj : error LNK2001: unresolved external symbol _SQLAllocHandle@121>DatabaseInfo.obj : error LNK2001: unresolved external symbol _SQLAllocHandle@121>ConnectionObject.obj : error LNK2001: unresolved external symbol _SQLAllocHandle@121>SQLServerLocator.obj : error LNK2001: unresolved external symbol _SQLAllocHandle@121>BackupScheduleConfiguration.obj : error LNK2019: unresolved external symbol _SQLGetDiagRec@32 referenced in function "public: class std::vector<class DBScheduleDetails,class std::allocator<class DBScheduleDetails> > __thiscall BackupScheduleConfiguration::GetBackupScheduleDetails(int,int)" (?GetBackupScheduleDetails@BackupScheduleConfiguration@@QAE?AV?$vector@VDBScheduleDetails@@V?$allocator@VDBScheduleDetails@@@std@@@std@@HH@Z)1>ConnectionObject.obj : error LNK2001: unresolved external symbol _SQLGetDiagRec@321>ConnectionObject.obj : error LNK2019: unresolved external symbol _SQLDisconnect@4 referenced in function "public: int __thiscall ConnectionObject::TestConnection(void)" (?TestConnection@ConnectionObject@@QAEHXZ)1>SQLServerLocator.obj : error LNK2001: unresolved external symbol _SQLDisconnect@41>ConnectionObject.obj : error LNK2019: unresolved external symbol _SQLDriverConnect@32 referenced in function "public: int __thiscall ConnectionObject::TestConnection(void)" (?TestConnection@ConnectionObject@@QAEHXZ)1>ConnectionObject.obj : error LNK2019: unresolved external symbol _SQLSetEnvAttr@16 referenced in function "public: int __thiscall ConnectionObject::TestConnection(void)" (?TestConnection@ConnectionObject@@QAEHXZ)1>SQLServerLocator.obj : error LNK2001: unresolved external symbol _SQLSetEnvAttr@161>ConnectionObject.obj : error LNK2019: unresolved external symbol _SQLGetDiagField@28 referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ConnectionObject::GetSqlError(void *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,long,int)" (?GetSqlError@ConnectionObject@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV23@JH@Z)1>SQLServerLocator.obj : error LNK2019: unresolved external symbol _SQLBrowseConnect@24 referenced in function "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall SQLServerLocator::GetSQLServer(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetSQLServer@SQLServerLocator@@QAE?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z)1>SQLServerLocator.obj : error LNK2019: unresolved external symbol _SQLSetConnectAttr@16 referenced in function "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall SQLServerLocator::GetSQLServer(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetSQLServer@SQLServerLocator@@QAE?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z)1>D:/Vembu/StoreGrid/bin/StoreGrid.Net.SP.exe : fatal error LNK1120: 19 unresolved externals1>Creating browse information file...1>Microsoft Browse Information Maintenance Utility Version 8.00.507271>Copyright © Microsoft Corporation. All rights reserved.1>Build log was saved at "file://d:\WorkingProjects\StoreGrid2.3\StoreGrid\Build\Windows\DotNet\SPEditionDeb\BuildLog.htm"1>StoreGrid_Head - 39 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========how to solve that. Please explain me.Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...