[RESOLVED] LNK errors - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30

Thread: [RESOLVED] LNK errors

  1. #16
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,381

    Re: LNK errors

    You didn't put a space before the /exports as in my post #14
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  2. #17
    Join Date
    Aug 2014
    Posts
    16

    Re: LNK errors

    Quote Originally Posted by 2kaud View Post
    You didn't put a space before the /exports as in my post #14
    I am really sorry , I appreciate your help.The following is the info.

    C:\Program Files (x86)\Microsoft Visual Studio 8\vc\bin>"C:\Program Files (x86)\
    Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
    Setting environment for using Microsoft Visual Studio 2005 x86 tools.

    C:\Program Files (x86)\Microsoft Visual Studio 8\vc\bin>dumpbin dynamixel.lib /e
    xports
    Microsoft (R) COFF/PE Dumper Version 8.00.50727.42
    Copyright (C) Microsoft Corporation. All rights reserved.


    Dump of file dynamixel.lib

    File Type: LIBRARY

    Exports

    ordinal name

    dxl_get_highbyte
    dxl_get_lowbyte
    dxl_get_result
    dxl_get_rxpacket_error
    dxl_get_rxpacket_length
    dxl_get_rxpacket_parameter
    dxl_initialize
    dxl_makeword
    dxl_ping
    dxl_read_byte
    dxl_read_word
    dxl_rx_packet
    dxl_set_txpacket_id
    dxl_set_txpacket_instruction
    dxl_set_txpacket_length
    dxl_set_txpacket_parameter
    dxl_terminate
    dxl_tx_packet
    dxl_txrx_packet
    dxl_write_byte
    dxl_write_word

    Summary

    CC .debug$S
    14 .idata$2
    14 .idata$3
    8 .idata$4
    8 .idata$5
    E .idata$6

    C:\Program Files (x86)\Microsoft Visual Studio 8\vc\bin>

  3. #18
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,381

    Re: LNK errors

    Code:
    dxl_initialize
    ...
    dxl_initialize@8
    Looks like it's the 'infamous' c++ name mangling issue.

    Try changing the extension of your source program from .cpp to .c and see if then compiles and links.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  4. #19
    Join Date
    Aug 2014
    Posts
    16

    Re: LNK errors

    No, it does not links.

    1>test.c
    1>Linking...
    1>test.obj : error LNK2019: unresolved external symbol _dxl_initialize@8 referenced in function _main
    1>C:\Users\Muqeet\Documents\Visual Studio 2005\Projects\Test1\Debug\Test1.exe : fatal error LNK1120: 1 unresolved externals
    1>Build log was saved at "file://c:\Users\Rambo\Documents\Visual Studio 2005\Projects\Test1\Test1\Debug\BuildLog.htm"
    1>Test1 - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Last edited by learnforlife; August 23rd, 2014 at 08:49 AM.

  5. #20
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,381

    Re: LNK errors

    Can you provide a link from where I can download the dynamixel library so I can have a look at it.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  6. #21
    Join Date
    Aug 2014
    Posts
    16

    Re: LNK errors

    Sure, thank you for your help.

    Here is the link - http://support.robotis.com/en/softwa...xl_windows.htm

    You may scroll down and find the Visual C++ where there is info about the settings to be made and some examples.

  7. #22
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,381

    Re: LNK errors

    I don't have VS2005 installed but I tried it with VS2012 and your test program compiles and links OK for me with no errors using the .h and .lib files from the provided site. I can only think that it must be a configuration parameter for your VS that is causing the problem.

    I put the dynamixel files dynamixel.dll, dynamixel.lib and dynamixel.h in the folder c:\develop\dynamixel. In the link section of VS configuration under general settings I set Additional Library Directories to c:\develop\dynamixel. I made no other changes to the default settings for the linker section and it linked OK. To get it to compile in the c/c++ configuration section I set Additional Include Directories to c:\develop\dynamixel and under Configuration Properties General I set Character Set to Multi-Byte Character Set.

    May I suggest that you start a new project from scratch, and just change the configuration settings mentioned above - changing the directory names to where your files are located.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  8. #23
    Join Date
    Aug 2014
    Posts
    16

    Re: LNK errors

    I am also using Windows 8.1, is that a problem ?

  9. #24
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,381

    Re: LNK errors

    Quote Originally Posted by learnforlife View Post
    I am also using Windows 8.1, is that a problem ?
    No. I've tried it using VS2012 under Windows 8.1 and the program compiles and links OK with no problems.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  10. #25
    Join Date
    Aug 2014
    Posts
    16

    Re: LNK errors

    Thank you so much for your help.

    Could you please post the project file you tested, so that I can check it. Please find my project solution in attachment of this post.

    ConsoleApplication2.zip

    I appreciate your help allot. Thank you.

  11. #26
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,381

    Re: LNK errors

    Hum. Using your attached files I get the same error! However, replacing your dynamixel files with the ones I downloaded work OK and your test program compiles/links with no problems. So there seems to be a problem with the files you downloaded. I have attached a zip of the dynamixel files that compile/link OK for me (32 bit version).
    Attached Files Attached Files
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  12. #27
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,381

    Re: LNK errors

    The dynamixel files you downloaded are the x64 (64 bit) versions but you are trying to generate x86 (32 bit) code. That is why you are getting the link error. If you set the configuration options for VS to generate x64 code then the dynamixel files you have compile and link OK. If you set VS configuration options for x86 code (as yu have) then you should use the x86 version of dynamixel (the zipped version in my post #26).

    The version of the SDK you use is related to the platform for which you are compiling (x64 or x86) and not the platform of the computer on which you have VS installed.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  13. #28
    Join Date
    Aug 2014
    Posts
    16

    Re: LNK errors

    It is still not able to debug and create a file for me. Could you please send me your project file that worked for you.

    It gives me the following error :

    'ConsoleApplication2.exe' (Win32): Loaded 'C:\ConsoleApplication2\Debug\ConsoleApplication2.exe'. Symbols loaded.
    'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
    'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
    'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
    The program '[7492] ConsoleApplication2.exe' has exited with code -1073741701 (0xc000007b).

  14. #29
    Join Date
    Aug 2014
    Posts
    16

    Re: LNK errors

    Oh, wait my VS was set to use the .dll for 64 bit again. It is working now. Thank you so much for your help. I appreciate it allot from the bottom of my heart.

  15. #30
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,381

    Re: LNK errors

    Pleased to have been of help. As the issue is now fixed, perhaps you would mark this thread as resolved.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center