Generating dll file

This is a discussion on Generating dll file within the C++ Programming forums, part of the General Programming Boards category; Hi guys, I have a function written in C and I want to change it to dll in order to ...

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    10

    Generating dll file

    Hi guys,

    I have a function written in C and I want to change it to dll in order to then implement it in the Labview. I followed the step by step walkthrough of msdn site (I'm using VS 2010), selected a dll application type. and just changed the function's header to:

    Code:
    extern "C"  _declspec(dllexport) extern "C" _declspec(dllexport) int Train(int numOfTrials, 
    																		  int numPerTrial, 
    																		  int numOfCommands,
    																		  double* Data_in,
    																		  double* b_in,
    																		  double* bB_in,
    																		  double* gmeans1_out,
    																		  double* gmeans2l_out,
    																		  double* gmeans2r_out);
    void PrintMatrix(CvMat *Matrix,int Rows,int Cols);
    
    extern "C" _declspec(dllexport) int Train(int numOfTrials, 
    										  int numPerTrial, 
    										  int numOfCommands,
    										  double* Data_in,
    										  double* b_in,
    										  double* bB_in,
    										  double* gmeans1_out,
    										  double* gmeans2l_out,
    										  double* gmeans2r_out)
    And then copy and pasted the body of the function.
    Then I'm supposed to run the file to get the dll generated output. But, in debug mode even though a dll is generated I get the error message that: "Unable to start program '\\.....\TrainDll.dll'. And when I run it in release mode it just freezes in the Generating Code step and never finishes.
    Do you have any idea what's wrong here and what should I do?

    Thanx

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,651
    You don't run DLLs; you use them in your executable program.

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    10
    Of course, but you first have to generate them. How do you generate? by running the dll-application type project you made.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 11-11-2010, 11:05 AM
  2. File Writing Problem
    By polskash in forum C Programming
    Replies: 3
    Last Post: 02-13-2009, 09:47 AM
  3. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  4. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21