stephane / libmodbus

A Modbus library for Linux, Mac OS, FreeBSD and Windows
http://libmodbus.org
GNU Lesser General Public License v2.1
3.44k stars 1.75k forks source link

"error LNK2028: Unresolved Token" problem #72

Closed umutklc closed 12 years ago

umutklc commented 12 years ago

Hello,

I am getting the errors at the below when I compile the cod at visual studio 2008. I searched at the internet and found that a lib file may be missing but i dont know which one is needed for your libmodbus codes.

Do you have any solution for this problem.

I am waititng your helpfull answer

Best Regards

1>v3.cpp 1>d:\personel data\programlama\unk_modbus_software\version_3\v3\v3\modbus_c.h(431) : warning C4018: '>' : signed/unsigned mismatch 1>Linking... 1>v3.obj : error LNK2028: unresolved token (0A000047) "extern "C" struct _modbus * cdecl modbus_new_rtu(char const ,int,char,int,int)" (?modbus_new_rtu@@$$J0YAPAU_modbus@@PBDHDHH@Z) referenced in function "private: void clrcall v3::Form1::button_Connect_Click(class System::Object ^,class System::EventArgs ^)" (?button_Connect_Click@Form1@v3@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) 1>v3.obj : error LNK2028: unresolved token (0A000072) "extern "C" void cdecl modbus_set_bits_from_bytes(unsigned char ,int,unsigned int,unsigned char const )" (?modbus_set_bits_from_bytes@@$$J0YAXPAEHIPBE@Z) referenced in function "extern "C" int __cdecl modbus_reply(struct _modbus ,unsigned char const ,int,struct modbus_mapping_t )" (?modbus_reply@@$$J0YAHPAU_modbus@@PBEHPAUmodbus_mapping_t@@@Z) 1>v3.obj : error LNK2019: unresolved external symbol "extern "C" struct _modbus * cdecl modbus_new_rtu(char const ,int,char,int,int)" (?modbus_new_rtu@@$$J0YAPAU_modbus@@PBDHDHH@Z) referenced in function "private: void clrcall v3::Form1::button_Connect_Click(class System::Object ^,class System::EventArgs ^)" (?button_Connect_Click@Form1@v3@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) 1>v3.obj : error LNK2019: unresolved external symbol "extern "C" void cdecl modbus_set_bits_from_bytes(unsigned char ,int,unsigned int,unsigned char const )" (?modbus_set_bits_from_bytes@@$$J0YAXPAEHIPBE@Z) referenced in function "extern "C" int __cdecl modbus_reply(struct _modbus ,unsigned char const ,int,struct modbus_mapping_t )" (?modbus_reply@@$$J0YAHPAU_modbus@@PBEHPAUmodbus_mapping_t@@@Z) 1>D:\Personel Data\Programlama\Unk_Modbus_Software\Version_3\v3\Debug\v3.exe : fatal error LNK1120: 4 unresolved externals 1>Build log was saved at "file://d:\Personel Data\Programlama\Unk_Modbus_Software\Version_3\v3\v3\Debug\BuildLog.htm" 1>v3 - 5 error(s), 1 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

stephane commented 12 years ago

The current release of libmodbus doesn't compile out of the box under VC see master for progress on this front.

umutklc commented 12 years ago

I could not understand what you mean. Can you please more clear?

thank you

stephane commented 12 years ago

The current stable version doesn't support VC 2008, a work is on going on master branch.