Casawir 18 Posted March 28, 2015 Share Posted March 28, 2015 Hi, is this possible to get function from another header file without inluding it, so i can avoid circural dependency. Link to comment Share on other sites More sharing options...
Remix 45 Posted March 28, 2015 Share Posted March 28, 2015 Without including it you aren't able to call the function of another file. Why don't you want to include it? 1 Link to comment Share on other sites More sharing options...
Casawir 18 Posted March 28, 2015 Author Share Posted March 28, 2015 Without including it you aren't able to call the function of another file. Why don't you want to include it? I get error, propably caused by circural dependency. I mean when i include PythonPlayer.h in ActorInstanceSync.cpp im getting weird errors Link to comment Share on other sites More sharing options...
Remix 45 Posted March 28, 2015 Share Posted March 28, 2015 Which error do you get? 1 Link to comment Share on other sites More sharing options...
Casawir 18 Posted March 28, 2015 Author Share Posted March 28, 2015 (edited) I want to change this part of code: to check if player got immune_fall - bonus( beacouse it doesnt work, maybe u got better solution to fix that bonus ? ) To do that thing i need to call function from PythonPlayer, but i cannot include header file because i get these errors: 1>d:serwersourcemainline_releaseduserinterfaceAbstractPlayer.h(42): error C2061: syntax error : identifier 'TItemPos' 1>d:serwersourcemainline_releaseduserinterfacePacket.h(608): error C2065: 'CHARACTER_NAME_MAX_LEN' : undeclared identifier 1>d:serwersourcemainline_releaseduserinterfacePacket.h(608): warning C4200: nonstandard extension used : zero-sized array in struct/union 1> Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array 1>d:serwersourcemainline_releaseduserinterfacePacket.h(615): error C2065: 'CHARACTER_NAME_MAX_LEN' : undeclared identifier 1>d:serwersourcemainline_releaseduserinterfacePacket.h(615): warning C4200: nonstandard extension used : zero-sized array in struct/union 1> Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array 1>d:serwersourcemainline_releaseduserinterfacePacket.h(632): error C2146: syntax error : missing ';' before identifier 'pos' 1>d:serwersourcemainline_releaseduserinterfacePacket.h(632): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:serwersourcemainline_releaseduserinterfacePacket.h(1785): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:serwersourcemainline_releaseduserinterfacePacket.h(1787): error C2065: 'ITEM_SOCKET_SLOT_MAX_NUM' : undeclared identifier 1>d:serwersourcemainline_releaseduserinterfacePacket.h(1788): error C2146: syntax error : missing ';' before identifier 'aAttr' and so on Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Think 117 Posted March 30, 2015 Share Posted March 30, 2015 That's because you are mixing libraries. If you try to include PythonPlayer into an Gamelib file, it going to try to include all that's relevant to UserInterface (this has nothing to do with a circular reference). The problem is that even if you do include all the dependencies required for PythonPlayer to work, they are most likely going to conflict (on link time) with the ones on GameLib, because similar data and files are defined in each lib, plus extracting what's relevant from the stdafx.h is not fun either - each lib has their own stdafx and you can obviously not call both. TL;DR: You are not going to be able to do what you are trying to do the way you are trying to do it, and even if you somehow managed, you shouldn't mix the two libraries anyway. 1 Link to comment Share on other sites More sharing options...
Casawir 18 Posted March 31, 2015 Author Share Posted March 31, 2015 That's because you are mixing libraries. If you try to include PythonPlayer into an Gamelib file, it going to try to include all that's relevant to UserInterface (this has nothing to do with a circular reference). The problem is that even if you do include all the dependencies required for PythonPlayer to work, they are most likely going to conflict (on link time) with the ones on GameLib, because similar data and files are defined in each lib, plus extracting what's relevant from the stdafx.h is not fun either - each lib has their own stdafx and you can obviously not call both. TL;DR: You are not going to be able to do what you are trying to do the way you are trying to do it, and even if you somehow managed, you shouldn't mix the two libraries anyway. Yea thank u, I fixed this another way. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now