Windows form linker error

Windows form linker error

Hi, I'm getting a linker error when setting up a windows form application to use ATDS. I do not get the error when I use the exact method to build a console application. Here is the code, and the error message I am getting. Do I need to use a different namespace for ApplicationId? [CODE] #include "stdafx.h" #include "Form1.h" #include "adpcppf.h" com::intel::adp::Application * myApplication = NULL; com::intel::adp::ApplicationId myApplicationId = ADP_DEBUG_APPLICATIONID; using namespace atds_form_test; [STAThreadAttribute] int main(array ^args) { // Enabling Windows XP visual effects before any controls are created System::Windows::Forms::Application::EnableVisualStyles(); System::Windows::Forms::Application::SetCompatibleTextRenderingDefault(false); // Create the main window and run it System::Windows::Forms::Application::Run(gcnew Form1()); return 0; } [ERROR MESSAGES] Error 1 error LNK2028: unresolved token (0A000015) "public: virtual __clrcall com::intel::adp::ApplicationId::~ApplicationId(void)" (??1ApplicationId@adp@intel@com@@$$FUAM@XZ) referenced in function "void __clrcall `dynamic atexit destructor for 'myApplicationId''(void)" (???__FmyApplicationId@@YMXXZ@?A0x4b55f921@@$$FYMXXZ) atds_form_test.obj atds_form_test Error 2 error LNK2020: unresolved token (0A000016) ADP_DEBUG_APPLICATIONID atds_form_test.obj atds_form_test Error 3 error LNK2028: unresolved token (0A000017) "public: __clrcall com::intel::adp::ApplicationId::ApplicationId(struct ADP_APPLICATIONID)" (??0ApplicationId@adp@intel@com@@$$FQAM@UADP_APPLICATIONID@@@Z) referenced in function "void __clrcall `dynamic initializer for 'myApplicationId''(void)" (???__EmyApplicationId@@YMXXZ@?A0x4b55f921@@$$FYMXXZ) atds_form_test.obj atds_form_test Error 4 error LNK2019: unresolved external symbol "public: __clrcall com::intel::adp::ApplicationId::ApplicationId(struct ADP_APPLICATIONID)" (??0ApplicationId@adp@intel@com@@$$FQAM@UADP_APPLICATIONID@@@Z) referenced in function "void __clrcall `dynamic initializer for 'myApplicationId''(void)" (???__EmyApplicationId@@YMXXZ@?A0x4b55f921@@$$FYMXXZ) atds_form_test.obj atds_form_test Error 5 error LNK2001: unresolved external symbol ADP_DEBUG_APPLICATIONID atds_form_test.obj atds_form_test Error 6 error LNK2019: unresolved external symbol "public: virtual __clrcall com::intel::adp::ApplicationId::~ApplicationId(void)" (??1ApplicationId@adp@intel@com@@$$FUAM@XZ) referenced in function "void __clrcall `dynamic atexit destructor for 'myApplicationId''(void)" (???__FmyApplicationId@@YMXXZ@?A0x4b55f921@@$$FYMXXZ) atds_form_test.obj atds_form_test Error 7 fatal error LNK1120: 6 unresolved externals C:\Documents and Settings\tamuilen\My Documents\Visual Studio 2008\Projects\more\atds_form_test\Debug\atds_form_test.exe 1 atds_form_test
18 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hey, that fixed the app on my station too! Thanks for the help. Here is a link to the code that will last longer:
http://appup.themuilenburgs.com/atds_form_test.zip

Hi,

I've downloaded files from this link. It is throwing some error like fatal error C1083: Cannot open include file: 'adpcppf.h': No such file or directory.

I'm using using visual studio 2008. How to fix this issue.

Any help would be really appreciated.

Thanks,
VSuhaasinii

Can anybody help me on this?

Make sure the following libs are there in the linkers additional dependencies

for Debug version

adpcored.lib adpcppfd.lib Psapi.lib Advapi32.lib shlwapi.lib

for Release

