Forum Discussion
Altera_Forum
Honored Contributor
16 years agojeffa,
First off, I am not a Windows programmer either, but I manage to hack my way along when I need to. Let's see if I can help you. I note that in the linker error message that a __cdecl call is being initiated. This is interesting, because I recompiled my test code a few minutes ago and did not get that error. I also note that the jtag_atlantic.h header is located in the resource files folder of the project along with jtag_atlantic.lib. My main code is nothing more than a hacked up version of the original Cygwin test app. I looked at some of my project settings next. They are: 1. General Tab: Not Using MFC 2. Debug Tab: Category: Additional DLLs: check box checked for "try to locate other DLLs" 3. C/C++ Tab: Category: Precompiled Headers: radio button checked for "Use precompiled header file (pch)" Through header: stdafx.h 4. C/C++ Tab: Category: Code Generation: Calling convention: __cdecl*, Processor: blend*, Use run-time library: Debug single-threaded, Struct member alignment: 8 bytes* 5. Link Tab: Category: General: "Link Incrementally" check box checked along with "Generate debug info". 6. Link Tab: Category: Customize: "link incrementally" and "use program database" are both checked. There should be a *.pdb file name listed under Program database name. 7. Link Tab: Category: Debug: Debug Info: "Debug Info" check box checked, "Microsoft format" radio button depressed, "Separate bytes" check box checked. There are other settings which should be the same since they are default settings which I did not go into. In fact, most of the settings I gave you were set by default. Locate the *.lib, *.dll, *.h, and *.exp files in the local project folder. Add the *.lib and *.h files to the MSVC project under "Resource Files" before compiling and linking. Also, make sure that you start out with a "Hello World" Win32 console application first and then bring in your own main.cpp or test.cpp, or whatever else you called it. If you do not do this, you will not have the necessary stdafx.h file included in your project and you will get linker errors. Another thing you might want to look at is the contents of your jtag_atlantic.h file. There should be an enumerated JATL_ERROR type return for jtagatlantic_get_error function prototype. This enumerated type is located in the library. So, if your library was not created properly, you might have this problem. Along those lines, check the def file that you used. Make sure that it conforms with MSVS requirements, and that you have all of the functions listed. I kind of remember getting this same error early on when I was working at solving the DLL inconsistency problem, but I was moving so fast that it seemed arbitrary to me at the time and I was able to solve it with either a project setting, file relocation, or starting a new project using the "Hello World" Win32 console application wizard. I can't remember which one it was right now. However, if you continue to have problems, my suggestion is to move the code, DLL, lib, and exp files to a safe place after rebuilding the library and checking the def file as mentioned earlier, delete the project folder, create a new project folder and start out fresh with a "Hello World" Win32 console application. Then, add your files where prescribed and rebuild the project. BTW, I hate Windows. But, we use Windows PCs at work. This type of work is better done under Unix or Linux. Cygwin is just a bandaid IMHO.