Thank you for your response. The thing is, im building a project and part of the code is hidden. I was only given some of the obj files and im supposed to link those in my solution.....not sure how to do that since never did that before :-|
Tried doing that in properties dialog, but no luck. Any help will be much appreciated.
Never done this, but if you go into your project settings and look in the "Link" section there is a field where you can enter "Object/library modules".
The common use of this field is to enter the .lib files, but .obj files might work as well. Give it a try.
Dear everyone:
I asked a similar question here yesterday. So basically I am trying to link some given obj files as if they are static libraries. For example if I have action.obj somewhere, I right click on the project name and chose "add->existing item" and simply added action.obj file under the project. It's not compiling....so im wondering if i should do anything in my header files like #include<action.obj>, but im not sure how to do that...any one has any thoughts?
Thank you soooo much.
What do you mean "it's not compiling". I told you in your other thread (which you should have bumped instead of starting another thread) that just adding them to the project should be all you need. I have several projects that work that way and compile fine.
What is the problem specifically and what error messages are you getting?
Thanks GCDEF, I did follow what you said yesterday and added them as if they are cpp files. I could not find my old thread today so just started a new one, sorry that im new here.
Basically after adding those obj files, I only made a main function like this, to test if those obj files are linked:
int main()
{
return 1;
}
When adding the obj files, they did asked me saying the building rules are not defined. I just hit cancel as I was not sure what to do there -_-
Here are some of the error messages I got:
Once again thanks for your help and sorry was messing up the threads earlier.
Error 1 error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) MSVCRTD.lib
Error 2 error LNK2005: "private: class type_info & __thiscall type_info:perator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) MSVCRTD.lib
Error 4 error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ) TickCharacters.obj
Error 5 error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ) UpdateCharacters.obj
Error 6 error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ) work.obj
When adding the obj files, they did asked me saying the building rules are not defined. I just hit cancel as I was not sure what to do there -_-
Here are some of the error messages I got:
Let's start from step 1.
First, an object file is an intermediate file created by the compiler. Given that, these object files were created using certain compiler options, i.e. debug, release, optimizations, etc.
This means that you can't just "drop-in" object files into a project without full information on how those object files were compiled.
What compiler was used to compile these object files? What version of the compiler was used? What compiler options? Were these object files created using the static or DLL version of the runtime? etc. etc.
Whatever those answers are, that is what your main application must be compiled with. Otherwise, you're taking object files created one way, and trying to apply it to an application created another way. That, in general, is what those errors are telling you.
First, an object file is an intermediate file created by the compiler. Given that, these object files were created using certain compiler options, i.e. debug, release, optimizations, etc.
This means that you can't just "drop-in" object files into a project without full information on how those object files were compiled.
What compiler was used to compile these object files? What version of the compiler was used? What compiler options? Were these object files created using the static or DLL version of the runtime? etc. etc.
Whatever those answers are, that is what your main application must be compiled with. Otherwise, you're taking object files created one way, and trying to apply it to an application created another way. That, in general, is what those errors are telling you.
Regards,
Paul McKenzie
Read the errors again. They're unresolved external and already defined errors.
Read the errors again. They're unresolved external and already defined errors.
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.
Thanks GCDEF, I did follow what you said yesterday and added them as if they are cpp files. I could not find my old thread today so just started a new one, sorry that im new here.
Basically after adding those obj files, I only made a main function like this, to test if those obj files are linked:
int main()
{
return 1;
}
When adding the obj files, they did asked me saying the building rules are not defined. I just hit cancel as I was not sure what to do there -_-
Here are some of the error messages I got:
Once again thanks for your help and sorry was messing up the threads earlier.
Error 1 error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) MSVCRTD.lib
Error 2 error LNK2005: "private: class type_info & __thiscall type_info:perator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) MSVCRTD.lib
Error 4 error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ) TickCharacters.obj
Error 5 error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ) UpdateCharacters.obj
Error 6 error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ) work.obj
In your project settings, add LIBCMT to the Ignore Specific Library section of your linker input options.
Looks like there's some kind of function call Xran that the linker doesn't know about. Did you add all the files you're supposed to?
In your project settings, add LIBCMT to the Ignore Specific Library section of your linker input options.
Looks like there's some kind of function call Xran that the linker doesn't know about. Did you add all the files you're supposed to?
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...
Bookmarks