The MASM Forum

Projects => Rarely Used Projects => GoAsm => Topic started by: garyhess on October 10, 2012, 01:12:19 AM

Title: Linker error for GetOpenFileName
Post by: garyhess on October 10, 2012, 01:12:19 AM
I'm using Easy Code / GoASM and trying to call GetOpenFileName as follows:

Invoke GetOpenFileName, Addr ofn

However, I'm getting the following linker error:

Linking...

Error!
The following symbol was not defined in the object file or files:-
GetOpenFileNameA
Output file not made

Errors ocurred.


I guess that I need to include some other header file that defines GetOpenFileName. Any suggestions? I've been exploring various Win32 functions with Easy Code / GoASM and this is the first time I've had this problem.

Thanks,
Gary

Title: Re: Linker error for GetOpenFileName
Post by: TouEnMasm on October 10, 2012, 01:35:50 AM

The error is at link,need a library comdlg32.lib
Title: Re: Linker error for GetOpenFileName
Post by: garyhess on October 10, 2012, 02:14:18 AM
I have commdlg.inc but not comdlg32.lib.

I just found a copy of comdlg32.lib but I'm not sure how to link it in Easy Code. Any ideas?
Title: Re: Linker error for GetOpenFileName
Post by: Vozzie on October 10, 2012, 02:25:31 AM
Hi,

Menu Project -> Add library files...

Or in project explorer, right click your project, choose "Add library" from the context menu.

Select the library files you need...

You should add both the include (.inc) as the library file (.lib). To add include files, repeat the steps but instead of "Add library" select "Add include" ...
Title: Re: Linker error for GetOpenFileName
Post by: garyhess on October 10, 2012, 03:36:02 AM
Hi Vozzie,

I don't have "Add library files..." under " Project".  I wonder what version of Easy Code you are using? I have version 1.06.0.0015 GoAsm. Screenshot attached.

I tried to add "comdlg32.lib" but I get the following message:

comdlg32.lib: File has not been added because GoLink linker ignores static library files (*.lib).

Any ideas? I'm still getting the same linker error when I try to compile.

Gary
Title: Re: Linker error for GetOpenFileName
Post by: wjr on October 10, 2012, 04:01:50 AM
For this, GoLink does not use the comdlg32.lib file, but instead requires the comdlg32.dll file. Under Project, "Files to link" will allow you to add this file...
Title: Re: Linker error for GetOpenFileName
Post by: garyhess on October 10, 2012, 05:34:06 AM
Thanks!

I started to search the web for "comdlg32.dll", but then I found out it's sitting in "c:\WINDOWS\system32".

Now it compiles and links OK.
Title: Re: Linker error for GetOpenFileName
Post by: Vozzie on October 11, 2012, 01:16:59 AM
Hi,

Quote from: garyhess on October 10, 2012, 03:36:02 AMI wonder what version of Easy Code you are using?

The MASM version, that's probably why. Nice to know that GoAsm doesn't need the lib but dll.  :t