Visual studio build

  1. 10 months ago

    I'm having some trouble getting to run a project with the new goodbey_cmake. I build the lib of the PolycodeCore and when i build the template in the example folder it works but when i create a new project i get a linker error 2019.
    This is what comes up.

    1>------ Build started: Project: newPoly, Configuration: Debug Win32 ------
    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(364,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
    1>main_entry.obj : error LNK2019: unresolved external symbol "public: __thiscall Polycode::PolycodeView::PolycodeView(struct HINSTANCE__ *,int,wchar_t const *,bool,bool)" (??0PolycodeView@Polycode@@QAE@PAUHINSTANCE__@@HPB_W_N2@Z) referenced in function _WinMain@16
    1>TestEntry.obj : error LNK2019: unresolved external symbol "public: __thiscall Polycode::String::String(char const *)" (??0String@Polycode@@QAE@PBD@Z) referenced in function "public: __thiscall TestEntry::TestEntry(class Polycode::PolycodeView *)" (??0TestEntry@@QAE@PAVPolycodeView@Polycode@@@Z)
    1>TestEntry.obj : error LNK2019: unresolved external symbol "public: __thiscall Polycode::String::~String(void)" (??1String@Polycode@@QAE@XZ) referenced in function "public: __thiscall TestEntry::TestEntry(class Polycode::PolycodeView *)" (??0TestEntry@@QAE@PAVPolycodeView@Polycode@@@Z)
    1>TestEntry.obj : error LNK2019: unresolved external symbol "public: __thiscall Polycode::EventDispatcher::EventDispatcher(void)" (??0EventDispatcher@Polycode@@QAE@XZ) referenced in function "public: __thiscall TestEntry::TestEntry(class Polycode::PolycodeView *)" (??0TestEntry@@QAE@PAVPolycodeView@Polycode@@@Z)
    1>TestEntry.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Polycode::EventDispatcher::~EventDispatcher(void)" (??1EventDispatcher@Polycode@@UAE@XZ) referenced in function __unwindfunclet$??0TestEntry@@QAE@PAVPolycodeView@Polycode@@@Z$0
    1>TestEntry.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Polycode::EventDispatcher::dispatchEvent(class Polycode::Event *,int)" (?dispatchEvent@EventDispatcher@Polycode@@UAEXPAVEvent@2@H@Z)
    1>TestEntry.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Polycode::EventDispatcher::dispatchEventNoDelete(class Polycode::Event *,int)" (?dispatchEventNoDelete@EventDispatcher@Polycode@@UAEXPAVEvent@2@H@Z)
    1>TestEntry.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Polycode::Core::Update(void)" (?Update@Core@Polycode@@QAE_NXZ) referenced in function "public: bool __thiscall TestEntry::Update(void)" (?Update@TestEntry@@QAE_NXZ)
    1>TestEntry.obj : error LNK2019: unresolved external symbol "public: class Polycode::ResourceManager * __thiscall Polycode::Core::getResourceManager(void)" (?getResourceManager@Core@Polycode@@QAEPAVResourceManager@2@XZ) referenced in function "public: __thiscall TestEntry::TestEntry(class Polycode::PolycodeView *)" (??0TestEntry@@QAE@PAVPolycodeView@Polycode@@@Z)
    1>TestEntry.obj : error LNK2019: unresolved external symbol "public: void __thiscall Polycode::ResourcePool::loadResourcesFromFolder(class Polycode::String const &,bool)" (?loadResourcesFromFolder@ResourcePool@Polycode@@QAEXABVString@2@_N@Z) referenced in function "public: __thiscall TestEntry::TestEntry(class Polycode::PolycodeView *)" (??0TestEntry@@QAE@PAVPolycodeView@Polycode@@@Z)
    1>TestEntry.obj : error LNK2019: unresolved external symbol "public: class Polycode::ResourcePool * __thiscall Polycode::ResourceManager::getGlobalPool(void)" (?getGlobalPool@ResourceManager@Polycode@@QAEPAVResourcePool@2@XZ) referenced in function "public: __thiscall TestEntry::TestEntry(class Polycode::PolycodeView *)" (??0TestEntry@@QAE@PAVPolycodeView@Polycode@@@Z)
    1>TestEntry.obj : error LNK2019: unresolved external symbol "public: __thiscall Polycode::Win32Core::Win32Core(class Polycode::PolycodeViewBase *,int,int,bool,bool,int,int,int,int,bool)" (??0Win32Core@Polycode@@QAE@PAVPolycodeViewBase@1@HH_N1HHHH1@Z) referenced in function "public: __thiscall TestEntry::TestEntry(class Polycode::PolycodeView *)" (??0TestEntry@@QAE@PAVPolycodeView@Polycode@@@Z)
    1>C:\Polycode\lib\win32\x86\newPoly.exe : fatal error LNK1120: 12 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    I'm including all the lib for a win32 project and i added all of the header files of polycode. I don't understand this error.

  2. Never mind i figured it out. It was my fault i forget an extra step.

  3. Ugh i got he same problem again with the linker errors. This time it's a lot shorter. It seems not to be able to find the wincore or polycodeview. My brain is freyd from trying to figure this out.

    This is what it says now.

    Creating library C:\Users\Carlos\Documents\Visual Studio 2013\Projects\newPoly\Debug\newPoly.lib and object C:\Users\Carlos\Documents\Visual Studio 2013\Projects\newPoly\Debug\newPoly.exp
    1>MSVCRTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
    1>freetype.lib(bdf.obj) : warning LNK4217: locally defined symbol _sprintf imported in function __bdf_parse_properties
    1>physfs.lib(physfs.obj) : warning LNK4217: locally defined symbol _sprintf imported in function _PHYSFS_getMountPoint
    1>main_entry.obj : error LNK2019: unresolved external symbol "public: __thiscall Polycode::PolycodeView::PolycodeView(struct HINSTANCE__ *,int,wchar_t const *,bool,bool)" (??0PolycodeView@Polycode@@QAE@PAUHINSTANCE__@@HPB_W_N2@Z) referenced in function _WinMain@16
    1>Polycore_d.lib(PolyWinCore.obj) : error LNK2001: unresolved external symbol "class Polycode::Win32Core * core" (?core@@3PAVWin32Core@Polycode@@A)
    1>C:\Users\Carlos\Documents\Visual Studio 2013\Projects\newPoly\Debug\newPoly.exe : fatal error LNK1120: 2 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  4. After checking the Polycore project in the build folder. I noticed that PolycodeView was not apart of the project. After adding it and rebuilding the .lib it builds fine now. Shouldn't the PolycodeView be apart of the Polycore project in the template?

  5. fodinabor

    4 Aug 2016 Administrator

    hmm.. are you using the latest version (670e1d1)?
    PolycodeView should be part of the PolycodeCore project there...
    See: https://github.com/ivansafrin/Polycode/blob/goodbye_cmake/build/windows/win32/PolycodeCore/PolycodeCore.vcxproj#L234 and https://github.com/ivansafrin/Polycode/blob/goodbye_cmake/build/windows/win32/PolycodeCore/PolycodeCore.vcxproj#L305
    (you should not add it to your own project as this will lead to double symbol declaration issues - although if you need you can inherit from PolycodView to use your own version)

  6. No mine is an older version. I have updated the repository and i noticed that visual studio was switched back to 2013. Is there something wrong with 2015 that's not playing nice with Polycode?

  7. fodinabor

    4 Aug 2016 Administrator

    well no - we're just using VS 2013 for the libraries to enable people who only have a VS 2013 license to use Polycode - but Polycode definitely is usable with 2015 (just uses the build engine from 2013)

 

or Sign Up to reply!