Hi there,
I'm trying to build my own 1st insim in C or C++ but i can't get it to work. I fallowed all examples here, download last helpers and libraries but still have errors. It appears that all C and C++ codes here were made to work in linux i found a nice tutorial video but it does not working in windows for somehow.
this was my steps:
1. download the Cinsim v0.6
http://www.lfsforum.net/showthread.php?t=47717
2. look all the code and see if it have any parameters to change since it have a Windows/*nix functions
3. then i couldn't compile because a missing "sched.h" include inside de Cinsim.h but i had a hard search somewhere on internet and i found it. All include file just fine now.
4. I use the source code sampleinsim.cpp found somewhere in this forums
http://www.lfsforum.net/attach ... d=111614&d=1294863787
5. and the result...
errors:
Linking...
d:\insim\c++\insim\cinsim.h(98) : error C2380: type(s) preceding 'buffer' (constructor with return type, or illegal redefinition of current class-name?)
6. i have change this part:
struct buffer
{
char buffer[PACKET_BUFFER_SIZE]; // Packet buffer - 512 should be more than enough
unsigned int bytes; // Number of bytes currently in buffer
};
to:
struct buffer
{
char buffer_pack[PACKET_BUFFER_SIZE]; // Packet buffer - 512 should be more than enough
unsigned int bytes; // Number of bytes currently in buffer
};
then results:
Linking...
sampleinsim.obj : error LNK2001: unresolved external symbol "public: __thiscall CInsim::CInsim(void)" (??0CInsim@@QAE@XZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: __thiscall CInsim::~CInsim(void)" (??1CInsim@@QAE@XZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: int __thiscall CInsim::isclose(void)" (?isclose@CInsim@@QAEHXZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: void * __thiscall CInsim::get_packet(void)" (?get_packet@CInsim@@QAEPAXXZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: char __thiscall CInsim:eek_packet(void)" (?peek_packet@CInsim@@QAEDXZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: int __thiscall CInsim::next_packet(void)" (?next_packet@CInsim@@QAEHXZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: int __thiscall CInsim::send_packet(void *)" (?send_packet@CInsim@@QAEHPAX@Z)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: int __thiscall CInsim::init(char *,unsigned short,char *,char *,struct IS_VER *,unsigned char,unsigned short,unsigned short,unsigned short)" (?init@CInsim@@QAEHPADG00PAUIS_VER@@EGG
G@Z)
Debug/insim.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.
insim.exe - 9 error(s), 0 warning(s)
7.LNK2001 & error LNK1120 means: You're using a Win32 application project when you want a console application project. Win32 applications expect WinMain instead of main. you have to either include the implementation file for Gui class in the dll project, or link with a *.lib file that includes it in either another dll or static library.
RES: I have start my project as console not win32 App, and i do include (Cinsim.h, insim.h, pthread.h, sched.h, libpthreadGC2.a, pthreadGC2.dll) from the options in Microsoft Visual C++ 6.0 and in Bloodshed Dev-C++ but have the same errors. All files in same folders.
I just hope someone can help me in this. thank you very much.
I'm trying to build my own 1st insim in C or C++ but i can't get it to work. I fallowed all examples here, download last helpers and libraries but still have errors. It appears that all C and C++ codes here were made to work in linux i found a nice tutorial video but it does not working in windows for somehow.
this was my steps:
1. download the Cinsim v0.6
http://www.lfsforum.net/showthread.php?t=47717
2. look all the code and see if it have any parameters to change since it have a Windows/*nix functions
3. then i couldn't compile because a missing "sched.h" include inside de Cinsim.h but i had a hard search somewhere on internet and i found it. All include file just fine now.
4. I use the source code sampleinsim.cpp found somewhere in this forums
http://www.lfsforum.net/attach ... d=111614&d=1294863787
5. and the result...
errors:
Linking...
d:\insim\c++\insim\cinsim.h(98) : error C2380: type(s) preceding 'buffer' (constructor with return type, or illegal redefinition of current class-name?)
6. i have change this part:
struct buffer
{
char buffer[PACKET_BUFFER_SIZE]; // Packet buffer - 512 should be more than enough
unsigned int bytes; // Number of bytes currently in buffer
};
to:
struct buffer
{
char buffer_pack[PACKET_BUFFER_SIZE]; // Packet buffer - 512 should be more than enough
unsigned int bytes; // Number of bytes currently in buffer
};
then results:
Linking...
sampleinsim.obj : error LNK2001: unresolved external symbol "public: __thiscall CInsim::CInsim(void)" (??0CInsim@@QAE@XZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: __thiscall CInsim::~CInsim(void)" (??1CInsim@@QAE@XZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: int __thiscall CInsim::isclose(void)" (?isclose@CInsim@@QAEHXZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: void * __thiscall CInsim::get_packet(void)" (?get_packet@CInsim@@QAEPAXXZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: char __thiscall CInsim:eek_packet(void)" (?peek_packet@CInsim@@QAEDXZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: int __thiscall CInsim::next_packet(void)" (?next_packet@CInsim@@QAEHXZ)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: int __thiscall CInsim::send_packet(void *)" (?send_packet@CInsim@@QAEHPAX@Z)
sampleinsim.obj : error LNK2001: unresolved external symbol "public: int __thiscall CInsim::init(char *,unsigned short,char *,char *,struct IS_VER *,unsigned char,unsigned short,unsigned short,unsigned short)" (?init@CInsim@@QAEHPADG00PAUIS_VER@@EGG
G@Z)
Debug/insim.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.
insim.exe - 9 error(s), 0 warning(s)
7.LNK2001 & error LNK1120 means: You're using a Win32 application project when you want a console application project. Win32 applications expect WinMain instead of main. you have to either include the implementation file for Gui class in the dll project, or link with a *.lib file that includes it in either another dll or static library.
RES: I have start my project as console not win32 App, and i do include (Cinsim.h, insim.h, pthread.h, sched.h, libpthreadGC2.a, pthreadGC2.dll) from the options in Microsoft Visual C++ 6.0 and in Bloodshed Dev-C++ but have the same errors. All files in same folders.
I just hope someone can help me in this. thank you very much.