Ethernet Kommunikation mit Messgerät über C++



  • Hallo zusammen,
    ich bin hier neu und ich hoffe jemand von euch kann mir helfen.
    Ich habe folgendes Problem:
    Ich möchte mit einem Messgerät Kommunizieren.
    Das soll mit bestimmten Kommandos die in einem C++ Code eingebunden sind funktionieren. Damit das ganze funktioniert muss ich bestimmte dlls und Header Datei und eine .lib Datei in bestimmte Pfade hineinkopieren.
    Folgende Beschreibung habe ich bekommen:

    3. Using the Library with Microsoft Visual C++
    3.1 Configuration
    Files: Tmctl.h (header file for definitions of functions)
    Tmctl.lib (import library)
    - Type "tmctl.h" as the include file into to the source file you will use as follows:
    #include "tmctl.h"
    - Copy Tmctl.lib to the directory containing the library files to be linked to.
    - Copy Tmctl.dll to the Windows System directory.
    - Copy tmctl.dll to the directory that the application is referencing.
    - Copy Ykusb.dll and YKMUSB.dll to the Windows System directory if you will be using USB.
    - Copy USBTMCAPI.dll to the Windows System directory if you will be using USBTMC(DL9000).

    3.2 Overview
    This library uses an initialization function to set up a connection between the PC and devices to
    be controlled. Then, values are returned as parameters and used as distinguishing IDs for the
    connected devices. Those IDs can be passed to other functions (such as send/receive functions)
    to allow them to carry out their controls.

    Ich verstehe das doch richtig, dass ich die Dlls in den Pfad Windows\System hineinkopieren soll
    und die Header Datei in C:\Program Files\Microsoft Visual Studio 10.\VC\include
    Die .lib Datei soll ja in C:\Program Files\Microsoft Visual Studio 10.0\VC\lib

    Leider sagt c++ mir dass bestimmte variablen in der Header nicht deklariert sind. Wenn ich diese Rausnehmen, dann sagt er mir das es mit der Verlinkung nicht klappt.

    Ich habe den PC schon runtergefahren und neu gestartet. Leider kein Erfolg.
    Ich wäre euch für jede Hilfe dankbar.



  • Die Header und LIB-Dateien sollst Du in das Verzeichnis Deines *Projektes* kopieren. Die VC-Verzeichnisse sind für Dich tabu!

    Die DLL kannst Du auch in das Verzeichnis der EXE kopieren; oder aber nach system32



  • Ich habe die Lib und die Header Datei in mein Projektverzeichnis kopiert und die dlls in windows\system32 kopiert. Leider kein Erfolg. Er kann noch immer nicht die header Datei finden.
    Was ist mit Verzeichnis der EXE gemeint? Ist EXE die Visual Studio.exe Datei?
    Hat Jemand eine Idee?



  • Wenn Du

    #include "tmctl.h"
    

    machst geht es. Du darfst eben kein

    #include <tmctl.h>
    

    verwenden!
    Und die Include-Datei muss im Verzeichnis der *.vcproj liegen!



  • Jetzt sagt er mir:

    error LNK2019: Verweis auf nicht aufgelöstes externes Symbol

    Weiß jemand rat?
    Ist das diesmal ein Programmierfehler?



  • Hallo zusammen:

    der Fehler :
    fatal error LNK1120: 1 nicht aufgelöste externe Verweise.

    weißt auf einen Fehler im Linker hin.
    Dieser Fehler kommt doch nur wenn die Definition fehlt.
    Kann mir Jemand helfen?



  • Du musst ja auch noch die LIB einbinden:

    #pragma comment(lib, "Tmctl.lib")
    


  • Hallo zusammen,
    ich habe noch ein Problem. Wenn ich das programm ausführen lassen habe ich folgende Fehlermeldung:

    "test.exe": "C:\Documents and Settings\schmiti\Desktop\test\Debug\test.exe" geladen, Symbole wurden geladen.
    "test.exe": "C:\WINDOWS\system32\ntdll.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\kernel32.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\tmctl.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\YKMUSB.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\setupapi.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\advapi32.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\rpcrt4.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\secur32.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\gdi32.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\user32.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\msvcrt.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\winspool.drv" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\shlwapi.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\oleaut32.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\ole32.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\ws2_32.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\ws2help.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\msvcp100d.dll" geladen, Symbole wurden geladen.
    "test.exe": "C:\WINDOWS\system32\msvcr100d.dll" geladen, Symbole wurden geladen.
    "test.exe": "C:\Program Files\Spyware Doctor\smum32.dll" geladen, Die Binärdaten wurden nicht mit Debuginformationen erstellt.
    "test.exe": "C:\WINDOWS\system32\apphelp.dll" geladen, Cannot find or open the PDB file
    "test.exe": "C:\WINDOWS\system32\version.dll" geladen, Cannot find or open the PDB file
    Das Programm "[3996] test.exe: Systemeigen" wurde mit Code 0 (0x0) beendet.

    Kann mir Jemand von euch helfen?
    Die PDB Files sind doch Datenbanken vom Debugger. Ich habe aber keine weiteren PDB Files. Muss er die nicht von selber erstellen?


  • Mod

    Das sind keine Fehler.
    Es sind nur Warnungen, dass Du eben nicht zu allen DLLs, die Dein Programm benutzt Debug-Symbole hast.
    Du kannst das weiter Einschränken indem Du einemn Microsoft-Symbol-Server in Deinem VS mit verwendest, dann bekmmst Du weitere Symboldateien.

    Aber nötig zum Debuggen für Deinen Code sind die nicht. Evtl. aber hilfreich...



  • Danke für euere Hilfe. Es Funktioniert.


Anmelden zum Antworten