Thread

problems with C++ sample project (Sdk)

problems with C++ sample project // Sdk

1  |  

kah

Nov 25, 2001, 12:34pm
hi, I'm playing around with C++, but when I compile the sample project the
..exe crashes with an "illegal operation" error when it gets to the SDK
commands... I use Bloodshed Dev-C++ 4 (Mingw compiler), SDK build 22,
AW_STATIC.LIB. any ideas to why this happens?

KAH

ananas

Nov 25, 2001, 6:28pm
Looks very much as if the linker would not like the
microsoft library format. I heard from some people
who tried different compilers about trouble, either
with the format or with undefined symbols, some even
from a standard function that is used wrong in the
SDK (stricmp(), see note below).


Best you would get rid of both libraries and use the
DLL instead. This requires either a DLL library
import tool in your compiler or manual imports with
LoadLibrary(). Most windows developement systems should
have such an implib tool.

Watcom for example handles the import calls itself,
by creating an import file for the linker :
wlib -q -n -b aw.lib aw.dll
The result is the Watcom version of aw.lib, I attached
it in Andras' newsgroup, maybe your Bloodshed linker
is happy with this one, it's worth a try.


Libraries in different IDE's always cause trouble, the
linkers are seldom compatible and the compiler standard
libraries are only standard for this specific IDE.
The AW_Static.lib is a microsoft library and might
work in a microsoft developement system, but you
should forget the idea to use it in a different one.


p.s.: Not on topic but I'll explain :

stricmp() is not a standard function. Ansi compilers
should preceed it with an underscore so it is actually
referred to as _stricmp(). some libraries have strcmpi()
instead, _strcmpi(), bcmpi(), _bcmpi() or strcasecmp().

[View Quote] --
"_
|
/\
\ /
__/ /_

bowen

Nov 25, 2001, 7:01pm
yup Borland uses implib something.lib something.dll to get it converted :).
Not sure if Kah's follows this rule.

--Bowen--

[View Quote]

ananas

Nov 25, 2001, 8:25pm
What I found out so far is that it should look
somehow like this in the Gnu windoze environment :

dlltool --def aw.def --dllname Aw.dll --output-lib aw.a

and the aw.def like this (with no line breaks) :

EXPORTS aw_address aw_avatar_click aw_bool aw_bool_set aw_callback aw_callback_set aw_cell_next aw_citizen_add aw_citizen_attributes_by_name aw_citizen_attributes_by_number aw_citizen_change aw_citizen_delete aw_citizen_next aw_citizen_previous aw_create aw_create_resolved aw_delete_all_objects aw_destroy aw_enter aw_event aw_event_set aw_exit aw_float aw_float_set aw_init aw_instance aw_instance_set aw_int aw_int_set aw_license_add aw_license_attributes aw_license_change aw_license_delete aw_license_next aw_license_previous aw_login aw_object_add aw_object_change aw_object_click aw_object_delete aw_object_load aw_object_select aw_query aw_query_5x5 aw_random aw_say aw_sector_from_cell aw_server_admin aw_server_world_add aw_server_world_change aw_server_world_delete aw_server_world_list aw_server_world_set aw_server_world_start aw_server_world_stop aw_session aw_state_change aw_string aw_string_set aw_teleport aw_term aw_universe_attributes_change aw_universe_ejection_add
aw_universe_ejection_delete aw_universe_ejection_lookup aw_universe_ejection_next aw_universe_ejection_previous aw_url_send aw_wait aw_whisper aw_world_attribute_get aw_world_attribute_set aw_world_attributes_change aw_world_attributes_reset aw_world_eject aw_world_ejection_add aw_world_ejection_delete aw_world_ejection_lookup aw_world_ejection_next aw_world_ejection_previous aw_world_list aw_world_reload_registry


[View Quote] --
"_
|
/\
\ /
__/ /_

bowen

Nov 25, 2001, 9:02pm
that's the basic make of the file.. but borland puts some other stuff into
it so it can understand it I guess.. maybe.

--Bowen--

[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn