Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, SBGuy, Petra), 801 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
User
Aku_Aku  Offline 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:
Quote:
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?
Quote:
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: Aku_Aku] #461200
07/28/16 14:10
07/28/16 14:10
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
You should really use Visual Studio since acknex can only run on windows anyways.
MSVC, clang and intels compiler are by far better then GCC.

Anyways, it simply tells you that random is already a defined function in windows.h

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 Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 993
Budapest
Quote:
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.

Quote:
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
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

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.

Code:
#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: Ch40zzC0d3r] #461203
07/28/16 16:46
07/28/16 16:46
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 993
Budapest
Thanks, but i suspect, i should do something with the includes.

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
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

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: Ch40zzC0d3r] #461269
07/31/16 08:38
07/31/16 08:38
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 993
Budapest
You know the problem does not occur after the windows.h include but is in windows.h
So, putting adll.h after the windows.h doesn't solve the problem.

Anyway, thank for the advice.

Re: ackexe.cpp : Tutorial Application, Lesson 1 compiling problem [Re: Aku_Aku] #461577
08/11/16 19:54
08/11/16 19:54
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 993
Budapest
Unfortunately, the problem still persists.

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
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
I always use
Code:
#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 Offline OP
User
Aku_Aku  Offline 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:
Code:
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:
Code:
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.
Page 1 of 2 1 2

Moderated by  TWO 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1