adpcore.lib adpcppf.lib Psapi.lib Advapi32.lib shlwapi.lib

Thanks for the quick response. I have the files listed under the debug linker input, but I'm not sure if I have Advapi32.lib on my computer anywhere. I searched my ...\Intel\Intel Atom Developer Program SDK\0.91 folder, and it did not come up. Do I need to download it?

Psapi.lib Advapi32.lib shlwapi.lib is a standart Windows libraries. It must be already installed with Visual Studio

Ok, visual studio should be fine on my computer. I can run the ATDS authenticaton from my hello world console application, and the Facebook example runs and authenticates fine too. Also, this form runs the first line without issue:

com::intel::adp::Application * myApplication = NULL;

Tony,

Please paste your Linker command options. It sounds as if you have not included the standard windows libraries.

Is this what you mean?

/OUT:"C:\Documents and Settings\tamuilen\My Documents\Visual Studio 2008\Projects\more\atds_form_test\Release\atds_form_test.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files\Intel\Intel Atom Developer Program SDK\0.91\lib" /MANIFEST /MANIFESTFILE:"Release\atds_form_test.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Documents and Settings\tamuilen\My Documents\Visual Studio 2008\Projects\more\atds_form_test\Release\atds_form_test.pdb" /SUBSYSTEM:WINDOWS /LTCG /ENTRY:"main" /DYNAMICBASE /FIXED:No /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT adpcore.lib Psapi.lib shlwapi.lib adpcppf.lib Advapi32.lib

I tried to attach the whole project as a zip file for your reference (it's only 35k) but I was not able to upload it. I even tried to rename it to .jpg. I guess files are not allowed on the site yet huh?

I added a link to the source here: http://www.mediafire.com/file/1kziin2m32m/atds_form_test.zip Any help would be much appreciated.

Tony,

I have a solution for you. I downloaded your app and was able to find the issue.

Go to your application properties (Right click on your project and choose Properties), "Configuration Properties" -> "General" and look at your "Common Language Runtime Support, change /clr:pure to /clr.

My output:

1>------ Rebuild All started: Project: atds_form_test, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'atds_form_test', configuration 'Release|Win32'
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>atds_form_test.cpp
1>AssemblyInfo.cpp
1>Compiling managed resources...
1>Read in 0 resources from "c:\dev\atds_form_test\atds_form_test\Form1.resX"
1>Writing resource file... Done.
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>Generating code
1>Finished generating code
1>Embedding manifest...
1>Build log was saved at "file://c:\dev\atds_form_test\atds_form_test\Release\BuildLog.htm"
1>atds_form_test - 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Very cool, it's linking properly now, thanks! Did you get a chance to try running it after the build? It
complains to me about a failed assertion. I read around that this can happen
when trying to delete something twice, or when declaring and deleting variables
incorrectly, but I'm getting the error by just including "adpcppf.h". Should I Start a
new thread for this? THe error looks like this:

Debug assertion failed!
Program ... \atds_form_text.exe

expression _CrtIsValidHeapPointer(pUserData)

Thanks,
Tony

No worries. I will try it tonight and see what I come up with.

Tony,

I am not able to replicate the error you are describing. Please post a zip file containing the project in the current state (with the errors) and I will get to the bottom of the issue for you.

Here is a link to the source and compliled code:
https://www.yousendit.com/download/OHo0T0NlcTJ5Ukh2Wmc9PQ

I hope it is as simple as a missing lib file. Thanks again for the help.

Tony,

Here is your fix: Go to your project properties, then the linker section, then click Input. Add "__DllMainCRTStartup@12" to the "Force Symbol References" section.

The problem is that the Visual Studio project wizard set things up to skip the CRT startup code. perhaps because you selected ATL features during the wizard process.

Please let me know how that works out for you, it starts up correctly for me now with that change.

* A little more detail if you are interested and have an MS Connect account: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99715&wa=wsignin1.0

Excellent to hear. Please feel free to send more questions my way anytime.

Leave a Comment

Please sign in to add a comment. Not a member? Join today