Author Topic: Linker error for GetOpenFileName  (Read 4803 times)

garyhess

  • Guest
Linker error for GetOpenFileName
« on: October 10, 2012, 01:12:19 AM »
I'm using Easy Code / GoASM and trying to call GetOpenFileName as follows:

Code: [Select]
Invoke GetOpenFileName, Addr ofn
However, I'm getting the following linker error:
Code: [Select]
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


ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Linker error for GetOpenFileName
« Reply #1 on: October 10, 2012, 01:35:50 AM »

The error is at link,need a library comdlg32.lib
Fa is a musical note to play with CL

garyhess

  • Guest
Re: Linker error for GetOpenFileName
« Reply #2 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?

Vozzie

  • Guest
Re: Linker error for GetOpenFileName
« Reply #3 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" ...

garyhess

  • Guest
Re: Linker error for GetOpenFileName
« Reply #4 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:

Code: [Select]
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

wjr

  • Member
  • **
  • Posts: 209
    • WJR's website
Re: Linker error for GetOpenFileName
« Reply #5 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...

garyhess

  • Guest
Re: Linker error for GetOpenFileName
« Reply #6 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.

Vozzie

  • Guest
Re: Linker error for GetOpenFileName
« Reply #7 on: October 11, 2012, 01:16:59 AM »
Hi,

I 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