Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Static Library

Author
Message
AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 8th Mar 2009 16:51 Edited at: 8th Mar 2009 16:52
Hey all,

I tring make a library... when i put the code in the program normaly it works 100%

i used a tutorial that i found here... so the .h file i made




and the cpp one




The build makes no errors.. 1 succefull
but when i add it in my program and want to run it it makes me this error

1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl AZ_LoadMenu(int,int,int)" (?AZ_LoadMenu@@YAXHHH@Z) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl AZ_Start(int)" (?AZ_Start@@YAXH@Z) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>DebugDark GDK - Game1.exe : fatal error LNK1120: 2 unresolved externals

what can i do?
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 8th Mar 2009 18:28 Edited at: 8th Mar 2009 18:28
You are not including your library in the program you are using it with.
Go to tools->options->projects and solutions->VC++ directories then select libraries files in top right of dialogue. add the path to where your lib file is stored.
Now go to project->properties->configuration properties->Linker->Input and add to additional dependencies the file name of your lib file.

Hope that helps.
AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 8th Mar 2009 18:31 Edited at: 8th Mar 2009 18:36
i added the library... i put the files in the same folder that the DarkGDK files are... in the lib folder and the Include folder... :S

i added the files directly to the project.. now i get this

1>Linking...
1>LINK : Debug\Dark GDK - Game1.exe not found or not built by the last incremental link; performing full link
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR90D.dll)
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Debug\Dark GDK - Game1.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://c:\Documents and Settings\Alex\Desktop\DarkGDK\3\Dark GDK - Game1\Dark GDK - Game1\Debug\BuildLog.htm"
1>Dark GDK - Game1 - 2 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

If someone need something, add me to your msn
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Mar 2009 19:00
You need to have the static lib set up in the same way as a standard GDK program - mainly this is the same 'code generation' type and the same calling convention. You don't have that according to the libraries listed in your errors.

AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 8th Mar 2009 19:09
em.. i didnt exactly understood..

i just opened a normal DarkGDK game... added the .h and .lib file to the project and included it in the .cpp file


em... and again .. i added the files in the DarkGDK folders.. so it need to find them there... because it is in the c++ directories in the compiler

If someone need something, add me to your msn
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Mar 2009 19:22
Sorry, I was talking about when you create your .lib file - the project settings have to be the same as the GDK settings.

AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 8th Mar 2009 19:39 Edited at: 8th Mar 2009 20:05
oww.... i think i understand... i will try

uff... i tryed to open a DarkGDK game and from there add .h and .cpp file.... but i get this error

1>darksdk.lib(DarkSDK.obj) : error LNK2019: unresolved external symbol "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) referenced in function _WinMain@16

i realy dont know what to do

okay i sure that this way its not good

look i used this tutorial http://forum.thegamecreators.com/?m=forum_view&t=130838&b=22

i created a w32 console.. then click on static library and untick the thing... after create .h file put the codes that i put some posts up..

then add a .cpp and same...

:S

(There is anyway that a mod or admin can change my nick to AlexZinn superkid its my old nick and i hate it.. if not just delete this profile... because i cant use twice same email)

If someone need something, add me to your msn
i not a Kid anymore.. so if any mod or admin can change my nick will be realy be cool... to : AlexZinn
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Mar 2009 22:13
Correct me if I'm wrong, but I believe you just created a standard GDK program, and compiled it. That won't create a static library.

IIRC, all you need to do is to change the 'Configuration Properties -> General -> Configuration type' to static library and that will create the .lib.

Then in your main game, just include that .lib in the linking of your program.

AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 9th Mar 2009 01:09
it creates the lib and the h file.... :S the problem its after including it

If someone need something, add me to your msn
i not a Kid anymore.. so if any mod or admin can change my nick will be realy be cool... to : AlexZinn
AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 9th Mar 2009 09:13
Okay Somehow i managed to make my first library I will make some more and them maybe post them hehe

If someone need something, add me to your msn
Was SuperKid , now AlexZinn

Login to post a reply

Server time is: 2024-09-30 19:34:04
Your offset time is: 2024-09-30 19:34:04