Editing Macros in VS2012?

I've heard they stopped having macros since VS2011 but I'm using Visual Studio 2012 Express for Desktop and I have macros here and they're giving me problems. They don't match the paths I set up and I need the macros to be the same as these paths and not the opposite. The macros are wrong.

What can I do? What details do you need? Here's the output:

1
2
3
4
5
6
  1
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(1137,5): warning MSB8012: TargetPath(C:\PROJECTOS\cm2\tutorials_fem\tutorial02_T3\DebugWin32\tutorial02_T3.exe) does not match the Linker's OutputFile property value (C:\PROJECTOS\cm2\tutorials_fem\tutorials.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(1139,5): warning MSB8012: TargetName(tutorial02_T3) does not match the Linker's OutputFile property value (tutorials). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>MSVCRTD.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp__GetTickCount64@0 referenced in function ___security_init_cookie
1>C:\PROJECTOS\cm2\tutorials_fem\tutorials.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Extra info: I'm compiling some tutorials of MeshTools CM2 and I need to compile a solution consisting of a group of solutions. All I have to do is be able to run it without any problems. My OS is Windows 8.1 64-bit, although I'm running the solutions in 32-bit mode.
I'd say that the warnings are not necessarily a problem.

For GetTickCount64 read this:

http://msdn.microsoft.com/de-de/library/windows/desktop/ms724411%28v=vs.85%29.aspx

Especially:
MSDN wrote:
To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later.
That's good news. Thank you! I hope you're right.

I'm not quite sure about what the problem might be with GetTickCount64. What are the possible causes of this error so I can investigate the code better? I'm a bit new to C++ as you can imagine. I'm new to MeshTools too.

I'll be learning about C++ latter on but right now this is an urgent task I have for the company I'm interning in and all I have to do is get this to run.

Just point me in the right direction.



You need to #define _WIN32_WINNT 0x0600 before you include windows.h (if your project has a file targetver.h it is usually placed there)

Alternative you may use GetTickCount (Note: No 64). The problem is that it counts the ticks for just about 50 days, but it works on all systems.
I've heard they stopped having macros since VS2011 ...

Can anyone source this? You can't not have Macro's with the WinAPI, it's how the header files manage version control and what functions are available.

What are the possible causes of this error so I can investigate the code better?

By default the '_WIN32_WINNT' Macro will be defined in one header file or another, often for the lowest version being supported. The version it is defaulting to is probably XP or earlier since this function requires Vista or later.
Computergeek01 wrote:
Can anyone source this? You can't not have Macro's with the WinAPI, it's how the header files manage version control and what functions are available.


Some guy linked me to this when I asked for help with macros on VS2012

http://www.infoq.com/news/2011/10/VS-Macros


I made some alterations in this file:

http://imgur.com/UNo0d0i


Apparently I can't open msvrtd.lib because VS2012 Express for Desktop didn't come with the necessary stuff to open it.

http://i.imgur.com/Zvf7RAw.png?1

http://imgur.com/DmoOeBV



That's the file I need to edit though, right?
Last edited on
I'm sorry. Is this the file I need to edit? How do I go about proceeding?
You aren't supposed to edit those files, just define those Macro's before you include their headers in your projects source code. That's why those '#ifndef' blocks are encapsulating them.
How exactly do I define these macros? :s

Is it just some sort of #define $TargetPath([path]) ??

Also, in main.cpp?
Aurum wrote:
Some guy linked me to this when I asked for help with macros on VS2012

http://www.infoq.com/news/2011/10/VS-Macros

The article is not talking about the C/C++ kind of macros. A macro can also be a set of instructions that can be used to automate certain tasks, in this case in the IDE (Visual Studio).

http://en.wikipedia.org/wiki/Macro_(computer_science)
http://msdn.microsoft.com/en-us/library/b4c73967%28v=vs.100%29.aspx
How exactly do I define these macros

Like this: #define _WIN32_WINNT 0x06000000 swap out the name of the Macro and the value as needed.

Also, in main.cpp?

The actual final location is arbitrary. Just make sure it is written somewhere "above" the inclusion of the header file.
Topic archived. No new replies allowed.