Results 1 to 14 of 14

Thread: Getting Clanlib running w' VS2008?

  1. #1

    Default Getting Clanlib running w' VS2008?

    Im trying to get ClanLib up and running with visual studio 2008 an having problems. In the online tutorial page it says to configure with this file configure-vc90.sln
    ....i cant find where to download that, i have tried the configure-vc80.sln
    file but it didnt work so well so i could be wrong but i think if i use the vc90 maybe i will have better luck.

  2. #2

    Default

    ok so im trying this again with vc0.8.1. and reading through the tutorial page online. so my "new" question is: do i need to compile each binary (jpeg, zlib, exc.) to use or install them or can i just unzip, and copy the include / lib files into new include and lib files (to get all .h binary files into one include file, and all the object files into one lib file).?
    Thanks in advance

  3. #3

    Default

    Ok so i think ive got clanlib built properly, i went through the online tutorial page and built it with no errors! ok so i got down to the part where it talks about making a new solution and i did that but got this error:
    LIBCMTD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
    -help please, thanks
    Last edited by jwilk; 11-26-2008 at 05:36 AM.

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

  5. #5

    Default

    Ya i have been looking at that and reading
    http://clanlib.org/docs/clanlib-0.9....dows-msvc.html
    and im almost there i just have a few problems: i noticed that on the getting started page is says select 'Set as Active Project' for clanCore, on my system the only option i have is 'Set as Startup Project', is this the same thing or am i doing some thing wrong?
    Next: im the point where i need to compile ClanLib, so i go to batch build and select all and here are the errors i get

    Static MTDLL Release Win32
    \ClanLibSDK\include\mikmod.h(49) : fatal error C1021: invalid preprocessor command 'elsif'
    Reguarding: soundprovider_mikmod_session.cpp, soundprovider_mikmod.cpp, setupmikmod.cpp, and module_reader.cpp.
    Static MTDLL Debug Win32
    \ClanLibSDK\include\mikmod.h(49) : fatal error C1021: invalid preprocessor command 'elsif'
    Reguarding: soundprovider_mikmod_session.cpp, soundprovider_mikmod.cpp, setupmikmod.cpp, and module_reader.cpp.

    i think i read somewhere in the forums that ClanLib is not configured to work with MTDLL. If so then should i just do a batch build and uncheck the MTDLL boxex?

    Next question: i noticed that function "virtual int main(int argc, char** argv)=0;" is in clanapp.h file. is this the function that i would add in code to link it with game code functions, classes, exc?
    I guess my real question is i dont know what to do once clanlib successfuly compiles, i read the "Creating a solution for your application" but it doesnt seem to have any explination about linking a new win32 app up with clanlib....maybe that is all done behind the scenes, i dont know.
    anyway thanks for the help

  6. #6
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Quote Originally Posted by jwilk View Post
    (snip)
    Static MTDLL Release Win32
    \ClanLibSDK\include\mikmod.h(49) : fatal error C1021: invalid preprocessor command 'elsif'
    I remember having this error a long time ago. If I remember correctly, although it was a long time ago, just change "elsif" to "elseif"

    Quote Originally Posted by jwilk View Post
    i think i read somewhere in the forums that ClanLib is not configured to work with MTDLL. If so then should i just do a batch build and uncheck the MTDLL boxex?
    As far as i know, it should work - But i have never used ClanLib 0.8

    Quote Originally Posted by jwilk View Post
    Next question: i noticed that function "virtual int main(int argc, char** argv)=0;" is in clanapp.h file. is this the function that i would add in code to link it with game code functions, classes, exc?
    I guess my real question is i dont know what to do once clanlib successfuly compiles, i read the "Creating a solution for your application" but it doesnt seem to have any explination about linking a new win32 app up with clanlib....maybe that is all done behind the scenes, i dont know.
    anyway thanks for the help
    Try running the Basic2d example. I use this example as a basis of all my projects.

  7. #7

    Default

    reguarding the "elsif" error: i tried elseif, else if, else and then just commenting it out....none of it worked so i have no idea what to do but here is the code thats giving me problems in mikmod.h

    #if defined WIN32 && defined _DLL
    #ifdef DLL_EXPORTS
    #define MIKMODAPI __declspec(dllexport)
    #else
    #define MIKMODAPI __declspec(dllimport)
    #endif
    #elsif !defined _DLL && defined WIN32 ///////////this guy right here///////////
    #ifdef !defined _DEBUG
    #pragma comment(lib, "mikmod-static-mt-debug.lib")
    #else
    #pragma comment(lib, "mikmod-static-mt.lib")
    #endif
    #else
    #define MIKMODAPI
    #endif

    I tried building all except the MTDLL Debug and MTDLL Release and it was successful!! i dont know what the MTDLL is or if it is realy needed but any way there is that, so it built up ok but then i went to run it and a message box popped up with this error:
    -Unable to start program 'C:\......\ClanLib-0.8.1\ClanLib.sln'
    -The specified file is an unrecognized or unsupported binary format
    I think i caused this one because earlier when i was doing the batch build i tried it with just the 'Static MT Debug' checkboxes selected and it build up ok so i ran it (meaning 'start debugging') and and it asked me for an exe file to begin with so just messing around i selected the ClanLib.sln file....of course it didnt work but now i have no idea how to make it stop looking at that file when it tries to run. It doesnt ask for an exe file now it just tries to run the ClanLib.sln........kinda shot myself in the foot on that one i think, im sure theres an option the make it stop looking there but i dont know where to access it.
    -Thanks a bunch ROMBUST and anyone else who can help.
    Last edited by jwilk; 11-27-2008 at 08:14 AM.

  8. #8
    Squire
    Join Date
    Oct 2008
    Location
    Canada
    Posts
    29

    Default

    Humm. I'm learning too. So I thought I'd throw in my two cents. Regarding the "elsif" error, I hope you tried "#elseif" with the pound symbol. That should do it. As for the "start debugging with clanlib.sln" problem, I wonder if your settings match mine. Right click your project, then goto "Properties". Under "Configuration properties" / "Debugging", does your screen match my attached screen shot? Just wondering 'cause I've buggered this up myself a few times. The only way I could usually remedy the problem was to download a fresh copy of everything. But now that I'm catching on to things, I'm wondering if this configuration dialog holds the key.

    Good luck
    Attached Images Attached Images  

  9. #9

    Default

    Ya i tried the whole elseif, else if, if, else, all with the pound in front, none of it seemed to work. As for the executable file when i changed the command line under debugging in the properties menu it changed the "ClanLib.sln" problem but now it just brings up the window asking me to choose a executable file to start with, and i dont know what is the correct file to put there. Ive included pics of my properties window, and the executable file window.
    Attached Images Attached Images   

  10. #10
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Since ClanLib is a library, it is not something you start directly. That is why you get that dialog.

    Try opening up one of the examples in the Examples directory, and try to compile and run those.

  11. #11

    Default

    Ok that makes sense.
    So ive made a new project, and added in the .cpp file from xample "Minimum", when i try to compile or build i get this error:
    fatal error C1083: Cannot open include file: 'Core/core_iostream.h':
    ive added in the .....\ClanLibSDK\include\Core and ...\ClanLibSDK\include\ClanLib paths to Tools>Options>Include Files, but im still getting this problem but im not sure what i need to change.
    -thanks for the help

    Fixed error C1083 from above by adding ...ClanLib-0.8.1\Sources\API to Tools>Options>Include Files.

    Now i have these errors
    libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
    libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
    libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
    libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: char const & __thiscall std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> >:perator*(void)const " (??D?$_String_const_iterator@DU?$char_traits@D@std @@V?$allocator@D@2@@std@@QBEABDXZ)
    libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
    libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol __calloc_dbg referenced in function __Getctype

    i cant seem to get the Linker>Input>Ignore Specific Library stuff right using /NODEFAULTLIB keyword
    Last edited by jwilk; 12-01-2008 at 05:27 AM.

  12. #12

    Default

    ok so i was able to get around the above errors by doing the following:
    add
    Project>Properties>Linker>Input>Ignore Specific Library>libcmtd.lib; libcpmtd.lib
    Project>Properties>Linker>Input>Force Symbol References>/INCLUDE:["void * __cdecl operator new[](unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??_U@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)]

    i dont get all the errors as before but i have no idea what functionality im cutting out of my program by ignoring libcmtd.lib. If any one has any idea as to what the above changes actualy do to the program i would realy appreciate an explanation- thanks.

    the only error i have left is this:
    LINK : fatal error LNK1104: cannot open file '__cdecl.obj'
    and im having problems working around this one so some info on that would be much welcome as well
    -thanks much for any help

    also here is a pic of what my properties window looks like
    Attached Images Attached Images  

  13. #13
    Lesser Wizard
    Join Date
    Jun 2007
    Posts
    109

    Default

    After some foot work, I managed to get 0.9 svn to build on vc2008.

    Are you still having issues? My main problem was related to dinput.lib. The first thing you should try to get to build is simple2d. Once that's done, you're golden.

  14. #14
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

Similar Threads

  1. Running without debugger hides drawing
    By kcid in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 05-07-2008, 08:29 AM
  2. Running Dink under Wine
    By notbert in forum Dink Smallwood HD
    Replies: 4
    Last Post: 12-07-2007, 09:52 AM
  3. Is FileSponge running slow today
    By Grumpychumps in forum Funeral Quest
    Replies: 2
    Last Post: 05-03-2007, 05:12 AM
  4. Questions about running my own server
    By in forum Funeral Quest
    Replies: 3
    Last Post: 07-30-2005, 05:49 PM
  5. Replies: 4
    Last Post: 10-15-2003, 04:29 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •