Woops, just saw your post GCDEF. I will give it a shot now. Thanks!
Printable View
Woops, just saw your post GCDEF. I will give it a shot now. Thanks!
I typed LIBCMT in the field of "Ignore Specific Library" under Linker->Input...hope im doing right.
There are all together 62 errors. About 20 of them are complaining Xran function and 20 of them complains about Xlen like this:
Error 28 error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ) TickCharacters.obj
and the rest are like this:
Error 57 error LNK2001: unresolved external symbol "public: void __thiscall std::ios_base::_Addstd(void)" (?_Addstd@ios_base@std@@QAEXXZ) NewGame.obj
I think I included all the obj files. Together with the obj files they also gave me several cpp and h files. Initially I tried adding them and build, which gave me lots of compile errors so I decided starting from a simple main(). I checked with those cpp/h files and none of them contains the functions the linking errors are complaining about...
Many thanks!
Looks like (definately not enough information to be sure) the provided obj files are built against a different implementation (or build configuration) of the STL library.....
[ merged threads ]
Please do not start multiple threads on the same problem.
I gave a general reason of why errors would show up when linking object files, and what to make sure of before going on any further.
Regardless of what the resolution is, the options used to create the object files must be known by the person using them, so as to minimize any problems.
Regards,
Paul McKenzie
Thanks folks,
I just got back from the guy who gave me the obj files. He said he's gonna create a clean system and build again with only the cpp/h files he gave me in the folder and send me again. So this time hopefully it'll work T.T...waiting on him now
Again, it's not just the CPP and H files that are the concern.
He needs to tell you what options he is using to build the object files. Library options, debug/release, etc. He could be even using a different version of the compiler (service pack) than what you're using. All of these things are to be known on both ends for a successful link to occur.
Regards,
Paul McKenzie
If they are buildable from the CPP/H files that he gave you....why are you complicating things by using his .boj files??????
Just compile the source yourself...
Of course it is likely that they are actually NOT going to be built "with only the cpp/h files he gave me in the folder"
Sry my bad...you are right. I think this time he's gonna give me all the obj files and part of the source files that he's allowed to give, and the system config files (as Paul suggests, the config files probably have the information of the compiler versions, lib info, etc. I assume?).
Still waiting on him. When getting the new obj files, and configure correctly, do I actually need to add any of my own code (like main() ) to test or it should run with only the obj files?
Thanks a lot!
Depends on whether there's a main() function somewhere in his code.
I've got obj files from a vendor. No clue what they used to build them. They're release builds but they work fine in both release and debug builds and on VC6 and VS2005. So while issue may potentially arise, using the same service pack, build type, even compiler version isn't a requirement.
Hey guys,
So I got back from him. He gave me all the obj files, all headers, and buildLog(which I think gives the compiler configuration). He said I should be able to compile except there is one link error right now which he believes caused by lack of toplevel entry point (no main function i guess?).
So what I did was: wrote a main function, include all headers, added all the obj files to the project. Surprisingly there's no linking errors, but 6 compile errors....saying there is no definition of some class:
Error 12 error C2236: unexpected 'class' 'StubVisualCommands'. Did you forget a ';'? c:\documents and settings\sandy\my documents\supple\supplecode\trialtwo\trial two\trial two\weconcreteinterfacedefinition.h 8
(this class is inherited from some other class which was obviously defined)
I commented out the whole class definition. This time several other compiling errors pop up...I kept commenting out stuffs and realized it should not be the right way. So my question is, can it possible because of compiler compatibility? I linked all obj files successfully this time and they are not complaining anything. In that case if it compiles on his machine it should also compile on mine. Anyone has any clue? Here is the BuildLog...Im not sure how to use it. Mine is a Win32 Console project btw...
Build Log
------- Build started: Project: WorldEngine, Configuration: Release|Win32 -------
Command Lines
This edition of Visual C++ does not support the optimizing compiler.
This edition of Visual C++ does not support the optimizing compiler.
Creating temporary file "c:\Supple\WorldEngine\Release\RSP000001.rsp" with contents
[
/AI "C:\Supple\WorldEngine\Release" /D "WIN32" /D "NDEBUG" /D "_MBCS" /FD /EHsc /MT /GS /Fo"Release/" /Fd"Release/vc70.pdb" /W0 /c /Zi /clr /TP
.\BehaviorEngine.cpp
]
Creating command line "cl.exe @c:\Supple\WorldEngine\Release\RSP000001.rsp /nologo"
Creating temporary file "c:\Supple\WorldEngine\Release\RSP000002.rsp" with contents
[
/OUT:"C:\Supple\WorldEngine\Release\WorldEngine.exe" /INCREMENTAL:NO /NOLOGO /DEBUG /PDB:"C:\Supple\WorldEngine\Release/WorldEngine.pdb" /FIXED:No kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
.\Release\ActionDescriptions.obj
.\Release\BehaviorEngine.obj
......
Output Window
Compiling...
BehaviorEngine.cpp
Linking...
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
C:\Supple\WorldEngine\Release\WorldEngine.exe : fatal error LNK1120: 1 unresolved externals
Results
Build log was saved at "file://c:\Supple\WorldEngine\Release\BuildLog.htm"
WorldEngine - 2 error(s), 0 warning(s)
Thank you so much!
WHERE is int main(...) {...} implemented???Quote:
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
I think he did not write a main function when generating the obj files. The reason is through the interface he gave me I should write my own main to do testing. If he did write a main, I would not be able to test as a program cannot have two mains. Am I right?
I wrote my own main.cpp which includes all header files. In this cpp I wrote int main() { return 1;}