3 registered members (AndrewAMD, SBGuy, Petra),
801
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
ackexe.cpp : Tutorial Application, Lesson 1 compiling problem
#461199
07/28/16 13:57
07/28/16 13:57
|
Joined: Sep 2009
Posts: 993 Budapest
Aku_Aku
OP
User
|
OP
User
Joined: Sep 2009
Posts: 993
Budapest
|
Hi All! I am trying to build this source: Tutorial app, lesson 1 I am using Eclipse Juno combined with GCC for Windows. I have got the following messages in the console: 15:47:08 **** Build of configuration Debug for project FirstProjectA8 **** make all Building file: ../HelloA8.cpp Invoking: Cygwin C++ Compiler g++ -I"D:\Program Files (x86)\GStudio8\sdk_engine" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"HelloA8.d" -MT"HelloA8.d" -o "HelloA8.o" "../HelloA8.cpp" ../HelloA8.cpp:13:0: warning: ignoring #pragma comment [-Wunknown-pragmas] #pragma comment(lib, "acknex.lib") ^ In file included from D:\Program Files (x86)\GStudio8\sdk_engine/adll.h:64:0, from ../HelloA8.cpp:24: D:\Program Files (x86)\GStudio8\sdk_engine/afuncs.h:18:22: error: conflicting declaration of C function 'var random(var)' EXT_var F(random)(var); ^ In file included from /usr/include/ctype.h:4:0, from /usr/include/w32api/winnt.h:16, from /usr/include/w32api/minwindef.h:163, from /usr/include/w32api/windef.h:8, from /usr/include/w32api/windows.h:69, from ../HelloA8.cpp:17: /usr/include/stdlib.h:234:6: note: previous declaration 'long int random()' long _EXFUN(random,(_VOID)); ^ ../HelloA8.cpp: In function 'int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)': ../HelloA8.cpp:43:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] engine_open("arena.wmb"); ^ make: *** [subdir.mk:20: HelloA8.o] Error 1
15:47:09 Build Finished (took 1s.45ms)
Could anybody explain why this error occured above? conflicting declaration of C function 'var random(var)' How can i get rid of that? Thanks in advance.
|
|
|
Re: ackexe.cpp : Tutorial Application, Lesson 1 compiling problem
[Re: Ch40zzC0d3r]
#461201
07/28/16 14:19
07/28/16 14:19
|
Joined: Sep 2009
Posts: 993 Budapest
Aku_Aku
OP
User
|
OP
User
Joined: Sep 2009
Posts: 993
Budapest
|
Anyways, it simply tells you that random is already a defined function in windows.h I figured out the same. Can you tell me how can i get rid of that? My C/C++ knowledge is really dusty, it would be real help for me. You should really use Visual Studio since acknex can only run on windows anyways. Yes, i know that. No problem.
|
|
|
Re: ackexe.cpp : Tutorial Application, Lesson 1 compiling problem
[Re: Aku_Aku]
#461202
07/28/16 15:39
07/28/16 15:39
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
Serious User
|
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
You can use a define for that. Im not sure if its possible on a different way, never needed such a feature.
#define test test2
int test(int i)
{
return i * 2;
}
#undef test
int test(int i)
{
return i * 4;
}
int main()
{
printf("test: %i\n", test(1));
return 0;
}
|
|
|
Re: ackexe.cpp : Tutorial Application, Lesson 1 compiling problem
[Re: Aku_Aku]
#461204
07/28/16 17:23
07/28/16 17:23
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
Serious User
|
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
#include <windows.h> after adll.h should work too
Last edited by Ch40zzC0d3r; 07/28/16 17:23.
|
|
|
Re: ackexe.cpp : Tutorial Application, Lesson 1 compiling problem
[Re: Aku_Aku]
#461578
08/11/16 20:43
08/11/16 20:43
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
Serious User
|
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
I always use
#include <windows.h>
#include <stdlib.h>
#include <d3d9.h>
#include <D3dx9core.h>
#include <D3dx9math.h>
#include <DxErr.h>
#define DLL_USE
#include "adll.h"
The define should help you here
|
|
|
Re: ackexe.cpp : Tutorial Application, Lesson 1 compiling problem
[Re: Ch40zzC0d3r]
#461595
08/12/16 20:36
08/12/16 20:36
|
Joined: Sep 2009
Posts: 993 Budapest
Aku_Aku
OP
User
|
OP
User
Joined: Sep 2009
Posts: 993
Budapest
|
I tried your proposal. I had to comment out include DxErr.h, Eclipse + GCC can't resolve. After a build i got the following error:
In file included from D:/GStudio8/sdk_engine/adll.h:64:0,
from ../HelloA8.cpp:35:
D:/GStudio8/sdk_engine/afuncs.h:18:22: error: 'var (* random)(var)' redeclared as different kind of symbol
EXT_var F(random)(var);
^
In file included from /usr/include/ctype.h:4:0,
from /usr/include/w32api/winnt.h:16,
from /usr/include/w32api/minwindef.h:163,
from /usr/include/w32api/windef.h:8,
from /usr/include/w32api/windows.h:69,
from ../HelloA8.cpp:27:
/usr/include/stdlib.h:234:6: note: previous declaration 'long int random()'
long _EXFUN(random,(_VOID));
^
The interesting thing if i comment out the #define DLL_USE, i different message:
In file included from D:/GStudio8/sdk_engine/adll.h:64:0,
from ../HelloA8.cpp:35:
D:/GStudio8/sdk_engine/afuncs.h:18:22: error: conflicting declaration of C function 'var random(var)'
EXT_var F(random)(var);
^
In file included from /usr/include/ctype.h:4:0,
from /usr/include/w32api/winnt.h:16,
from /usr/include/w32api/minwindef.h:163,
from /usr/include/w32api/windef.h:8,
from /usr/include/w32api/windows.h:69,
from ../HelloA8.cpp:27:
/usr/include/stdlib.h:234:6: note: previous declaration 'long int random()'
long _EXFUN(random,(_VOID));
^
So... still persists.
Last edited by Aku_Aku; 08/12/16 20:45.
|
|
|
|