Pages: 1
  Print  
Author Topic: How do we use our own CPP library files?  (Read 2112 times)
Offline (Unknown gender) indecom
Posted on: August 21, 2008, 08:03:50 PM
Member
Joined: Aug 2008
Posts: 4

View Profile Email
I've figure out how to include headers in my programs using the cpp{} function, now i need to find out who do i include my own static libraries? There should be project functions in enigma that let you load in your own libraries like in visual c++, but for now, if i can get some code to reference to it that would be great, currently my games crashing because it doesnt recognize the code in my header file.
Logged
Offline (Unknown gender) indecom
Reply #1 Posted on: August 21, 2008, 08:32:21 PM
Member
Joined: Aug 2008
Posts: 4

View Profile Email
Okay so i found it, you have to link it using the following cpp code:

#pragma comment(lib,"name.lib")


sorry if i sound like anoob, havent used cpp before enigma, at least not to the extent i'm trying to now.

EDIT:

okay this is getting irritating, it was working fine like 3 minutes ago, i add some code and it starts giving me the -6 error, so i get rid of that code, and its still giving me -6, what the hell, it cant make up its mind, irritating.


ENIGMAsystem/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ssq.h:85: error: non-local function `char* SSQ_FormatBatchReply(enigma::OBJ_connector::myevent_create()::SSQ_BATCH_REPLY*, int)' uses local type `enigma::OBJ_connector::myevent_create()::SSQ_BATCH_REPLY'
ENIGMAsystem/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ssq.h:87: error: non-local function `BOOL SSQ_GetInfoReply(enigma::OBJ_connector::myevent_create()::SSQ_INFO_REPLY*)' uses local type `enigma::OBJ_connector::myevent_create()::SSQ_INFO_REPLY'
ENIGMAsystem/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ssq.h:88: error: non-local function `BOOL SSQ_GetPlayerReply(enigma::OBJ_connector::myevent_create()::SSQ_PLAYER_REPLY*)' uses local type `enigma::OBJ_connector::myevent_create()::SSQ_PLAYER_REPLY'
ENIGMAsystem/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ssq.h:90: error: non-local function `char* SSQ_GetRuleName(enigma::OBJ_connector::myevent_create()::SSQ_RULES_REPLY*, short int)' uses local type `enigma::OBJ_connector::myevent_create()::SSQ_RULES_REPLY'
ENIGMAsystem/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ssq.h:91: error: non-local function `char* SSQ_GetRuleValue(enigma::OBJ_connector::myevent_create()::SSQ_RULES_REPLY*, short int)' uses local type `enigma::OBJ_connector::myevent_create()::SSQ_RULES_REPLY'
ENIGMAsystem/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ssq.h:95: error: non-local function `BOOL SSQ_SetCallbackAddress(int (*)(DWORD, enigma::OBJ_connector::myevent_create()::SSQ_REPLY_UNION*))' uses local type `enigma::OBJ_connector::myevent_create()::SSQ_REPLY_UNION'
Compile failed. [1]
G++ error. Compile failed (-6)




So using #pragma comment works without a hitch, but using #include to link to my header gives me that compile error.
« Last Edit: August 21, 2008, 08:58:17 PM by indecom » Logged
Offline (Male) Rusky
Reply #2 Posted on: August 23, 2008, 03:39:10 PM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
I'd just take the generated source and compile it yourself, adding the #include  where it normally would be.
Logged
Offline (Male) Josh @ Dreamland
Reply #3 Posted on: November 16, 2008, 09:04:11 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
you could just include the file after its dependencies in SHELLmain.cpp, then add any newly implemented functions to fnames.txt.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) ludamad
Reply #4 Posted on: February 17, 2009, 08:33:06 PM
Developer
Joined: May 2008
Posts: 1256

View Profile Email
What Josh said is the best current way. In the future special headers that automatically add function names would be a good feature (maybe a special comment syntax at the start of the header to indicate function names in such a way that it is ignored when trying to compile in normal C++ IDEs).
Logged
Pages: 1
  Print