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 :

Lib ZMQ avec CODE BLOCKS sous Windows


Sujet :

C

Vue hybride

nanosoft Lib ZMQ avec CODE BLOCKS sous... 29/05/2015, 22h41
Bktero Bonjour, Les *.lib, c'est... 30/05/2015, 04h17
nanosoft Oui, Merci Bktero, j'avais... 31/05/2015, 11h34
Bktero Si ton ZMQ correspond bien à... 01/06/2015, 08h11
nanosoft Bonsoir, Oui, c'est bien... 08/06/2015, 21h45
Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement matériel électronique
    Inscrit en
    Juin 2012
    Messages
    257
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement matériel électronique
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2012
    Messages : 257
    Par défaut Lib ZMQ avec CODE BLOCKS sous Windows
    Bonjour,

    J’ai toujours du mal à configurer un nouveau projet avec CODE BLOCKS mais là je voulais faire un essai avec la lib ZMQ et je ne m’en sort pas !

    Voici le code très simple pour voir si le projet est bien configuré (je veux travailler avec SDL également).
    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
    //  Hello World server
     
    #include <ZMQ\zmq.h>
    #include <SDL\SDL.h>
    #include <windows.h>
    #include <stdio.h>
    #include <unistd.h>
    #include <string.h>
    #include <assert.h>
     
    int main (int argc, char **argv)
    {
        // initialize SDL video
        if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0 )
        {
            printf( "Echec init SDL: %s\n", SDL_GetError() );
        }
        // make sure SDL cleans up before exit
        atexit(SDL_Quit);
        //  Socket to talk to clients
        void *context = zmq_ctx_new ();
        void *responder = zmq_socket (context, ZMQ_REP);
        int rc = zmq_bind (responder, "tcp://*:5555");
        assert (rc == 0);
     
        while (1) {
            char buffer [10];
            zmq_recv (responder, buffer, 10, 0);
            printf ("Received Hello\n");
            sleep (1);          //  Do some 'work'
            zmq_send (responder, "World", 5, 0);
        }
        return 0;
    }
    Pas de problème pour l’inclusion des .h mais j’ai un problème d’ « undefined reference » sur toutes les fonctions zmq. Et sleep() aussi (+ warning déclaration implicite).
    J’ai aussi 2 warnings : unused parameter pour argc et argv !?

    Voici mon fichier .cbp , quelqu’un pourrait-il me dire ce qui cloche ?

    Merci par avance de votre aide.
    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
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <CodeBlocks_project_file>
    	<FileVersion major="1" minor="6" />
    	<Project>
    		<Option title="ZMQ" />
    		<Option pch_mode="2" />
    		<Option compiler="gcc" />
    		<Build>
    			<Target title="Debug">
    		<Option output="bin\Debug\ZMQ" prefix_auto="1" extension_auto="1" />
    				<Option object_output="obj\Debug\" />
    				<Option type="1" />
    				<Option compiler="gcc" />
    				<Compiler>
    					<Add option="-Wextra" />
    					<Add option="-Wall" />
    					<Add option="-g" />
    				</Compiler>
    				<Linker>
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v120-mt-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v90-mt-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v90-mt-gd-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v100-mt-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v100-mt-gd-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v110-mt-4_0_4.lib" /> 
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v110-mt-gd-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v120-mt-gd-4_0_4.lib" />
    <Add library="C:\Users\Alain\Documents\Code C\BIB\SDL1.2.14\lib\libSDLmain.a"/>
    <Add directory="C:\Program Files\ZeroMQ 4.0.4\lib" />
    				</Linker>
    			</Target>
    			<Target title="Release">
    		<Option output="bin\Release\ZMQ" prefix_auto="1" extension_auto="1" />
    				<Option object_output="obj\Release\" />
    				<Option type="0" />
    				<Option compiler="gcc" />
    				<Compiler>
    					<Add option="-O2" />
    				</Compiler>
    				<Linker>
    					<Add option="-s" />
    	<Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v90-mt-4_0_4.lib" />
    	<Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v90-mt-gd-4_0_4.lib" />
    	<Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v100-mt-4_0_4.lib" />
    	<Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v100-mt-gd-4_0_4.lib" />
    	<Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v110-mt-4_0_4.lib" />
    	<Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v110-mt-gd-4_0_4.lib" />
    	<Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v120-mt-4_0_4.lib" />
    	<Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v120-mt-gd-4_0_4.lib" />
    				</Linker>
    			</Target>
    		</Build>
    		<Compiler>
    			<Add option="-Wall" />
    		</Compiler>
    		<Linker>
    			<Add library="mingw32" />
    			<Add library="SDLmain" />
    			<Add library="SDL.dll" />
    			<Add library="user32" />
    			<Add library="gdi32" />
    			<Add library="winmm" />
    			<Add library="dxguid" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v120-mt-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v120-mt-gd-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v110-mt-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v110-mt-gd-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v100-mt-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v100-mt-gd-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v90-mt-4_0_4.lib" />
    <Add library="C:\Program Files\ZeroMQ 4.0.4\lib\libzmq-v90-mt-gd-4_0_4.lib" />
    <Add directory="C:\Users\Alain\Documents\Code C\BIB\SDL-1.2.14\lib" />
    <Add directory="C:\Program Files\ZeroMQ 4.0.4\lib" />
    <Add directory="C:\Program Files\ZeroMQ 4.0.4\lib" />
    		</Linker>
    		<Unit filename="main.c">
    			<Option compilerVar="CC" />
    		</Unit>
    		<Extensions>
    			<code_completion />
    			<debugger />
    		</Extensions>
    	</Project>
    </CodeBlocks_project_file>

  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
    Bonjour,

    Les *.lib, c'est pas des fichiers pour Visual Studio ça ?

    Si tu utilises MinGW compilateur derrière ton Code::Blocks, alors il te faut des *.a normalement (voir ma signature).

  3. #3
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement matériel électronique
    Inscrit en
    Juin 2012
    Messages
    257
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement matériel électronique
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2012
    Messages : 257
    Par défaut
    Oui,

    Merci Bktero, j'avais oublié ce point d'autant que cela marche avec SDL_ttf.lib

    Mais alors peut-on obtenir des .a pour ZMQ ?
    Ou dois-je travailler avec un autre IDE ?

  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
    Si ton ZMQ correspond bien à ce ZMQ, on dirait que tu dois passer par des DLL : http://zeromq.org/build:mingw

  5. #5
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement matériel électronique
    Inscrit en
    Juin 2012
    Messages
    257
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement matériel électronique
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2012
    Messages : 257
    Par défaut
    Bonsoir,

    Oui, c'est bien cette bib. ZMQ.
    Bktero, ton lien semble être pour construire les dll de ZMQ, non ?

    Dans la lib que j'ai téléchargée il y a les répertoires include, lib, et bin avec les .dll , il y a tout ce qu'il faut normalement, non ?

    Je suis passé sous Visual C++ mais je n'ai encore pas réussi à créer un projet autre qu'un simple Win32 !

    Ne serait-ce qu'avec la SDL, je ne m'en sort pas

Discussions similaires

  1. Utilisation avec Code::Blocks sous Windows
    Par timeout dans le forum wxWidgets
    Réponses: 1
    Dernier message: 02/10/2011, 21h23
  2. Réponses: 0
    Dernier message: 12/05/2011, 21h53
  3. Code::Blocks sous Windows 7
    Par freddy38 dans le forum Code::Blocks
    Réponses: 2
    Dernier message: 04/02/2010, 23h54
  4. Problème de librairie avec code blocks sous Linux
    Par philmor34 dans le forum Code::Blocks
    Réponses: 1
    Dernier message: 31/10/2008, 13h25
  5. Utiliser Qt avec code::blocks sous Kubuntu
    Par H-bil dans le forum Qt
    Réponses: 6
    Dernier message: 18/01/2008, 00h13

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