Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Gosu C++ Config
- - By HellScript3r Date 2013-02-15 20:24
Hi! I've used Gosu for year and I've worked on Ruby, but now i would start script in C++. But i've got problem. I don't know how to config VC2010Express to start scripting.
I added in project path to Gosu (folder lib for libraries and Gosu in includies). I made project win32 like is in instruction. When i'm compiling error shows that i don't have "StdAfx.h"

Logs:
1>------ Build started: Project: Gosu, Configuration: Debug Win32 ------
1>  stdafx.cpp
1>  Gosu.cpp
1>  Tutorial.cpp
1>d:\gosu c++\gosu\examples\tutorial.cpp(2): warning C4627: '#include <Gosu/Gosu.hpp>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>d:\gosu c++\gosu\examples\tutorial.cpp(4): warning C4627: '#include <Gosu/TR1.hpp>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>d:\gosu c++\gosu\examples\tutorial.cpp(6): warning C4627: '#include <Gosu/AutoLink.hpp>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>d:\gosu c++\gosu\examples\tutorial.cpp(8): warning C4627: '#include <cmath>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>d:\gosu c++\gosu\examples\tutorial.cpp(9): warning C4627: '#include <cstdlib>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>d:\gosu c++\gosu\examples\tutorial.cpp(10): warning C4627: '#include <list>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>d:\gosu c++\gosu\examples\tutorial.cpp(11): warning C4627: '#include <memory>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>d:\gosu c++\gosu\examples\tutorial.cpp(12): warning C4627: '#include <sstream>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>d:\gosu c++\gosu\examples\tutorial.cpp(13): warning C4627: '#include <vector>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>d:\gosu c++\gosu\examples\tutorial.cpp(206): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks and Hello all!
Parent - - By HellScript3r Date 2013-02-15 20:34
Ok. I fixed that. I just included that :). Now everythings great but in last line is error:
1>c:\users\piotrek\documents\visual studio 2010\Projects\Gosu\Debug\Gosu.exe : fatal error LNK1169: one or more multiply defined symbols found

How to fix that ?
Parent - - By jlnr (dev) Date 2013-02-16 02:05
Can you post more of the error message? It's hard to say where the error comes from without seeing which symbols are duplicates.
Parent - By HellScript3r Date 2013-02-16 08:03
1>------ Build started: Project: Gosu, Configuration: Debug Win32 ------
1>  test.cpp
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" (??1_Container_base12@std@@QAE@XZ) already defined in GosuDebug.lib(WindowWin.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::_Container_base12(void)" (??0_Container_base12@std@@QAE@XZ) already defined in GosuDebug.lib(WindowWin.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: void __thiscall std::_Container_base12::_Orphan_all(void)" (?_Orphan_all@_Container_base12@std@@QAEXXZ) already defined in GosuDebug.lib(WindowWin.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: class std::locale::facet * __thiscall std::locale::facet::_Decref(void)" (?_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in GosuDebug.lib(InputWin.obj)
1>libcpmtd.lib(ios.obj) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(ios.obj) : error LNK2005: "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" (?_Addstd@ios_base@std@@SAXPAV12@@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@std@@CAXPAV123@@Z) already defined in msvcprtd.lib(locale0_implib.obj)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP100D.dll)
1>LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __free_dbg already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(lconv.obj) : error LNK2005: _localeconv already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf_s already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dosmap.obj) : error LNK2005: __errno already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(_wctype.obj) : error LNK2005: _iswspace already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(mbstowcs.obj) : error LNK2005: _mbstowcs already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(wcstombs.obj) : error LNK2005: _wcstombs already defined in MSVCRTD.lib(MSVCR100D.dll)
1>     Creating library C:\Users\Piotrek\documents\visual studio 2010\Projects\Gosu\Debug\Gosu.lib and object C:\Users\Piotrek\documents\visual studio 2010\Projects\Gosu\Debug\Gosu.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\Users\Piotrek\documents\visual studio 2010\Projects\Gosu\Debug\Gosu.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
This log is from :

#include <Gosu/AutoLink.hpp>
#include <Gosu/Window.hpp>

class MyWindow : public Gosu::Window
{
public:
    MyWindow()
    :   Window(640, 480, false, 20)
    {
        setCaption(L"Hello World!");
    }
};

int main()
{
    MyWindow window;
    window.show();
}

When i tried on Tutorial.cpp i had longer log and I couldn't past here so I changed on this simple code (up). When I tried on Tutorial.cpp I changed multi-threaded debug dll on multi-threaded debug and I get only window without any graphics/objects etc. When I change on multi-threaded debug dll I get logs like that (up).
I'm not sure if I right config VC2010.
Parent - - By HellScript3r Date 2013-02-17 17:39
can anyone help me with that ?
Parent - - By jlnr (dev) Date 2013-02-18 05:10
Have you checked if the C++ standard runtime library has been set as in the wiki? It should be Multithreaded or Multithreaded Debug, respectively.
Parent - - By HellScript3r Date 2013-02-18 13:38
I changed like is on wiki.
Parent - By jlnr (dev) Date 2013-02-21 09:26
OK, then I guess the latest Gosu binary files that I've uploaded are still for use with the vc90 toolkit - but if you have installed MSVC 2010 (not 2008), only the vc100 toolkit will be installed. This is an error on my side - I originally thought that MSVC 2010 can always compile with the vc90 and vc100 toolkits, but it can only do so if you have previously installed MSVC 2008.

Is this correct - you are compiling with the vc100 toolkit and it is the only option available? This should be a per-project option, but I forgot the exact name of it...

Three possible workarounds... 1. Wait until I publish vc100 library files; 2. install MSVC 2008; 3. compile Gosu yourself. Sorry for the trouble! :(
Up Topic Gosu / Gosu Exchange / Gosu C++ Config

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill