Build schlägt fehl



  • Servus,

    wahrscheinlich ein 1000...-Fach diskutiertes Thema, aber ich probier jetzt schon seit Stunden herum und finde meinen Fehler einfach nicht. Folgende Anweisung gibt mir das Tutorial Dokument der GeniCam API:

    "Go to the project's properties, set the configuration to All Configurations, and add $(GENICAM_ROOT_V2_1)/library/CPP/Include as additional include directory and $(GENICAM_ROOT_V2_1)/library/CPP/Lib/Win32_i86 as additional library directory. Note that VisualStudio understands the $() notion so you do not have to replace the environment variable manually."

    Ich hab "$(GENICAM_ROOT_V2_4)/library/CPP/Include" unter Eigenschaften->C/C++/Allgemein/Zusätzliche Incudeverzeichnisse eingetragen. Sowohl mit der $() Notation als auch manuell.

    "$(GENICAM_ROOT_V2_4)/library/CPP/Lib/Win46_x64" habe ich unter Eigenschaften->Linker/Allgemein/Zusätzliche Bibliotheksverzeichnisse eingetragen. Sowohl mit der $() Notation als auch manuell.

    Da ich eine neuere Version der API verwende habe ich die Pfade namentlich angepasst.

    Nach all dem gefuchtel bekomme ich trotzdem einen Klotz an Fehlermeldungen.

    // GeniCamApplikation.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
    //
    
    #include "stdafx.h"
    #include <iostream>
    #include "GenApi\GenApi.h"
    
    using namespace std;
    using namespace GenICam;
    using namespace GenApi;
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	CNodeMapRef Camera;
    
    	return 0;
    }
    

    1>------ Erstellen gestartet: Projekt: GeniCamApplikation, Konfiguration: Debug Win32 ------
    1> GeniCamApplikation.cpp
    1>GeniCamApplikation.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: __thiscall GenICam::gcstring::gcstring(char const *)" (__imp_??0gcstring@GenICam@@QAE@PBD@Z)" in Funktion ""public: _thiscall GenICam::ExceptionReporter<class GenICam::AccessException>::ExceptionReporter<class GenICam::AccessException>(char const *,int,char const *)" (??0?ExceptionReporter@VAccessException@GenICam@@@GenICam@@QAE@PBDH0@Z)". 1>GeniCamApplikation.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""\_\_declspec(dllimport) public: \_\_thiscall GenICam::gcstring::gcstring(class GenICam::gcstring const &)" (\_\_imp\_??0gcstring@GenICam@@QAE@ABV01@@Z)" in Funktion ""public: \_\_thiscall GenApi::CNodeMapRefT::CNodeMapRefT(class GenICam::gcstring)" (??0?CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi@@@GenApi@@QAE@Vgcstring@GenICam@@@Z)".
    1>GeniCamApplikation.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual __thiscall GenICam::gcstring::~gcstring(void)" (__imp_??1gcstring@GenICam@@UAE@XZ)" in Funktion ""public: __thiscall GenApi::CNodeMapRefT<class GenApi::CGeneric_XMLLoaderParams>::CNodeMapRefT<class GenApi::CGeneric_XMLLoaderParams>(class GenICam::gcstring)" (??0?CNodeMapRefT@VCGeneric\_XMLLoaderParams@GenApi@@@GenApi@@QAE@Vgcstring@GenICam@@@Z)". 1>GeniCamApplikation.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""\_\_declspec(dllimport) public: \_\_thiscall GenICam::AccessException::AccessException(char const *,char const *,int,char const *)" (\_\_imp\_??0AccessException@GenICam@@QAE@PBD0H0@Z)" in Funktion ""public: class GenICam::AccessException __cdecl GenICam::ExceptionReporter::Report(char const *,...)" (?Report@?ExceptionReporter@VAccessException@GenICam@@@GenICam@@QAA?AVAccessException@2@PBDZZ)".
    1>GeniCamApplikation.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) struct GenApi::INodeMap * __cdecl GenApi::_InternalLoadDLL(class GenICam::gcstring,class GenICam::gcstring,class GenICam::gcstring)" (__imp
    ?_InternalLoadDLL@GenApi@@YAPAUINodeMap@1@Vgcstring@GenICam@@00@Z)" in Funktion ""public: virtual void __thiscall GenApi::CNodeMapRefT<class GenApi::CGeneric_XMLLoaderParams>::_ExtractIndependentSubtree(class GenICam::gcstring const &,class GenICam::gcstring const &,class GenICam::gcstring const &,class GenICam::gcstring &)" (?_ExtractIndependentSubtree@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi@@@GenApi@@UAEXABVgcstring@GenICam@@00AAV34@@Z)".
    1>GeniCamApplikation.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GenICam::AccessException::AccessException(class GenICam::AccessException const &)" (??0AccessException@GenICam@@QAE@ABV01@@Z)".
    1>GeniCamApplikation.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GenICam::GenericException::GenericException(class GenICam::GenericException const &)" (??0GenericException@GenICam@@QAE@ABV01@@Z)".
    1>GeniCamApplikation.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual __thiscall GenICam::AccessException::~AccessException(void)" (??1AccessException@GenICam@@UAE@XZ)".
    1>C:\....\Documents\Visual Studio 2012\Projects\GeniCamApplikation\Debug\GeniCamApplikation.exe : fatal error LNK1120: 8 nicht aufgelöste Externe
    ========== Erstellen: 0 erfolgreich, 1 fehlerhaft, 0 aktuell, 0 übersprungen ==========

    Hat jemand eine Idee was ich noch versuchen könnte ?



  • Du musst noch irgendwo einstellen dass er das .lib File aus diesem SDK auch mit linkt.
    Das kannst du entweder in den Projekteinstellungen machen, oder auch per #pragma comment(lib, "libname.lib")



  • Ok. Und woher weis ich, welches das .lib File ist ? Wenn ich durch die Ordnerstruktur von der GenICam sause sind da ein paar lib-Dateien.

    hustbaer schrieb:

    Du musst noch irgendwo einstellen dass er das .lib File aus diesem SDK auch mit linkt.
    Das kannst du entweder in den Projekteinstellungen machen, oder auch per #pragma comment(lib, "libname.lib")



  • Hab jetzt einfach mal alle libs in die stdafx.h gestopft.... hat aber leider auch nicht gebracht.

    // stdafx.h : Includedatei für Standardsystem-Includedateien
    // oder häufig verwendete projektspezifische Includedateien,
    // die nur in unregelmäßigen Abständen geändert werden.
    //
    
    #pragma once
    #pragma comment(lib, "GenApi_MD_VC100_v2_4.lib")
    #pragma comment(lib, "CLAllSerial_MD_VC100_v2_4.lib")
    #pragma comment(lib, "CLProtocol_MD_VC100_v2_4.lib")
    #pragma comment(lib, "CLSerCOM.lib")
    #pragma comment(lib, "GCBase_MD_VC100_v2_4.lib")
    #pragma comment(lib, "GenCP_MD_VC100_v2_4.lib")
    #pragma comment(lib, "Log_MD_VC100_v2_4.lib")
    #pragma comment(lib, "log4cpp_MD_VC100_v2_4.lib")
    #pragma comment(lib, "log4cpp-static_MD_VC100_v2_4.lib")
    #pragma comment(lib, "MathParser_MD_VC100_v2_4.lib")
    
    #include "targetver.h"
    
    #include <stdio.h>
    #include <tchar.h>
    #include "GenApi\GenApi.h"
    
    // TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
    

    1>------ Erstellen gestartet: Projekt: GeniCamApp, Konfiguration: Debug Win32 ------
    1> stdafx.cpp
    1> GeniCamApp.cpp
    1>GeniCamApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: __thiscall GenICam::gcstring::gcstring(char const *)" (__imp_??0gcstring@GenICam@@QAE@PBD@Z)" in Funktion ""public: _thiscall GenICam::ExceptionReporter<class GenICam::AccessException>::ExceptionReporter<class GenICam::AccessException>(char const *,int,char const *)" (??0?ExceptionReporter@VAccessException@GenICam@@@GenICam@@QAE@PBDH0@Z)". 1>GeniCamApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""\_\_declspec(dllimport) public: \_\_thiscall GenICam::gcstring::gcstring(class GenICam::gcstring const &)" (\_\_imp\_??0gcstring@GenICam@@QAE@ABV01@@Z)" in Funktion ""public: \_\_thiscall GenApi::CNodeMapRefT::CNodeMapRefT(class GenICam::gcstring)" (??0?CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi@@@GenApi@@QAE@Vgcstring@GenICam@@@Z)".
    1>GeniCamApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual __thiscall GenICam::gcstring::~gcstring(void)" (__imp_??1gcstring@GenICam@@UAE@XZ)" in Funktion ""public: __thiscall GenApi::CNodeMapRefT<class GenApi::CGeneric_XMLLoaderParams>::CNodeMapRefT<class GenApi::CGeneric_XMLLoaderParams>(class GenICam::gcstring)" (??0?CNodeMapRefT@VCGeneric\_XMLLoaderParams@GenApi@@@GenApi@@QAE@Vgcstring@GenICam@@@Z)". 1>GeniCamApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""\_\_declspec(dllimport) public: \_\_thiscall GenICam::AccessException::AccessException(char const *,char const *,int,char const *)" (\_\_imp\_??0AccessException@GenICam@@QAE@PBD0H0@Z)" in Funktion ""public: class GenICam::AccessException __cdecl GenICam::ExceptionReporter::Report(char const *,...)" (?Report@?ExceptionReporter@VAccessException@GenICam@@@GenICam@@QAA?AVAccessException@2@PBDZZ)".
    1>GeniCamApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) struct GenApi::INodeMap * __cdecl GenApi::_InternalLoadDLL(class GenICam::gcstring,class GenICam::gcstring,class GenICam::gcstring)" (__imp
    ?_InternalLoadDLL@GenApi@@YAPAUINodeMap@1@Vgcstring@GenICam@@00@Z)" in Funktion ""public: virtual void __thiscall GenApi::CNodeMapRefT<class GenApi::CGeneric_XMLLoaderParams>::_ExtractIndependentSubtree(class GenICam::gcstring const &,class GenICam::gcstring const &,class GenICam::gcstring const &,class GenICam::gcstring &)" (?_ExtractIndependentSubtree@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi@@@GenApi@@UAEXABVgcstring@GenICam@@00AAV34@@Z)".
    1>GeniCamApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GenICam::AccessException::AccessException(class GenICam::AccessException const &)" (??0AccessException@GenICam@@QAE@ABV01@@Z)".
    1>GeniCamApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GenICam::GenericException::GenericException(class GenICam::GenericException const &)" (??0GenericException@GenICam@@QAE@ABV01@@Z)".
    1>GeniCamApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual __thiscall GenICam::AccessException::~AccessException(void)" (??1AccessException@GenICam@@UAE@XZ)".
    1>C:\...\Documents\Visual Studio 2012\Projects\GeniCamApp\Debug\GeniCamApp.exe : fatal error LNK1120: 8 nicht aufgelöste Externe
    ========== Erstellen: 0 erfolgreich, 1 fehlerhaft, 0 aktuell, 0 übersprungen ==========


  • Mod

    Anhand der Namen vermute ich mal, dass diese Libs alle für VC 2010 gebaut wurden.
    Wenn Du VC 2012 verwenden willst musst Du auch die entsprechenden Libs dazu haben. D.h. die Libs müssen auch mit Deinem Ziel-Compiler gebaut sein.

    Was glaubst Du warum die Libs alle ein Versionsnummer der CRT/MFC im Namen tragen?

    Mich wundern Deine Linker Probleme ansonsten in keiner Weise!


Anmelden zum Antworten