Hamumu Software Hamumu Software Hamumu Software
Name
Password Register
Latest Journal update: Nov 2, 2017
Old 05-25-2008, 03:27 PM   #1
SpaceManiac
Veteran Programmer
 
SpaceManiac's Avatar
 
Join Date: Oct 2007
Posts: 3,078
Default Termites Source

I've tried to modify the Termites source as suggested in the readme, but its promise
Quote:
It should compile right off in windows, no problem.
doesn't hold true. At the top of the tinyptc.cpp:
Code:
//
// TinyPTC by Gaffer
// www.gaffer.org/tinyptc
//
#include "tinyptc.h"
#include "convert.h"
#define WIN32_LEAN_AND_MEAN
#include "ddraw.h"
is a reference to the DirectDraw header file, which I acquired by downloading and installing the March 2008 release of the DirectX SDK from the Microsoft website.

Once I did that, I got this message when building it in Visual C++ 2005 Express Edition:

Quote:
1>------ Build started: Project: Termites, Configuration: Debug Win32 ------
1>Compiling...
1>tinyptc.cpp
1>e:\termites\source\tinyptc.cpp(152) : warning C4244: 'initializing' : conversion from 'WPARAM' to 'int', possible loss of data
1>e:\termites\source\tinyptc.cpp(195) : warning C4244: '=' : conversion from 'LRESULT' to 'int', possible loss of data
1>e:\termites\source\tinyptc.cpp(223) : error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char [10]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>e:\termites\source\tinyptc.cpp(311) : error C2664: 'LoadIconW' : cannot convert parameter 2 from 'const char [9]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>e:\termites\source\tinyptc.cpp(319) : error C2440: '=' : cannot convert from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>e:\termites\source\tinyptc.cpp(348) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>e:\termites\source\tinyptc.cpp(365) : error C2664: 'AppendMenuW' : cannot convert parameter 4 from 'const char [11]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>e:\termites\source\tinyptc.cpp(366) : error C2664: 'AppendMenuW' : cannot convert parameter 4 from 'const char [11]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>e:\termites\source\tinyptc.cpp(367) : error C2664: 'AppendMenuW' : cannot convert parameter 4 from 'const char [11]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://e:\Visual Studio 2005\Projects\Termites\Debug\BuildLog.htm"
1>Termites - 7 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Am I compiling it wrong, do I need an older version of DirectDraw, or is the library flawed?

Last edited by SpaceManiac; 05-25-2008 at 04:58 PM. Reason: Finishing post
SpaceManiac is offline   Reply With Quote
Old 05-26-2008, 02:45 AM   #2
AtkinsSJ
Legs sold separately.
Moderator
 
AtkinsSJ's Avatar
 
Join Date: Aug 2004
Location: Computers!
Posts: 4,790
Default Re: Termites Source

A complete guess, but I reckon you don't have the tinyptc library, or at least have not included it correctly.
__________________
Caution: may contain traces of nuts

Last edited by AtkinsSJ; 05-26-2008 at 02:45 AM.
AtkinsSJ is offline   Reply With Quote
Old 05-26-2008, 08:23 AM   #3
Mr.Onion
Evil, random-voting vegetable
 
Mr.Onion's Avatar
 
Join Date: Mar 2005
Location: Down at the shore where there's no-one vacationing.
Posts: 4,862
Default Re: Termites Source

Including libraries is a pain in Visual C++, from what I've found.
__________________
Mr.Onion is offline   Reply With Quote
Old 05-27-2008, 06:25 PM   #4
SpaceManiac
Veteran Programmer
 
SpaceManiac's Avatar
 
Join Date: Oct 2007
Posts: 3,078
Default Re: Termites Source

I used the function-style cast (suggested in the messages) to convert all the char * and const char [...] to LPCWSTR, so they looked like
Code:
library = (HMODULE) LoadLibrary(LPCWSTR("ddraw.dll"));
instead of
Code:
library = (HMODULE) LoadLibrary("ddraw.dll");
but now the error's* shifted to the linker:
Quote:
1>------ Build started: Project: Termites, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>tinyptc.cpp
1>e:\termites\source\tinyptc.cpp(152) : warning C4244: 'initializing' : conversion from 'WPARAM' to 'int', possible loss of data
1>e:\termites\source\tinyptc.cpp(195) : warning C4244: '=' : conversion from 'LRESULT' to 'int', possible loss of data
1>Generating Code...
1>Linking...
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Documents and Settings\Tad\My Documents\Visual Studio 2005\Projects\Termites\Debug\Termites.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://e:\Visual Studio 2005\Projects\Termites\Debug\BuildLog.htm"
1>Termites - 2 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I can't figure out exactly what I need to do to resolve the "_WinMain@16" external symbol.

* It's a contraction for "error has"

Last edited by SpaceManiac; 05-27-2008 at 06:26 PM. Reason: Parenthetical Aside
SpaceManiac is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Source Code? Lord Loony Dr. Lunatic 3 10-15-2011 06:07 PM
Blackduck's BHE - Termites: The Flash Version Blackduck Making Dumb Games 15 11-06-2009 02:20 PM
Termites .Blue Dwarf. Our Other Games 3 05-24-2008 03:13 PM
NPC Quest Source Fun AtkinsSJ Our Other Games 5 09-17-2007 09:31 AM
Termites is here! Nebro-Gubular SpisBoy Our Other Games 13 12-22-2005 01:12 PM


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.
Site Map
Copyright 2017, Hamumu Games Inc.