Unresolved external whilst creating dll

I am attemping to use a simple piece of c++ code within a java applet that will allow my frames to flash on the taskbar. I followed the hello world JNI example on this site and got that working correctly, so I went on and tried to get some native code working in my applet. The problem comes when I try to actually create the dll library (i'm using the VC++ command line toolkit), here's the output I'm getting:
/dll
/implib:im.lib
/out:im.dll
imImp.obj
      Creating library im.lib and object im.exp
imImp.obj : error LNK2019: unresolved external symbol __imp__FlashWindow@8 referenced in function _Java_im_IM_flashwindow@16
imImp.obj : error LNK2019: unresolved external symbol __imp__FlashWindowA@8 referenced in function _Java_im_IM_flashwindow@16
im.dll : fatal error LNK1120: 2 unresolved externalsNow I have absolutely no idea whats causing this! Here's my header file (im_IM.h, which javah created for me):
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class im_IM */
#ifndef _Included_im_IM
#define _Included_im_IM
#ifdef __cplusplus
extern "C" {
#endif
#undef im_IM_FOCUS_TRAVERSABLE_UNKNOWN
#define im_IM_FOCUS_TRAVERSABLE_UNKNOWN 0L
#undef im_IM_FOCUS_TRAVERSABLE_DEFAULT
#define im_IM_FOCUS_TRAVERSABLE_DEFAULT 1L
#undef im_IM_FOCUS_TRAVERSABLE_SET
#define im_IM_FOCUS_TRAVERSABLE_SET 2L
#undef im_IM_TOP_ALIGNMENT
#define im_IM_TOP_ALIGNMENT 0.0f
#undef im_IM_CENTER_ALIGNMENT
#define im_IM_CENTER_ALIGNMENT 0.5f
#undef im_IM_BOTTOM_ALIGNMENT
#define im_IM_BOTTOM_ALIGNMENT 1.0f
#undef im_IM_LEFT_ALIGNMENT
#define im_IM_LEFT_ALIGNMENT 0.0f
#undef im_IM_RIGHT_ALIGNMENT
#define im_IM_RIGHT_ALIGNMENT 1.0f
#undef im_IM_serialVersionUID
#define im_IM_serialVersionUID -7644114512714619750i64
#undef im_IM_serialVersionUID
#define im_IM_serialVersionUID 4613797578919906343i64
#undef im_IM_INCLUDE_SELF
#define im_IM_INCLUDE_SELF 1L
#undef im_IM_SEARCH_HEAVYWEIGHTS
#define im_IM_SEARCH_HEAVYWEIGHTS 1L
#undef im_IM_serialVersionUID
#define im_IM_serialVersionUID -2728009084054400034i64
#undef im_IM_serialVersionUID
#define im_IM_serialVersionUID -5836846270535785031i64
* Class:     im_IM
* Method:    flashWindow
* Signature: (Ljava/lang/String;Z)V
JNIEXPORT void JNICALL Java_im_IM_flashWindow
  (JNIEnv *, jobject, jstring, jboolean);
#ifdef __cplusplus
#endif
#endifAnd here's my c++ code (imImp.cpp):
#include <jni.h>
#include "im_IM.h"
#include <Windows.h>
JNIEXPORT void JNICALL Java_im_IM_flashWindow(JNIEnv * env, jobject obj, jstring windowTitle, jboolean flash)
     const char* cWindowTitle = env->GetStringUTFChars(windowTitle, 0);
     HWND hwnd = FindWindow(NULL, cWindowTitle);
     env->ReleaseStringUTFChars(windowTitle, cWindowTitle);
     FlashWindow(hwnd, flash);
}Does anybody know how I can fix this? Thanks in advance.

You need another library (probably shared rather than static) in your link process.
(And no I don't know what it is.)

Similar Messages

  • Unresolved external symbols when building release version of DLL

    I have C code which I use to build a DLL project.  I have used the same code to create this DLL project in several different solutions.
    I am trying to build it in a new solution, and can build the debug version, but I receive a bunch of unresolved external errors when I try to build the release version.
    I have painstakingly compared the project release properties with the debug properties, and with the release properties of the same project when I have included it in other solutions.  I can't find the problem.
    Here are a few of the errors:
    1>OLDNAMES.lib(access.obj) : error LNK2001: unresolved external symbol _access
    1>Cbase_filedir.obj : error LNK2001: unresolved external symbol __imp__strchr
    1>Cusage.lib(CusageWebLog.obj) : error LNK2001: unresolved external symbol __imp__strchr
    1>Cbase_filedir.obj : error LNK2001: unresolved external symbol __imp__fopen
    Any Suggestions?
    Mike

    Hi Mike,
    Thanks for posting in MSDN forum.
    1.Please check project properties->Linker->Additional dependencies has the same libs in both debug and release version. Maybe the lib you added in bebug version but not working in release version.
    2.Double check there is no code in something like that #ifdebug  ... #endif
    3.please use the same character set in your dll or the referenced lib. Both are unicode character set or multi-Bity.
    4.Please use the same Runtime library in your dll or the referenced lib. Both are C\C++->code generation->runtime library ->/MD or /MT
    Above are some general scenarios, hope this helps some.
    Best regards,
    Shu Hu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • C++ builder 6 unresolved external error loading a dll

    Im using LabVIEW 6.1 and i'm trying to export a DLL that performs math routines (such as FFT and stuff..) to include it im my BC#B6 project. I chose the C Calling convention (because the Standard Calling Convention cannot be converted by the Coff2omf.exe tool (to get rid of the 0x21 error)). Still, i now get the following linking error (it searches for an underscore before the first letter of my function):
    [Linker Error] Unresolved external '_calcul' referenced from E:\WORK\PROJECT\CALLINGFORM.OBJ
    for now i only have a simple "multiply by 2" function that takes an int and returns an int :
    int16 __cdecl calcul(int16 Input);
    I would like to know...
    1 - How to get rid of this problem - where is the source
    of the problem (application builder i guess)?
    2 - Will I have this problem if i link dynamically the driver?
    3 - do i need to link the Run-time engine dlls to make it work in both static and dynamic loading?
    Simon Lapierre
    [email protected]

    Hello Simon,
    Thank you for contacting National Instruments.
    When you created your DLL in LabVIEW, a LIB file should also have been created. To call the DLL in C#, make sure that you include the LIB file in C#.
    In answer to your questions:
    1. You can solve this problem by including the LIB file in C#.
    2. You will not have this problem if you dynamically link the driver.
    3. You do not need to link the Run-time engine DLLs to make it work in both static and dynamic loading.
    I hope this helps. Let me know if this does not solve your problem.
    Sean C.
    Applications Engineer
    National Instruments

  • Unresolved external symbol NumericArrayResize when compiling a DLL at x64 platform using vs2005

    I have a dll which is called by Labview through "Call Library Function Node". I want to port this dll to x64 platform from 32bit code which runs well at x86 computer. So, I download the Labview 8.5 evaluation version, replace the orginal referenced header file and library file in 32 bit code, such as extcode.h, fundtypes.h, labview.lib etc. Then I compile the code with Visual Studio 2005, error occurs when link "error LNK2001: unresolved external symbol NumericArrayResize". I don't know why because I really link library labview.lib. Can anyone help me?

    Please check the solution in this thread, this may help you solve your problem.
    http://stackoverflow.com/questions/925540/how-to-resolve-the-following-linker-errors-in-visual-studio
    If you still get the same problem after try the solution, please feel free and let me know.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Unresolved external symbol __imp__JNI_CreateJavaVM@12 Under JDK 1.6

    I'm running on Microsoft Vista using VisualStudio 2008 to create a C++ program that starts a Java process through JNI. I'm using jdk1.6.0_13 which is currently the only JDK on my machine. I started with a very basic program to just boot strap the project, and immediately ran into an issue. I'm linking with the jvm.lib in the JDK lib directory, but I seem to still be missing the import reference for JNI_JavaCreateVM. Any idea why the linker can't pick up the reference?
    // Test2JNI.cpp : Defines the entry point for the console application.
    #include "stdafx.h"
    #include <jni.h>
    int _tmain(int argc, _TCHAR* argv[])
         JavaVM *jvm = NULL;       /* denotes a Java VM */
        JNIEnv *env = NULL;       /* pointer to native method interface */
        JavaVMInitArgs vm_args; /* JDK/JRE 6 VM initialization arguments */
        JavaVMOption* options = new JavaVMOption[1];
        options[0].optionString = "-Djava.class.path=lib/maxwell.jar";
        vm_args.version = JNI_VERSION_1_6;
        vm_args.nOptions = 1;
        vm_args.options = options;
        vm_args.ignoreUnrecognized = false;
        /* load and initialize a Java VM, return a JNI interface
         * pointer in env */
        jint result = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
        delete[] options;
        /* invoke the Main.test method using the JNI */
        jclass cls = env->FindClass("com.zenmonics.maxwell.Maxwell");
        jmethodID mid = env->GetStaticMethodID(cls, "main", "([Ljava.lang.String)V");
        env->CallStaticVoidMethod(cls, mid, 100);
        /* We are done. */
        jvm->DestroyJavaVM();
         return 0;
    Error
    1>------ Build started: Project: Test2JNI, Configuration: Debug Win32 ------
    1>Linking...
    1>Test2JNI.obj : error LNK2019: unresolved external symbol __imp__JNI_CreateJavaVM@12 referenced in function _wmain
    1>C:\Users\Owner\Business\Engagements\Zenmonics\Test2JNI\Debug\Test2JNI.exe : fatal error LNK1120: 1 unresolved externals
    1>Build log was saved at "file://c:\Users\Owner\Business\Engagements\Zenmonics\Test2JNI\Debug\BuildLog.htm"
    1>Test2JNI - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Link Line =
    /OUT:"C:\Users\Owner\Business\Engagements\Zenmonics\Test2JNI\Debug\Test2JNI.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\Program Files\Java\jdk1.6.0_13\lib" /MANIFEST /MANIFESTFILE:"Debug\Test2JNI.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\Owner\Business\Engagements\Zenmonics\Test2JNI\Debug\Test2JNI.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT jvm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

    HI,
    I am facing the same problem.
    Still you can look at my output
    I look for Dir structure. Declared all Env Variables too. And yes I also specified the jvm.dll for it. But still error remains same.
    C:\Program Files\xerox\practice\devprac>"c:\Program Files\Microsoft Visual Studio 8\VC\bin\cl.exe" -I"C:\Program Files\Microsoft Visual Studio 8\VC\include" -Ic:\Softwares\JDeveloper\jdk\include -Ic:\Softwares\JDeveloper\jdk\include\win32 -I"C:\Program Files\Microsoft Visual Studio 8\VC\lib" -IC:\Softwares\JDeveloper\jdk\jre\bin\server\jvm.dll -LD devprac_Use5.c -Fedevprac_Use5.exe
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
    Copyright (C) Microsoft Corporation. All rights reserved.
    devprac_Use5.c
    Microsoft (R) Incremental Linker Version 8.00.50727.42
    Copyright (C) Microsoft Corporation. All rights reserved.
    /dll
    /implib:devprac_Use5.lib
    /out:devprac_Use5.exe
    devprac_Use5.obj
    devprac_Use5.obj : error LNK2019: unresolved external symbol __imp__JNI_CreateJa
    vaVM@12 referenced in function _main
    devprac_Use5.exe : fatal error LNK1120: 1 unresolved externals

  • Unresolved external symbols when linking C++ with ni.4882.obj

    Moving from 32-bit XP to Windows 7 using Microsoft Visual Studio 2008 C++.  When linking with NI-488.2 version 3.0.2 I (ni4882.obj) get the following warning and errors:
    1>Linking...
    1>ni4882.obj : warning LNK4217: locally defined symbol _time64 imported in function time
    1>ni4882.obj : error LNK2019: unresolved external symbol __imp_rand referenced in function LoadFunction
    1>ni4882.obj : error LNK2019: unresolved external symbol __imp_srand referenced in function LoadFunction
    1>ATP.exe : fatal error LNK1120: 2 unresolved externals
    1>Creating browse information file...
    1>Microsoft Browse Information Maintenance Utility Version 9.00.21022
    1>Copyright (C) Microsoft Corporation. All rights reserved.
    Any ideas.
    Solved!
    Go to Solution.

    Hi Guys,
    I got this error too recently. Was troubling me a lot. I was using Windows 7 OS, Visual Studio 2010 compiler.
    The fix for this is pretty much straight forward and solution lies in the Project settings only.
    To my knowledge, with /MDd switch, it causes the compiler to place the library name MSVCRTD.lib into the .obj file.
    But with /MTd switch, This option just causes the compiler to place the library name LIBCMTD.lib into the .obj file so that the linker will use LIBCMTD.lib to resolve external symbols. For details, please refer to this MSDN article:
    https://msdn.microsoft.com/en-us/library/2kzt1wy3(VS.71).aspx
    Its very useful.
    Also
    MDd stands for Multi-threaded Debug DLL
    MTd stands for Multi-threaded Debug
    Thanks,
    Kiran

  • LNK2019: unresolved external symbol errors.

    I am new to JNI and I am experimenting with a C library we have. I could compile the java code and create the .h header file. When I tried to compile the .c file and generate a .dll file, i get the following link errors.
    cl -I:C:\projects\NewLogon -LD Logon.c -Felogon.dll -link /LIBPATH:"C:\projects\NewLogon\lib\"
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
    Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
    Logon.c
    Microsoft (R) Incremental Linker Version 7.10.3077
    Copyright (C) Microsoft Corporation. All rights reserved.
    /dll
    /implib:logon.lib
    /out:logon.dll
    /LIBPATH:C:\projects\NewLogon\lib
    Logon.obj
    Creating library logon.lib and object logon.exp
    Logon.obj : error LNK2019: unresolved external symbol SAPIHandleRelease referenced in function Java_Logon_logon@8
    Logon.obj : error LNK2019: unresolved external symbol SAPILogon referenced in function Java_Logon_logon@8
    Logon.obj : error LNK2019: unresolved external symbol SAPIHandleAcquire referenced in function Java_Logon_logon@8
    Logon.obj : error LNK2019: unresolved external symbol SAPIExtendedLastErrorGetreferenced in function Java_Logon_logon@8
    Logon.obj : error LNK2019: unresolved external symbol _SAPIInit referenced in fu
    nction JavaLogon_logon@8
    logon.dll : fatal error LNK1120: 5 unresolved externals
    I hope the syntax of the command is correct, if not, please let me know. All the unresolved methods are supposed to be in the library files (.lib) located in the "NewLogon\lib" folder. I am not positive about that assumption, is there a way to look at a .lib file and make sure that the methods are defined correctly?
    Any help is greatly appreciated and thanks in advance.
    Hugo

    I am having the same errors, can anyone provide some help with this?

  • Unresolved external 'JNI_GetDefaultJavaVMInitArgs' error

    need help. i keep on getting
    Error : Unresolved external 'JNI_GetDefaultJavaVMInitArgs' referenced from D:\NATIVES\JNATIVEIMP.OBJ
    and
    Error : Unresolved external 'JNI_CreateJavaVM' referenced from D:\NATIVES\JNATIVEIMP.OBJ
    jnativeimp is the cpp file i'm using. i'm using the free borland compiler v5.5. jdk1.3.1_02
    JDK1_1InitArgs vm_args; _
    jint res; _
    jclass cls; _
    jmethodID mid; _
    jstring jstr; _
    jobjectArray args; _
    char classpath[1024]; _
    vm_args.version = 0X00010002; _
    JNI_GetDefaultJavaVMInitArgs((void*)&vm_args); _
    sprintf(classpath, "%s%c%s", vm_args.classpath, PATH_SEPARATOR, USER_CLASSPATH);
    vm_args.classpath = classpath; _
    res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args); _

    hi,
    my code goes like this. i've already loaded the jvm.dll like what andrew said, but still getting the 'unresolved' error. i decided to just place jvm.dll in my current working directory. i think that shouldn't be a problem as long as its loaded and it did. what else have i missed out. pls help.
    #include <stdio.h>
    #include <stdlib.h>
    #include <jni.h>
    #include <windows.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #ifdef _WIN32
    #define PATH_SEPARATOR ';'
    #endif
    #define USER_CLASSPATH "."
    #define DOTRELEASE "1.4"
    #define JRE_KEY "Software\\JavaSoft\\Java Runtime Environment"
    main(){
    HINSTANCE handle;
    JNIEnv *env = NULL;
    JavaVM *jvm = NULL;
    JavaVMInitArgs vm_args;
    JavaVMOption options[4];
    jint res;
    jclass cls;
    jmethodID mid;
    jstring jstr;
    jobjectArray args;
    char classpath[1024];
    if ((handle = LoadLibrary("jvm.dll"))==0)
    printf("unable to load jvm.dll\n");
    } else {
    printf("jvm.dll is loaded\n");
    options[0].optionString = "-Djava.compiler=NONE";
    options[1].optionString = "-Djava.class.path=c:\javanative";
    options[2].optionString = "-Djava.library.path=c:\borland\bcc55\lib";
    options[3].optionString = "-verbose:jni,class";
    vm_args.version = JNI_VERSION_1_2;
    vm_args.options = options;
    vm_args.nOptions = 4;
    vm_args.ignoreUnrecognized = JNI_FALSE;
    res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
    if (res < 0){
    printf("Can't create java VM \n");
    exit(1);
    ........

  • Why to fail to creat .dll

    Hi dear all,
    I have a existing c++ class such as HelloWorld, and a method hello() is contained in it. I want to call it from a java class.
    JNIEXPORT void JNICALL Java_JBlindSignature_hello(JNIEnv * env, jobject obj)
    HelloWorld hw;
    hw.hello();
    But it fail to create a dll file: error LNK2001: unresolved external symbol "public: void __
    thiscall Namespace::HelloWorld::hello(void)" (?hello@HelloWorld@ETI@@QAEXXZ)
    ***.dll : fatal error LNK1120: 1 unresolved externals     
    It will succeed if I don't call the hello method. What is the problem?
    Would you like to tell me the reason as soon as possible?
    Best regards,
    Johnson

    How to import? Is it to "#include HelloWorld.h"?
    But it is ok if I wirte off the line "hw.hello()".
    I use the command line to create the dll:
    cl -Ig:\jdk1.3.1\include -Ig:\jdk1.3.1\include\win32 -MD -LD **.cpp -Fe**.dll

  • Creating dll, lib, fp's to be used in other CVI programs

    Disclaimer: I am a self-taught CVI (and C) programmer in which I learned from examples, NI forums, and google  
    Main question: What is the proper way to create a dll, lib, and fp to be used in other CVI programs?  What I am doing is creating a "wrapper class" called PowerSupplies (and other wrapper classes) that takes arguments from the user and call the correct functions based on the power supply model type.
    Inside my Power Supplies project, I have included each power supply's function panel.  In the C file, I have added my functions and include file.  for example, here's one
    int _VI_FUNC Supply_InitSupply (int devs, char *resourceName, int IDQuery, int resetDevice, int *instrumentID) {
    switch (devs) {
    case AG663XXA:
    return ag663xxa_init(resourceName,IDQuery,resetDevice,instrumentID);
    case HPE364XA:
    return hpe364xa_init (resourceName, IDQuery, resetDevice, instrumentID); //Has Voltage and Current
    return -1;
    and then of course at the bottom, there resides the DllMain and DllEntryPoint functions.  What the heck are these, and am I suppose to rename these?  I ask because I created another wrapper classes with DMM's and I get the Multiply Defined Symbol Error with these two functions when using together in a separate program.
    Additionally, I have created a header file, which can be included in other CVI programs to know what functions there are.  I noticed I could "Generate Prototypes" after the fact and wasn't sure if this was the correct way or not.  My header file is below:
    #ifndef __PowerSupplies_H__
    #define __PowerSupplies_H__
    #ifdef __cplusplus
    extern "C" {
    #endif
    //==============================================================================
    // Include files
    #include "cvidef.h"
    #include "ivi.h"
    //==============================================================================
    // Constants
    #define POWER_SUPPLY_ENUM_FACTOR 200
    typedef enum
    AG663XXA = 200,
    HPE364XA
    } power_supply_type;
    static IviStringValueTable power_supply_table =
    {AG663XXA, "AG-663##X"},
    {HPE364XA, "HP-E364#A"}
    //==============================================================================
    // Types
    /************** Static Function Declarations **************/
    /************** Global Variable Declarations **************/
    /************** Global Function Declarations **************/
    int _VI_FUNC Supply_InitSupply(int devs,char *resourceName, int IDQuery, int resetDevice,int *instrumentID);
    /*commented out long list of functions for this forum's sake*/
    int _VI_FUNC Supply_Close(int devs, int instrumentID);
    int __stdcall DllMain(HINSTANCE hinstDLL,DWORD fdwReason, LPVOID lpvReserved);
    int __stdcall DllEntryPoint(HINSTANCE hinstDLL,DWORD fdwReason, LPVOID lpvReserved);
    #ifdef __cplusplus
    #endif
    #endif /* ndef __PowerSupplies_H__ */
    I then have built it as a static library and dynamic link library.  I then generated a Function Panel from the header file with Prefix Supply_ and Qualifier as _VI_FUNC.
    All worked nice and dandy, copied files to appropriate places in the IVI directory.
    In my other CVI program in which uses these "wrapper classes", I have included the function panel's that I created.
    Well with the error i mentioned above about Multiple Defined Symbol, I have come here to figure out what went wrong.
    What are the DllMain and entry point functions?
    Is my c and h files created correctly with proper prefixs?  I tried extern once, and got errors I believe.
    Does the function panel use the .lib files? Am I going about this correctly or is there an easier/more efficient way?
    Any and all advice is greatly appreciated!!!
    Thanks!

    There's info in the CVI help on how to make DLL,s in CVI.
    There's quite a bit more to it than you might imagine at first.
    I've pasted a DllMain that I wrote.
    Some key issues:
    You can put a type library into your DLL, that way if you add the DLL as a reference in Visual Studio, VS will know the prototype without your having to bring in a header file or import library of any kind.
    CVI created DLL's are not "active" DLL's and should not be registered with regsvr32, this will just make a mess.
    You can tell CVI what you're exporting in a couple of different ways, I always use "symbols marked for exports"  and use the macros DLLEXPORT DLLSTDCALL, but NI says using a header file is preferable, I forget why.
    The DLL search path is a wonderful thing - it's easy to wind up using a different copy of the DLL than you intended due to the way windows searches for the DLL.  Different versions of windows have slightly different rules.  Some allow redirection to help you manage the search path.
    CVI will not automatically switch between debug and release versions of the import library - you have to call out the correct version in your project and link it to any executable using it. 
    You can do "dynamic" loading / linking of a CVI DLL without binding to an import library using GetProcAddress function, but it's easier to use the import library.
    A DllMain isn't necessary but is good practice.
    Good luck.
    /*== PRAGMAS =====================================================================================================*/
    #if defined (_CVI_) && (_CVI_ >= 850)
      #if defined _CVI_DEBUG_
        #pragma C99_extensions_on  
      #endif
    #endif
    /*== INCLUDE FILES ===============================================================================================*/
    #include <windows.h>
    #include <userint.h>
    #include <ansi_c.h>                                                                                     
    #include <cvirte.h>
    #include <stdio.h>
    #include <utility.h>
    #include <analysis.h>
    #include <toolbox.h>
    #include <formatio.h>      
    /*== MACROS ======================================================================================================*/
    #define MAX_STRING_SIZE 256   
    #define MAX_MESSAGE_SIZE 256
    #undef  MAX_LOG_MESSAGE_SIZE
    #define MAX_LOG_MESSAGE_SIZE 256                                                
    #undef  WriteFile   // To deconflict formatio (CVI) version of this function
    #undef  ReadFile    // To deconflict formatio (CVI) version of this function             
    /*== TYPEDEFS ====================================================================================================*/
    // Data type providing reference structure for thread local storage (TLS).
    typedef struct ThreadData {
      CHAR ErrorString[MAX_STRING_SIZE];
    } ThreadData, * LPTHREADDATA;
    /*== MODULE SCOPE VARIABLES ======================================================================================*/   
    static FILE * logFileStream;                      
    static HANDLE hModule = INVALID_HANDLE_VALUE;
    /*== GLOBAL (HEAP) VARIABLES =====================================================================================*/
    // TLS index
    DWORD g_dwTlsIndex;
    /*== PROTOTYPES ==================================================================================================*/    
    /*== CODE ========================================================================================================*/  
    * Function: DllMain
    * Description:
    *    DLL Main entry point.  Provides for DLL initialization.  
    * Limitations:
    * Parameters:  System defined.
    * Return Value:
    BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) {
      LPTHREADDATA lpThreadData;      
      switch (fdwReason) {
        case DLL_PROCESS_ATTACH:
          // Allocate a TLS index.
          if ((g_dwTlsIndex = TlsAlloc ()) == 0xFFFFFFFF) return FALSE;
          hModule = hInstDLL; 
          // No break - fall through and initialize for main thread
        case DLL_THREAD_ATTACH:
          lpThreadData = (LPTHREADDATA) calloc (1, sizeof (ThreadData));
          if (lpThreadData != NULL) TlsSetValue (g_dwTlsIndex, lpThreadData);
          lpThreadData = TlsGetValue (g_dwTlsIndex);
          lpThreadData->ErrorString[0] = '\0';     
          break;
        case DLL_THREAD_DETACH:
          // Release the allocated memory for this thread.
          lpThreadData = TlsGetValue (g_dwTlsIndex);
          if (lpThreadData != NULL) free (lpThreadData);
          break;
        case DLL_PROCESS_DETACH:
          // Free the allocated memory for this thread (main thread).
          lpThreadData = TlsGetValue (g_dwTlsIndex);
          if (lpThreadData != NULL) free (lpThreadData);
          // Release the TLS index.
          TlsFree (g_dwTlsIndex);
          break;
      return TRUE;
    } // end, DllMain
    INT DLLSTDCALL DllEntryPoint (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
      // Included for compatibility with Borland
      return DllMain (hinstDLL, fdwReason, lpvReserved);
    } // end, DllEntryPoint
    implement dll functions like this:
    int DLLEXPORT DLLSTDCALL myFunc (int iParam) {
      return 1;

  • Linker "unresolved external" error

      I have a large project written in straight C that Visual Studio 2013 (with a little forcing) compiles and runs without error.  I have written a C++ shell around it to create a new project.  Everything works except that I get
    the “unresolved external” error for every instance of my C-style declarations, i.e., where I declare a variable directly with first use, and forever thereafter declare it with the “extern” keyword. How (exactly) can I fix this?  

      I found the “unresolved external” problem.  What happens is that VS will not “port” an initial declaration in a .cpp file into a set of .c files (and vice versa) so when it hits my “extern” declarations in the set of .c files which I assumed
    would be associated with the initial declarations in the set of .cpp files in my .cpp shell, It thinks none of them has a legitimate initial antecedent.  Since I need only two .cpp files in the shell, this was easily fixed.  However, the project
    still won’t compile because I have apparently not set up my header files properly.  This results in hundreds of errors like the following, where VS attacks and rejects its own MS code:  “IntelliSense: declaration is incompatible with "double
    __cdecl acos(double _X)" (declared at line 474 of "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\math.h") c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\cmath.” I might eventually be able to “fiddle” my way to
    a solution, but any help would certainly be appreciated.

  • "Unresolved external"-- How do I compile NI-DAQ apps with Borland C++ ?

    I'm a newbie. I am attempting to resurrect some code which a former worker left behind.
    I am getting "Error: Unresolved external..." at link time for all the NI-DAQ calls.
    More info:
    I've installed Borland C++ 5.5 and its associated command line tools.
    I've added E:\Borland\Bcc55 and E:\Borland\Bcc55\bin to my path (NT, so I use Control Panel-->System)
    I have created bcc32.cfg and ilink32.cfg files per Borland's readme.
    I've tried various ways of adding -L"C:\Program Files\National Instruments\NI-DAQ\Lib" to the compile, both in the command line and in the .cfg files.
    What am I missing? More details available on request.
    Any help would be greatly appreciated.
    Since
    rely,
    Mike

    Mike,
    I was wondering if you ever found a solution to this issue, and if so what was it. I've run into a similar problem and the knowledgebase article which was suggested to you has not helped me.
    Any information you might have would be greatly appreciated.
    I'm using:
    Borland C++ Builder 5
    Ni-daq 6.9.1
    And I get the following error message when I build my project:
    [Linker Error] Unresolved external 'DIG_Out_Prt' referenced from
    C:\SCOTT\DLL_CODE\ELLIPSE_TEST1\WRITETOPB.OBJ
    Scott
    [email protected]

  • Linker error: error LNK2001: unresolved external symbol __imp_printf

    On a newly installed compiler, Visual Studio 2013, I get some linker error:
    Sample program (for test):
    #include <stdio.h>
    int main ()
    printf("Help");
    return 0;
    I get some linker errors:
    Error 2 error LNK2001: unresolved external symbol __imp_printf F:\ug_info\indices\Project1\Project1\Source.obj Project1
    Error 1 error LNK2001: unresolved external symbol __security_check_cookie F:\ug_info\indices\Project1\Project1\Source.obj Project1
    Error 3 error LNK2001: unresolved external symbol mainCRTStartup F:\ug_info\indices\Project1\Project1\LINK Project1
    I thinks there is a configuration issue..
    Any suggestions?

    Hi Camiel.Rys,
    Thanks for posting in MSDN forum.
    Error 3 error LNK2001: unresolved external symbol mainCRTStartup F:\ug_info\indices\Project1\Project1\LINK Project1
    I would guess that you may create a wrong project template. Could you try to create a new Win32 Console project following this document?
    Walkthrough: Creating a Win32 Console Program (C++)
    Best regards,
    Shu Hu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • C++ Kinect SDK: error LNK2019 unresolved external symbol

    I'm receiving the message "error: LNK2019" error when I attempt to run a basic C++ Kinect program.  I am running Windows 7 32bit with the Kinect SDK 1.0 and developing in Visual Studio 2010.  The included Skeletal Viewer sample works correctly,
    so I believe my problem lies in the project configuration.  I tried comparing my project config to the sample's, but I can't find any differences so I thought I'd open this up to the forums.  Is there any missing or incorrect information that I'm
    not seeing?  Or is there some other configuration I should be checking?
    Thank you in advance.
    #include "stdafx.h"
    #include <iostream>
    #include <windows.h>
    #include <NuiApi.h>
    #include <stdio.h>
    -- Include Directories: --
    $(VCInstallDir)include;
    $(VCInstallDir)atlmfc\include;
    $(WindowsSdkDir)include;
    $(FrameworkSDKDir)\include;
    $(KINECTSDK10_DIR)\inc;
    -- Library Directories --
    $(VCInstallDir)lib;
    $(VCInstallDir)atlmfc\lib;
    $(WindowsSdkDir)lib;
    $(FrameworkSDKDir)\lib;
    $(KINECTSDK10_DIR)\lib\x86;
     These are the specific errors I'm getting:
    1>kinectruntime.obj : error LNK2019: unresolved external symbol __imp__NuiImageStreamGetNextFrame@12 referenced in function _main
    1>kinectruntime.obj : error LNK2019: unresolved external symbol __imp__NuiImageStreamOpen@24 referenced in function _main
    1>kinectruntime.obj : error LNK2019: unresolved external symbol __imp__NuiInitialize@4 referenced in function _main

    Is kinect10.lib listed among the libraries in your project's properties, under Linker | Input | Additional Dependencies?
    If not, that is the likely cause for the errors.
    John
    K4W Dev
    That was it!  Thank you for the quick response and the clear directions.
    Since I see you're with Microsoft, I'd like to point out this step was missing from the set up instructions that come with the SDK installation.  This guide says to link kinect10.lib by linking
    $(KINECTSDK10_DIR)\lib\x86;  As we saw here, that's not quite the same thing!
    Programming Guide > Using Visual Studio > To Create an Unmanaged Application > Step #5

  • Unresolved external symbol _sqlcxt

    hello
    i was trying to compile Pro*C program on windows 7 professional 64 bit with visual studio, and I get the following error while linking library. Please help!
    envionment:
    windows 7 professional 64 bit
    Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (x64)
    visual studio(i tried both 2005 and 2008)
    error LNK2019: unresolved external symbol _sqlcxt referenced in function.
    error LNK2019: unresolved external symbol _sqlglm referenced in function.
    the program was compiled and worked on windows xp/oracle 9/visual studio 2005 just fine.
    Thanks in advance.
    Ivan

    try this:
    in the IDE go to project properties, configuration manager and create a new config for 64bit platform - I had exaqctly the same issue when porting existing code that runs fine using 10g lib but wouldn't find sqlcxt using 11g lib under win7 64 and vs2010 - changing platform to 64bit fixed it for me

Maybe you are looking for

  • Tired of replacements that don't work!!!

    I am on my 3rd replacement of a 4th generation 20gb ipod, originally purchased in August, 2004. Each replacement has had either a bad hard drive, a malfunctioning click wheel or some other problem which I have now forgotten. I received my last replac

  • 11i Error when modifying account

    eBus 11.5.10.2, DB 10.2.0.4, OID 10.1.4.0.1, RHEL4 Apps and OID on are on the same server, single instance, DB is on a seperate server. Recently when we try to modify the account of a user we experience an error when trying to save the changes. The p

  • How can get my labels in a screen(dynpro) dynamically .

    Hi All, I have a route screen which has got 6 fields which are the activities in PLPO.So the text of these activites which are 6 are gonna changes.Like let us say for material 5867 I will have to go read PLPO and read VGWTS for it and then on basis o

  • HT1766 Where do I find my iPhone backups on my PC?

    Where do I find my iPhone backups on my PC?

  • Why is my mac book so slow compared to other laptops used in my household?

    Hi, I recently purchased an HP laptop with very similar specs to the mac book pro im using.  The HP had 2.4 megahertz of speed plus a booster and it was SUPER FAST.  I ended up returning it after a week because i wanted to get a mac.  When i went on