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 Discussion :

Problème de "linkage" avec CodeBlocs


Sujet :

C

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Homme Profil pro
    Chercheur en informatique
    Inscrit en
    Juin 2008
    Messages
    522
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : Chercheur en informatique

    Informations forums :
    Inscription : Juin 2008
    Messages : 522
    Par défaut Problème de "linkage" avec CodeBlocs
    Bonjour

    Je souhaiterai réaliser les tests U01 (http://www.iro.umontreal.ca/~simardr/testu01/tu01.html)

    J'ai pris la version MinGW pensant l'utiliser avec CodeBlocs

    Mon problème: je ne sais pas configurer CodeBlocs car j'ai des erreurs du type
    obj\Release\main.o:main.c|| undefined reference to `g_initialiser'|

    Je pense que c'est un mauvais linkage, je ne vois pas d'autres solution. Pourriez-vous donc m'aider à incorporer correctement les .a du test et le .lib de mon générateur (j'ai vu que c'est possible)

    raphchar

    PS: J'ai testé sous VS et j'ai des erreurs du type
    Erreur 4 error LNK2001: symbole externe non résolu ___fixunsdfdi libtestu01.a(smultin.o)
    Mais je pense que c'est normal, vu que c'est prévu pour MinGW

  2. #2
    Modérateur

    Avatar de Bktero
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2009
    Messages
    4 493
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2009
    Messages : 4 493
    Billets dans le blog
    1
    Par défaut
    La question est : que compiles-tu ?

    Il y a des tas de fichiers sources et en-tête, réparti dans plusieurs dossiers, dans l'archive des sources. Comment as-tu construit ton projet dans CodeBlocks ? As-tu ajouté les bons dossiers dans Project / Build Options / Search Directories (et peut-être ailleurs aussi) ?

  3. #3
    Membre éclairé
    Homme Profil pro
    Chercheur en informatique
    Inscrit en
    Juin 2008
    Messages
    522
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : Chercheur en informatique

    Informations forums :
    Inscription : Juin 2008
    Messages : 522
    Par défaut
    Le projet utilise comme je l'ai dis plus haut la version MinGW, donc rien à recompiler pour la bibliothèque.

    J'ajoute un fichier main.c qui contient ce qu'il faut pour faire tourner un test (c'est le but de la bibliothèque), par ailleurs pas d'erreur de code

    ensuite dans
    Project / Build Options
    -Linker Setting/Link libraries : les .a des sources et le .lib de moi sont définis
    -Search directories/Linker: les dossiers sont corrects

  4. #4
    Modérateur

    Avatar de Bktero
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2009
    Messages
    4 493
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2009
    Messages : 4 493
    Billets dans le blog
    1
    Par défaut
    Ok ! Je croyais que tu voulais compiler la bibliothèque, autant pour moi.


    EDIT :
    Tu pourrais donner un code minimal reproduisant le problème STP ?

    J'en ai trouvé dans le guide d'utilisation, page 8.

    EDIT :
    Au début, je n'ai renseigné que les search directories et j'avais des erreurs dans le main, telle que :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    obj\main.o||In function `main':|
    d:\Documents and Settings\pgradot\Mes documents\TestU01-1.2.3\main.c|12|undefined reference to `ulcg_CreateLCG'|
    d:\Documents and Settings\pgradot\Mes documents\TestU01-1.2.3\main.c|19|undefined reference to `unif01_StripD'|
    d:\Documents and Settings\pgradot\Mes documents\TestU01-1.2.3\main.c|22|undefined reference to `ulcg_DeleteGen'|
    d:\Documents and Settings\pgradot\Mes documents\TestU01-1.2.3\main.c|23|undefined reference to `ulec_Createlfsr113'|
    d:\Documents and Settings\pgradot\Mes documents\TestU01-1.2.3\main.c|26|undefined reference to `unif01_StripB'|
    d:\Documents and Settings\pgradot\Mes documents\TestU01-1.2.3\main.c|30|undefined reference to `ulec_DeleteGen'|
    ||=== Build finished: 6 errors, 0 warnings ===|
    Ensuite, j'ai ajouté les 3 fichiers .a au linker et depuis, j'ai des erreurs ailleurs :
    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
    usr\lib\libtestu01.a(ulcg.o)||In function `LargeLCG_U01':|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|313|undefined reference to `num_MultModL'|
    usr\lib\libtestu01.a(ulcg.o)||In function `ulcg_CreateLCG':|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|357|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|358|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|359|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|362|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|363|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|364|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|365|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|367|undefined reference to `util_Calloc'|
    usr\lib\libtestu01.a(ulcg.o)||In function `ulcg_CreateLCGFloat':|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|575|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|576|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|577|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|580|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|581|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|582|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|583|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|585|undefined reference to `util_Calloc'|
    usr\lib\libtestu01.a(ulcg.o)||In function `ulcg_CreatePow2LCG':|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|755|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|756|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|757|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|760|undefined reference to `addstr_Int'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|761|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|762|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|763|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|765|undefined reference to `util_Calloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|768|undefined reference to `num_TwoExp'|
    usr\lib\libtestu01.a(ulcg.o)||In function `ulcg_CreateLCG2e31':|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|817|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|818|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|819|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|822|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|823|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|824|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|826|undefined reference to `util_Calloc'|
    usr\lib\libtestu01.a(ulcg.o)||In function `ulcg_CreateLCG2e32':|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|880|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|881|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|882|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|885|undefined reference to `addstr_Ulong'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|886|undefined reference to `addstr_Ulong'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|887|undefined reference to `addstr_Ulong'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|889|undefined reference to `util_Calloc'|
    usr\lib\libtestu01.a(ulcg.o)||In function `ulcg_CreateLCGPayne':|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|955|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|956|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|957|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|960|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|961|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|962|undefined reference to `addstr_Long'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|964|undefined reference to `util_Calloc'|
    usr\lib\libtestu01.a(ulcg.o)||In function `ulcg_CreateLCG2e31m1HD':|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|1025|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|1026|undefined reference to `util_Malloc'|
    r:\vvv\ccc\TestU01-1.2.3\testu01\ulcg.c|1027|undefined reference to `util_Malloc'|
    ||More errors follow but not being shown.|
    ||Edit the max errors limit in compiler options...|
    ||=== Build finished: 50 errors, 0 warnings ===|
    Spé comme emplacement !

  5. #5
    Membre éclairé
    Homme Profil pro
    Chercheur en informatique
    Inscrit en
    Juin 2008
    Messages
    522
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : Chercheur en informatique

    Informations forums :
    Inscription : Juin 2008
    Messages : 522
    Par défaut
    Pour moi, mes première erreurs viennent de ma dll, reppoussons ce problème à plus tard...

    J'ai aussi ces erreurs de compilations

  6. #6
    Modérateur

    Avatar de Bktero
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2009
    Messages
    4 493
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2009
    Messages : 4 493
    Billets dans le blog
    1
    Par défaut
    Citation Envoyé par raphchar Voir le message
    Un code?
    C'est à dire?

    Le code source ne pose pas de problème.

    Les erreurs proviennent même des fichiers de la bibliothèque
    F:\TestU01\usr\lib\libtestu01.a(unif01.o)||In function `unif01_DeleteDoubleGen'
    r:\vvv\ccc\TestU01-1.2.3\testu01\unif01.c|268|undefined reference to `util_Free'|
    Il faut bien que je compile quelque chose pour avoir une erreur non ?
    J'ai édité mon message entre temps.

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