IdentifiantMot de passe
Loading...
Mot de passe oubli� ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les r�ponses en temps r�el, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++/CLI Discussion :

Erreurs du linker incomprises


Sujet :

C++/CLI

  1. #1
    Membre �clair� Avatar de D�cembre
    Inscrit en
    Avril 2010
    Messages
    277
    D�tails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 277
    Par d�faut Erreurs du linker incomprises
    Bonjour,

    J'essaie d�ex�cuter ce programme (du projet SeetaFace engine):
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
     
    /*
     *
     * This file is part of the open-source SeetaFace engine, which includes three modules:
     * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
     *
     * This file is an example of how to use SeetaFace engine for face detection, the
     * face detection method described in the following paper:
     *
     *
     *   Funnel-structured cascade for multi-view face detection with alignment awareness,
     *   Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
     *   In Neurocomputing (under review)
     *
     *
     * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
     * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
     *
     * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
     *
     * As an open-source face recognition engine: you can redistribute SeetaFace source codes
     * and/or modify it under the terms of the BSD 2-Clause License.
     *
     * You should have received a copy of the BSD 2-Clause License along with the software.
     * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
     *
     * Contact Info: you can send an email to [email protected] for any problems.
     *
     * Note: the above information must be kept whenever or wherever the codes are used.
     *
     */
     
    #include <cstdint>
    #include <fstream>
    #include <iostream>
    #include <string>
     
    #include "opencv2/highgui/highgui.hpp"
    #include "opencv2/imgproc/imgproc.hpp"
     
    #include "face_detection.h"
     
    using namespace std;
     
    int main(int argc, char** argv) {
      if (argc < 3) {
          cout << "Usage: " << argv[0]
              << " image_path model_path"
              << endl;
          return -1;
      }
     
      const char* img_path = argv[1];
      seeta::FaceDetection detector(argv[2]);
     
      detector.SetMinFaceSize(40);
      detector.SetScoreThresh(2.f);
      detector.SetImagePyramidScaleFactor(0.8f);
      detector.SetWindowStep(4, 4);
     
      cv::Mat img = cv::imread(img_path, cv::IMREAD_UNCHANGED);
      cv::Mat img_gray;
     
      if (img.channels() != 1)
        cv::cvtColor(img, img_gray, cv::COLOR_BGR2GRAY);
      else
        img_gray = img;
     
      seeta::ImageData img_data;
      img_data.data = img_gray.data;
      img_data.width = img_gray.cols;
      img_data.height = img_gray.rows;
      img_data.num_channels = 1;
     
      long t0 = cv::getTickCount();
      std::vector<seeta::FaceInfo> faces = detector.Detect(img_data);
      long t1 = cv::getTickCount();
      double secs = (t1 - t0)/cv::getTickFrequency();
     
      cout << "Detections takes " << secs << " seconds " << endl;
    #ifdef USE_OPENMP
      cout << "OpenMP is used." << endl;
    #else
      cout << "OpenMP is not used. " << endl;
    #endif
     
    #ifdef USE_SSE
      cout << "SSE is used." << endl;
    #else
      cout << "SSE is not used." << endl;
    #endif
     
      cout << "Image size (wxh): " << img_data.width << "x" 
          << img_data.height << endl;
     
      cv::Rect face_rect;
      int32_t num_face = static_cast<int32_t>(faces.size());
     
      for (int32_t i = 0; i < num_face; i++) {
        face_rect.x = faces[i].bbox.x;
        face_rect.y = faces[i].bbox.y;
        face_rect.width = faces[i].bbox.width;
        face_rect.height = faces[i].bbox.height;
     
        cv::rectangle(img, face_rect, CV_RGB(0, 0, 255), 4, 8, 0);
      }
     
      cv::namedWindow("Test", cv::WINDOW_AUTOSIZE);
      cv::imshow("Test", img);
      cv::waitKey(0);
      cv::destroyAllWindows();
    }
    J'ai obtenu ces deux erreurs :
    Error 11 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup C:\Users\decembre\Desktop\engine\SeetaFaceEngine-master\FaceDetection\MSVCRTD.lib(crtexew.obj) mytest
    et
    Error 12 error LNK1120: 1 unresolved externals C:\Users\decembre\Desktop\engine\SeetaFaceEngine-master\FaceDetection\Debug\mytest.exe mytest
    pouvez-vous m'aidez s'il vous plait

  2. #2
    Expert confirm�
    Homme Profil pro
    D�veloppeur informatique
    Inscrit en
    F�vrier 2005
    Messages
    5 503
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 53
    Localisation : France, Val de Marne (�le de France)

    Informations professionnelles :
    Activit� : D�veloppeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : F�vrier 2005
    Messages : 5 503
    Par d�faut
    Le type/template de projet que vous avez utilis� pour cr�er le projet Visual Studio veut une fonction "WinMain" et non une fonction "main".
    Changez de type de de projet pour un compatible avec une fonction "main" en point d'entr�e du programme, ou modifiez le code pour utiliser une fonction "WinMain", soit modifier les propri�t�s du projet pour qu'il soit compatible avec ce code (facile pour une personne habitu�e mais compl�tement abscons pour un d�butant).

+ R�pondre � la discussion
Cette discussion est r�solue.

Discussions similaires

  1. R�ponses: 16
    Dernier message: 30/04/2009, 15h51
  2. Erreur d'execution incomprise
    Par eyquem dans le forum R�seau/Web
    R�ponses: 3
    Dernier message: 05/01/2008, 02h15
  3. erreur de header incomprise
    Par skyangel20 dans le forum Langage
    R�ponses: 5
    Dernier message: 07/06/2007, 11h09
  4. [windows.h] Erreur du linker : LNK2019
    Par Cube* dans le forum Visual C++
    R�ponses: 3
    Dernier message: 01/09/2006, 22h40
  5. R�ponses: 5
    Dernier message: 22/02/2006, 18h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo